* doc/lispref/modes.texi (Derived Modes): Make example more idiomatic

This commit is contained in:
Stefan Monnier 2017-02-13 02:29:01 -05:00
parent 4c51ef4e80
commit 5c3105e55b

View file

@ -806,14 +806,15 @@ this mode. (Not all major modes have one.) The command
Here is a hypothetical example: Here is a hypothetical example:
@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 (define-derived-mode hypertext-mode
text-mode "Hypertext" text-mode "Hypertext"
"Major mode for hypertext. "Major mode for hypertext."
\\@{hypertext-mode-map@}" (setq-local case-fold-search nil))
(setq case-fold-search nil))
(define-key hypertext-mode-map
[down-mouse-3] 'do-hyper-link)
@end example @end example
Do not write an @code{interactive} spec in the definition; Do not write an @code{interactive} spec in the definition;