Commit 5c3105e5 authored by Stefan Monnier's avatar Stefan Monnier

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

parent 4c51ef4e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment