[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/rec-mode eaf5e93 60/98: rec-mode: support for a mode ho

From: Stefan Monnier
Subject: [elpa] externals/rec-mode eaf5e93 60/98: rec-mode: support for a mode hook.
Date: Thu, 12 Nov 2020 13:18:40 -0500 (EST)

branch: externals/rec-mode
commit eaf5e93964f00b0d6fb4cfbaa557f8bd64729301
Author: Jose E. Marchesi <jemarch@gnu.org>
Commit: Antoine Kalmbach <ane@iki.fi>

    rec-mode: support for a mode hook.
 etc/rec-mode.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/etc/rec-mode.el b/etc/rec-mode.el
index 2d293cb..08003bc 100644
--- a/etc/rec-mode.el
+++ b/etc/rec-mode.el
@@ -53,6 +53,11 @@ values.  The default is `t'."
   :type 'boolean
   :group 'rec-mode)
+(defcustom rec-mode-hook nil
+  "Hook run when entering rec mode."
+  :type 'hook
+  :group 'rec-mode)
 (defvar rec-max-lines-in-fields 15
   "Values of fields having more than the specified lines will be
 hidden by default in navigation mode.")
@@ -2092,7 +2097,10 @@ function returns `nil'."
   "A major mode for editing rec files.
+Turning on rec-mode calls the members of the variable
+`rec-mode-hook' with no args, if that value is is non-nil."
@@ -2116,6 +2124,7 @@ Commands:
   (set-syntax-table rec-mode-syntax-table)
   (setq mode-name "Rec")
   (setq major-mode 'rec-mode)
+  (run-hooks 'rec-mode-hooks)
   ;; Goto the first record of the first type (including the Unknown).
   ;; If there is a problem (i.e.  syntax error) then go to fundamental
   ;; mode and show the output of recfix in a separated buffer.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]