46
votes
Accepted
The old "how to fold XML" question
I found this SO post: https://stackoverflow.com/questions/944614/emacs-does-hideshow-work-with-xml-mode-sgml-mode
(require 'hideshow)
(require 'sgml-mode)
(require 'nxml-mode)
(add-to-list 'hs-...
18
votes
Accepted
Collapse sections in markdown
With markdown-mode by Jason Blevins you can toggle folding of the heading with Tab (same as in org-mode).
16
votes
Accepted
Changing the appearance of org-mode “hidden contents” ellipsis
Just customise the variable org-ellipsis. Something like
(setq org-ellipsis "…")
13
votes
The old "how to fold XML" question
web-mode has element folding built in and bound to C-c C-f. But you will lose some of the features of using nxml-mode obviously.
10
votes
Accepted
Counting sub-headings in org-mode using elisp
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 ...
9
votes
Changing the appearance of org-mode “hidden contents” ellipsis
You can change the characters more generally for selective display with:
(set-display-table-slot standard-display-table
'selective-display (string-to-vector " ◦◦◦ ")) ; or ...

Dan♦
- 31.1k
8
votes
Accepted
Org is implemented on top of Outline mode
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 ...
8
votes
Changing the appearance of org-mode “hidden contents” ellipsis
Personally, instead of setting it only for Org, I do it globally with:
(unless standard-display-table
(setq standard-display-table (make-display-table)))
(when (fboundp 'make-glyph-code)
(set-...
7
votes
Accepted
Enable any outline mode for markdown
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 ...
4
votes
Counting sub-headings in org-mode using elisp
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 ...

Dan♦
- 31.1k
4
votes
Accepted
How to show all contents of current subtree and fold all the other subtrees?
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:...
4
votes
Accepted
4
votes
Accepted
Reverting back to higher heading
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 ...
3
votes
Accepted
Bulk convert text under heading to individual sub-headings?
C-c * on region to run org-ctrl-c-star
3
votes
Accepted
Prevent org-mode from unfolding pasted outlines
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-...
2
votes
Collapse sections in markdown
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 ...
2
votes
Accepted
How to use outline-minor-mode to hide some exam class exercises in auctex
You haven't properly escaped the regexp for "\question". It should be:
"\\\\question\\b"
This is a string, and in order to encode a single backslash in a string, it needs to be escaped with a ...
2
votes
Bulk convert text under heading to individual sub-headings?
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 ...
1
vote
Accepted
outshine mode changes outline-regexp from markdown's
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 ...
1
vote
Accepted
bookmark-jump to a hidden part of a buffer
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, ...
1
vote
Keybinding for adding a new heading under a list item in org-mode
Ooops, I should have tried harder before posting this question:
C-return
does the trick. Sorry for asking.
1
vote
Meaning of plus in org mode documents
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 ...
1
vote
How to change the face of org-display-outline-path in echo area?
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 (...
1
vote
Outline editing, like org-mode, for JSON
Emacs comes with hs-minor-mode which can be used selectively hide/show code and comment blocks in several languages, including JavaScript. By default this will let you hide and show JSON blocks ...
1
vote
Hide all header contents in Org mode
This function is obsolete since 25.1;
use ‘outline-hide-sublevels’ instead.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
outline × 27org-mode × 17
outline-mode × 6
code-folding × 3
visibility × 3
markdown-mode × 2
key-bindings × 1
org-export × 1
auctex × 1
elisp × 1
customize × 1
advice × 1
bookmarks × 1
markdown × 1
echo-area × 1
line-numbers × 1
path × 1
occur × 1
json × 1
writing × 1
cycling × 1
xml × 1
nxml × 1
hideshow × 1
notmuch × 1