From: Stefan Monnier Date: Mon, 13 Feb 2017 07:29:01 +0000 (-0500) Subject: * doc/lispref/modes.texi (Derived Modes): Make example more idiomatic X-Git-Tag: emacs-25.2-rc2~6 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5c3105e55bd28f2d4786b798a11566f6876c237a;p=emacs.git * doc/lispref/modes.texi (Derived Modes): Make example more idiomatic --- diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 0015a9f318d..132dda3fc60 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. -\\@{hypertext-mode-map@}" - (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;