From: Christopher Dimech <dimech@gmx.com>
To: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: add-hook and remove-hook for outlines
Date: Tue, 11 May 2021 16:18:59 +0200 [thread overview]
Message-ID: <trinity-45dc916f-6625-4263-b72d-dc4639a1299b-1620742739927@3c-app-mailcom-bs13> (raw)
I would like to have a toggle function that can change the deadline type.
This would necessarily mean that I would need to remove the hook before
setting the new one (e.g. from org-like to roman-like headings).
But I am struggling on the implementation.
;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(defvar rgc-elisp " ")
(defun gilgamesh-make-outline-regexp ()
"todo"
(set (make-local-variable 'outline-regexp) rgc-elisp) )
;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(defvar rgc-elisp-kondor 2)
(defun gilgamesh-headline-elisp ()
"todo"
(interactive)
(message "gilgamesh-headline-elisp")
(pcase rgc-elisp-kondor ; sets regularity condition rgc
(1
;; org-like headings
(setq rgc-elisp ";;; \\*+ ")
(setq rgc-elisp-kondor 2)
(message "org-like headings"))
(_
;; roman-like headings
(setq rgc-elisp ";;; \\([A-Za-z]\\|[IVXLCDMivxlcdm0-9]+\\) | ")
(setq rgc-elisp-kondor 1)
(message "roman-like headings")) )
(add-hook 'emacs-lisp-mode-hook #'gilgamesh-make-outline-regexp))
reply other threads:[~2021-05-11 14:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-45dc916f-6625-4263-b72d-dc4639a1299b-1620742739927@3c-app-mailcom-bs13 \
--to=dimech@gmx.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.