jdtsmith / outli

Simple comment-based outline folding for Emacs
GNU General Public License v3.0
99 stars 5 forks source link

Make outli--at-heading work anywhere in outline regexp rather than only bol. #5

Closed gajama closed 1 year ago

gajama commented 1 year ago

Uses 'thing-at-point-looking-at' instead of 'looking-at'. Also adds a check to make sure point is on an outline heading.

gajama commented 1 year ago

Hi, Outli is just the thing I've been looking for to make my less-than-literate Emacs config files prettier and easier to navigate. I was getting slightly annoyed at having to go back to BOL every time I wanted to use a speed-key, and I think this PR improves the experience. What do you think?

jdtsmith commented 1 year ago

Thanks, I use it for .emacs too, really great there. One concern with your approach: how do you actually edit the headline? Org has a trick of setting org-use-speed-commands to a function, e.g.:

(lambda () (and (looking-at org-outline-regexp) (looking-back "^\**")))

which makes speed keys work in any of the * chars, not just strictly at the left. I think a more general approach like this (i.e. user defines a function to determine when speed keys are "active") would be more suitable for different users.

gajama commented 1 year ago

It doesn't affect the headline. It only increases the area where the speed keys work to be the whole of the regexp, rather than having to be strictly at BOL.

jdtsmith commented 1 year ago

I see, I think that's similar to the org config I showed and it's something I've wanted myself. I do prefer not to load up thingatpt just for this simple thing; see d054144. Please give this some testing.