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

Please use the default value for outline-regexp #437

Closed
tarsius opened this issue Feb 14, 2021 · 5 comments
Closed

Please use the default value for outline-regexp #437

tarsius opened this issue Feb 14, 2021 · 5 comments

Comments

@tarsius
Copy link
Contributor

tarsius commented Feb 14, 2021

You change the value of outline-regexp.

;; Local Variables:
;; outline-regexp: ";;;;* "
;; End:

Please consider using the default value for elisp files instead: ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(". It is a feature that top-level code blocks are treated as outline headings. If you don't want to use that or even consider it a misfeature, then that's fine, but please do not force your preference on others.

You might also want to take my bicycle package for a ride. Using that to cycle through the supported visibility states in libraries that use the default regexp and then also in your libraries, should give you a good idea of why it is nice to treat code blocks as sections as well.

Please revert this setting also in prescient, ctrlf and any other packages were you are currently using the inferior regexp.

Also consider my outline-minor-faces package for better visual effects. I am also mentioning this because in consult @minad uses some weird compromise, which I hope he will revert as well: ";;;;* \\|(def\\(un\\|custom\\|var\\) consult-[a-z]".

@minad Please don't hide "non-consult" top-level forms. Additionally this causes outline-minor-faces to highlight the first line of code-blocks like "real headings". ((defun consult--default-completion-candidate () ... and (provide 'consult) for example should not be hidden.)

The handling around outline-regexp is weird and comes with uncommitted caveats, especially in emacs-lisp-mode. If you change this without first reading outline.el, then you are almost certain to break something. It's quite unfortunate but also what we have to live with.

@tarsius
Copy link
Contributor Author

tarsius commented Feb 14, 2021

As a side-note:

...

;;;; Closing remarks

(provide 'prescient)

;;; prescient.el ends here

;; Local Variables:
;; outline-regexp: ";;;;* "
;; End:

No, ;;; prescient.el ends here is not true -- four more lines follow. I think it is silly that we are expected to add that eof marker, but if we do, then we should make sure it is actually true. 😀

clemera added a commit that referenced this issue Feb 14, 2021
@raxod502 You probably want to adjust your personal setup to change it
locally for elisp mode buffers, see #437.
@clemera
Copy link
Collaborator

clemera commented Feb 14, 2021

Thanks, I agree that it is better to do this in local dev setup, fixed it in 42dfb7e.

@clemera
Copy link
Collaborator

clemera commented Feb 14, 2021

@raxod502 I add (setq-local outline-regexp ";;;\\(;* [^ \t\n]\\)") to emacs-lisp-mode-hook, which will give you the old behavior you probably want to keep as well.

@clemera clemera closed this as completed Feb 14, 2021
@tarsius
Copy link
Contributor Author

tarsius commented Feb 14, 2021

Thanks!

@minad
Copy link
Contributor

minad commented Feb 14, 2021

Hmm, I somehow like my reduced outline. It is an outline after all - only showing the public API to give an overview :)

raxod502 added a commit to radian-software/el-patch that referenced this issue Feb 26, 2021
raxod502 added a commit to radian-software/straight.el that referenced this issue Feb 26, 2021
raxod502 added a commit to radian-software/prescient.el that referenced this issue Feb 26, 2021
raxod502 added a commit to radian-software/diary-manager that referenced this issue Feb 26, 2021
raxod502 added a commit to radian-software/utunes that referenced this issue Feb 26, 2021
raxod502 added a commit to radian-software/apheleia that referenced this issue Feb 26, 2021
raxod502 added a commit to radian-software/ctrlf that referenced this issue Feb 26, 2021
raxod502 added a commit to radian-software/straight.el that referenced this issue Feb 26, 2021
raxod502 referenced this issue in radian-software/dumbparens Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants