sensorflo / adoc-mode

A major-mode for editing AsciiDoc files in Emacs
https://github.com/sensorflo/adoc-mode/wiki
76 stars 41 forks source link

Simplistic (flat) imenu support #19

Closed duelafn closed 8 years ago

duelafn commented 8 years ago

Stupid-simple, but better than nothing!

sensorflo commented 8 years ago

Thank you for your contribution. I am about to cherry pick your commit. Why do you don't allow the characters # (number sign), = (equal sign), \ (backslash) and - (hyphen-minus) as part of the title's text?

duelafn commented 8 years ago

That's only the first character of the title and was meant to bypass oddities. I must admit to having copied this from another mode I'd created and didn't really think about whether those exceptions made sense or were necessary. A quick check of the asciidoc converter shows that it doesn't get tripped up by special chars at the start of the title, so no, there is no real reason to exclude them. Sorry about that.

I've updated the branch to not place restrictions on the first character and also tested the minimul length of underline titles (is actually 2 not 3).

sensorflo commented 8 years ago

It'll take me between a couple of hours and few days to add imenu support, depending on how much I can work on adoc-mode beside my other life. I want to use the regular expressions for titles I already have and which are pretty exact, see adoc-re-one-line-title and adoc-re-two-line-title. That means I have to write my own imenu-create-index-function. I am currently working on it.

sensorflo commented 8 years ago

I just pushed a 745884359, without bumping adoc-mode-version yet. adoc-mode learned imenu support. Both one line and two line titles are supported. Thanks for your work.