1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Introduce an :interactive keyword for `defined-derived-mode'

* doc/lispref/modes.texi (Derived Modes): Document it.
* lisp/emacs-lisp/derived.el (define-derived-mode): Introduce a
new :interactive keyword.
This commit is contained in:
Lars Ingebrigtsen 2021-02-14 12:50:19 +01:00
parent 7f62faf206
commit 43ecde8578
3 changed files with 19 additions and 1 deletions

View file

@ -141,6 +141,9 @@ KEYWORD-ARGS:
:after-hook FORM
A single lisp form which is evaluated after the mode
hooks have been run. It should not be quoted.
:interactive BOOLEAN
Whether the derived mode should be `interactive' or not.
The default is t.
BODY: forms to execute just before running the
hooks for the new mode. Do not use `interactive' here.
@ -194,6 +197,7 @@ See Info node `(elisp)Derived Modes' for more details.
(declare-syntax t)
(hook (derived-mode-hook-name child))
(group nil)
(interactive t)
(after-hook nil))
;; Process the keyword args.
@ -203,6 +207,7 @@ See Info node `(elisp)Derived Modes' for more details.
(:abbrev-table (setq abbrev (pop body)) (setq declare-abbrev nil))
(:syntax-table (setq syntax (pop body)) (setq declare-syntax nil))
(:after-hook (setq after-hook (pop body)))
(:interactive (setq interactive (pop body)))
(_ (pop body))))
(setq docstring (derived-mode-make-docstring
@ -246,7 +251,7 @@ No problems result if this variable is not bound.
(defun ,child ()
,docstring
(interactive)
,(and interactive '(interactive))
; Run the parent.
(delay-mode-hooks