I found this SO post: https://stackoverflow.com/questions/944614/emacs-does-hideshow-work-with-xml-mode-sgml-mode
The org function you are looking for is org-map-entries.
(org-map-entries FUNC &optional MATCH SCOPE &rest SKIP)
This calls function for each heading determined by MATCH and SCOPE
and returns a list of all return values. Thus
(1- (length (org-map-entries nil nil 'tree)))
returns the number of subentries of the heading at point. To get something ...
You can change the characters more generally for selective display with:
'selective-display (string-to-vector " ◦◦◦ ")) ; or whatever you like
I've been using these characters because I find them easier to see than the periods, and yet not too distracting. To each their own, though.
Personally, instead of setting it only for Org, I do it globally with:
(setq standard-display-table (make-display-table)))
(when (fboundp 'make-glyph-code)
(set-display-table-slot standard-display-table 4
(vector (make-glyph-code ?…)
One option is to check the source.
M-x find-library outline
You'll find in the header comments:
;; Copyright (C) 1986, 1993-1995, 1997, 2000-2019 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
M-x find-library org
;; Copyright (C) 2004-2019 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
So, both are included with ...
If I understand the question, you are looking for a way to edit markdown files where you can show or hide sections, navigate by headings and so on.
I've never used allout-mode but it does look like you could configure it to recognize markdown syntax. However, another option is to take a look at markdown-mode which supports navigation and folding, e.g.
Edited in response to first comment
Not quite sure if this is what you want, but here's a function that will show the current subtree (and its children) and fold all other headings to their top level:
(defun ess/org-show-just-me (&rest _)
"Fold all other trees, then show entire current subtree."
Here's a function that will count the subheadings (which works more generally for outline-mode, and therefore for org-mode, which is built on top of outline-mode). You could, presumably, write a more elegant version, but this one works fine:
(defun outline-count-subheadings ()
"Count the number of subheadings below the current heading."
(let ((sum 0)
If you need H2 to have heading like features (eg you can tag, put properties, etc), you can use inline tasks for this as @NickD suggested (see M-x find-library org-inlinetask). You insert one with C-c C-x t. These are like regular headings but not part of the hierarchy.
L1 Some introductory text for H1
L2 Some text relating to H2
There is a configuration value org-yank-folded-subtrees that accomplishes this, but you need to use:
org-cut-special (C-c C-x C-w) to kill the subtree initially and then
org-paste-special (C-c C-x C-y) to yank that subtree
I've found two ways that can be useful:
enable hideshow mode (hs-minor-mode) and use the provided functions
Apparently markdown-mode inherits from outline mode (or at least the functions are available here!) so you can use functions like hide-subtree and show-subtree.
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 \ ...
As @nichijou points out, C-c * on the region will turn a sequence of plain lines into a sequence of headings (and vice-versa: in this context, org-ctrl-c-star runs the function org-toggle-heading which turns text to headings or headings to text - you should do C-h f on each of these functions to find out more about it, e.g. what happens with list items).
Digging further, I feel stupid(er than usual). Removing outshine-mode completely, I still get org-like folding behavior in markdown-mode, and this is because org-like folding is already in markdown mode! (See under "Usage".)
As for the restructuring commands (moving one header above another and so on), these are just done by C-<down> etc. instead of M-...
An answer to the point : turn off displaying any outline path in the echo area.
Encountered the same problem : that behaviour appeared after changing the distribution from org to org-plus-contrib (from orgmode.org repository).
The under-the-point-headline-print-in-echo-area behaviour seems to come from org-eldoc which is activated via a hook in org-mode-...
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 ...
The user is free to use plus as bullet for plain lists. There is no special use case which is reserved for plus.
Follow the hint of Tyler [Jan 16 at 18:36] to find variants of plain lists within Org mode.