Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add outline-minor-mode with markdown headings #90

Closed
wants to merge 1 commit into from

Conversation

cosmicexplorer
Copy link
Contributor

outline-minor-mode allows traversing and folding headings, just like the outline-mode major mode. The keybindings don't conflict with any bindings already in markdown-mode, and allow folding just like org-mode. I couldn't think of what tests would be appropriate since this just adds the functionality outline-minor-mode already does, but I can definitely add some as required.

To play with it, just open a markdown file and try C-c @ C-c to hide, and C-c @ C-e to show a heading. There are more complex controls too, all the same as in outline-mode.

@syohex
Copy link
Collaborator

syohex commented Feb 7, 2016

outline-regexp is already set here

@cosmicexplorer
Copy link
Contributor Author

Oops, thanks. Removed.

@jrblevin
Copy link
Owner

jrblevin commented Feb 8, 2016

markdown-mode already has section folding functions which are robust to certain cases that cause outline-minor-mode to fail. Since it is based on a regular expression, it cannot distinguish between hash marks that are comments in code blocks and those that are actual ATX headings, so we run into issues like #33 and #75.

Is the main goal to use the well-known keybindings? If so, we can just add additional bindings that use the custom functions (markdown-show-subtree, markdown-hide-subtree, etc.).

@cosmicexplorer
Copy link
Contributor Author

Sorry, I didn't realize this had already been considered. Was looking for functions with the word "fold" in them and didn't find the ones already there. I'll look more thoroughly next time.

@cosmicexplorer
Copy link
Contributor Author

Although, what is the purpose of setting outline-regexp if outline-minor-mode isn't turned on? Is it so that people can add outline-minor-mode or something themselves?

EDIT: sorry about reopening this, misclicked.

@jrblevin
Copy link
Owner

jrblevin commented Feb 9, 2016

I think that was the original idea (allowing people to turn on outline-minor-mode if/when they wanted). At this point, I'd say we only use the name outline-regexp for historical reasons. I wouldn't really recommend using outline-minor-mode over the functions we have now (for both movement and folding).

@cosmicexplorer
Copy link
Contributor Author

Ok, makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants