this post was submitted on 23 Oct 2023
1 points (100.0% liked)

Emacs

311 readers
1 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

I'm finding that defining outline-regexp does not do for me in python-mode what it does for me in other language modes. Someone else on Stack Exchange ran into the same problem, and a suggested answer to their question makes it clear that python-mode preconfigures some definitions for outline-minor-mode. But what those preconfigurations are, and more importantly how to use them, is not documented anywhere I can find.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago

Beyond an overview in the manual. I'm not aware of any documentation outside of the source in outline.el which defines outline-regexp to match the beginning of a heading, outline-heading-end-regexp to match the end of a heading, outline-search-function to advance to the next heading, and outline-level to figure out the level of the heading which can be used with outline-heading-alist.

python.el provides values for outline-regexp, outline-heading-end-regexp, and outline-level which mostly work for me except for decorators and parametrized test cases.

The Stack Exchange discussion gives an example of customizing the values using a hook into python-mode.