The Org-mode manual indicates these possible values for initial visibility:
With the following meanings, according to the summary of in-buffer setting:
overview top-level headlines only
content all headlines
showall no folding of any entries
This seems to work for me. You type M-x disappear to hide the regular text, and M-x reappear to show it again. It does not hide text that uses other faces. Also, if you select a region with your mouse, you will be able to see the text in the highlights. Maybe that is a feature.
(setq default-background (face-attribute 'default :background)
Yes. Set variable isearch-filter-predicate to a function that returns nil for the text that you want to ignore for search and query-replace.
(Set it back to its default value of isearch-filter-visible when you're done. Alternatively, define your own search or query-replace function that binds the variable and then invokes regular Isearch or query-replace. ...
The TAB key runs the command org-cycle, which does a
whole bunch of stuff under the hood. In the context you're
talking about, org-cycle cycles through the visibility of the
buffer, hiding and showing the entries.
Long story short, org-cycle runs org-cycle-hook. The first
part of the docstring reads:
Hook that is run after org-cycle ...
As far as I am aware, moving the cursor around should not magically make the cursor reappear. Try out a default Emacs -Q and see if the behavior is present or not. Setting the variable cursor-type to nil in a particular buffer should achieve the visual effect desired.
See Also: The popular built-in blink-cursor-mode uses internal-show-cursor to hide the ...
Library subr+.el has functions that help with this. This one, for instance:
(defun buffer-substring-of-visible (start end)
"Return contents of visible part of buffer from START to END, as a string.
START and END can be in either order."
(buffer-substring-of-unpropertied start end 'invisible))
Here are some others, which are similar:
Showing just a visible summary of the buffer is one of the
features of org-mode, which is, in turn, built on top
The idea is to get a lot of the details out of the way so you can
get an overview of the buffer contents, and then drill down into
the relevant sections by unfolding/showing the contents while
leaving everything else folded/...
buffer-invisibility-spec is a buffer local variable.
If you want globally set the key you must add a to the default value of buffer-invisible-spec.
global-set-key is a function therefore the argument (add-text-properties ...) is evaluated before global-set-key. The return value of add-text-properties is undefined in the doc. So you bind your keys to some ...
It sounded good, so I made a quick implementation of the idea.
If the indentation of the current line only is used, navigation becomes difficult, so I chose to consider also the indentation of the next line.
(current-indentation) gives the indentation of the line at point.
post-command-hook is a suitable place for executing the ...
One easy solution is to use libraries zones.el and isearch-prop.el.
zones.el is about defining and using sets of zones of contiguous text. In this case, you use only one zone, defined by the region.
isearch-prop.el is about isearching text-property or overlay-property contexts. Visibility is just one kind of property.
(You can do the same thing using just ...
On the one hand you set the invisible property to t on the other hand you set the display property to json-mode-fold-ellipsis. That combination does not make much sense. Use only one of those.
If you use the display property you should propertize the shown text with the keymap property -- not the text to be replaced.
You can test the following code in the *...
Your key-binding code is wrong, to start with.
This will get you started: use (kbd "<mouse-2>"), not (kbd "mouse-2").
Put (debug) in your lambda to continue debugging.
(Do that to start with, and you'll see that <mouse-2> is not bound to your command with your key binding - the debugger is not invoked. A call to message in your command would ...
If you use Bookmark+ then you can add a bmkp-jump tag to any bookmark, to carry out any action just after that particular bookmark location is jumped to.
Give this tag a value that is a function, which then is called
whenever the tagged bookmark is visited. Any Lisp-readable
function value is allowed: a symbol or a lambda expression.
For example, to ...
If I'm not mistaken, Example-1 and 2 are not headers, but list elements. I'd suggest turning them into headers (by adding ****).
If you insist on using lists, or just would like to fold code-blocks and other text under items, make sure to indent everything that follows and should go under the item (i.e., should collapse with the item).
I'd clean up your ...
You haven't properly escaped the regexp for "\question". It should be:
This is a string, and in order to encode a single backslash in a string, it needs to be escaped with a backslash of its own. And in order to use a literal backslash in a regexp, it must be escaped with another backslash. So to get a regexp to match a single literal \ ...