I'm hacking together an extension which will display a sidebar with an outline of whatever document you're working on. It was initially written to support writing in markdown-mode, but the technique I'm using (which might be bone-headed) relies on using outline-mode commands like outline-hide-body
. As such, the extension should, I think, work for any mode for which these commands have an effect.
So my question is: is there a way to determine if outline-mode commands - and specifically outline-hide-body
- are properly defined for a given buffer?
Right now I just rely on a list of major-modes (e.g. org-mode, markdown-mode) for which I know these commands work. But this seems like a relatively weak approach since it ignores e.g. outline-minor-mode which I should probably check for as well. So before I go down the path of trying to enumerate the the major and minor modes I can work with, I thought I should see if there's a better way.
describe-mode
doesn't listoutline-minor-mode
for markdown-mode (in my nearly stock spacemacs config). Or am I missing/misunderstanding something? – abingham Jul 24 '17 at 11:54markdown-mode
does not useoutline-minormode
but handles outlining itself. – Tobias Jul 24 '17 at 19:49outline-hide-body
work properly inmarkdown-mode
. I think this is becausemarkdown-mode
definesoutline-regexp
. – abingham Jul 25 '17 at 5:50navi-mode
. You might be able to build your package on top of it and save yourself a lot of code. :) – user3871 Jul 31 '17 at 0:34