emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 5c3105e: * doc/lispref/modes.texi (Derived Modes)


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-25 5c3105e: * doc/lispref/modes.texi (Derived Modes): Make example more idiomatic
Date: Mon, 13 Feb 2017 02:29:10 -0500 (EST)

branch: emacs-25
commit 5c3105e55bd28f2d4786b798a11566f6876c237a
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * doc/lispref/modes.texi (Derived Modes): Make example more idiomatic
---
 doc/lispref/modes.texi | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 0015a9f..132dda3 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -806,14 +806,15 @@ this mode.  (Not all major modes have one.)  The command
 Here is a hypothetical example:
 
 @example
+(defvar hypertext-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [down-mouse-3] 'do-hyper-link)
+    map))
+
 (define-derived-mode hypertext-mode
   text-mode "Hypertext"
-  "Major mode for hypertext.
address@hidden@}"
-  (setq case-fold-search nil))
-
-(define-key hypertext-mode-map
-  [down-mouse-3] 'do-hyper-link)
+  "Major mode for hypertext."
+  (setq-local case-fold-search nil))
 @end example
 
 Do not write an @code{interactive} spec in the definition;



reply via email to

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