Timeline for Enable minor mode given org-mode tag
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 15, 2022 at 4:02 | comment | added | NickD |
You add to org-mode-hook a function that checks the file for the tag and, if it finds it, enables the minor mode: (defun check-tag-enable-minor-mode () (when (check-tag "foo") (foo-minor-mode 1))) and (add-hook 'org-mode-hook #'check-tag-enable-minor-mode) . You still have to write the check-tag function and fix what minor mode you want to enable.
|
|
Mar 15, 2022 at 3:59 | comment | added | Daniel Kessler | Also, it doesn’t precisely answer your question, but you can manage file-specific minor modes using file variables: see the very bottom of this documentation, which will also mention hooks which is probably the way to go if you want to implement the logic you’ve described. | |
Mar 15, 2022 at 3:56 | comment | added | Daniel Kessler |
When you say the file has a certain tag, do you mean it contains at least one headline with a particular tag, or that the tag was specified with #FILETAGS: ?
|
|
Mar 15, 2022 at 3:29 | history | asked | Nathan | CC BY-SA 4.0 |