aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/nroff-mode.el25
1 files changed, 22 insertions, 3 deletions
diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el
index 5e9c669a8da..a2667d7ac61 100644
--- a/lisp/textmodes/nroff-mode.el
+++ b/lisp/textmodes/nroff-mode.el
@@ -49,13 +49,32 @@
49 :type 'boolean) 49 :type 'boolean)
50 50
51(defvar nroff-mode-map 51(defvar nroff-mode-map
52 (let ((map (make-sparse-keymap))) 52 (let ((map (make-sparse-keymap))
53 (menu-map (make-sparse-keymap)))
53 (define-key map "\t" 'tab-to-tab-stop) 54 (define-key map "\t" 'tab-to-tab-stop)
54 (define-key map "\es" 'center-line) 55 (define-key map "\es" 'center-line)
55 (define-key map "\e?" 'nroff-count-text-lines) 56 (define-key map "\e?" 'nroff-count-text-lines)
56 (define-key map "\n" 'nroff-electric-newline) 57 (define-key map "\n" 'nroff-electric-newline)
57 (define-key map "\en" 'nroff-forward-text-line) 58 (define-key map "\en" 'nroff-forward-text-line)
58 (define-key map "\ep" 'nroff-backward-text-line) 59 (define-key map "\ep" 'nroff-backward-text-line)
60 (define-key map [menu-bar nroff-mode] (cons "Nroff" menu-map))
61 (define-key menu-map [nn]
62 '(menu-item "Newline" nroff-electric-newline
63 :help "Insert newline for nroff mode; special if nroff-electric mode"))
64 (define-key menu-map [nc]
65 '(menu-item "Count text lines" nroff-count-text-lines
66 :help "Count lines in region, except for nroff request lines."))
67 (define-key menu-map [nf]
68 '(menu-item "Forward text line" nroff-forward-text-line
69 :help "Go forward one nroff text line, skipping lines of nroff requests"))
70 (define-key menu-map [nb]
71 '(menu-item "Backward text line" nroff-backward-text-line
72 :help "Go backward one nroff text line, skipping lines of nroff requests"))
73 (define-key menu-map [ne]
74 '(menu-item "Electric newline mode"
75 nroff-electric-mode
76 :help "Auto insert closing requests if necessary"
77 :button (:toggle . nroff-electric-mode)))
59 map) 78 map)
60 "Major mode keymap for `nroff-mode'.") 79 "Major mode keymap for `nroff-mode'.")
61 80
@@ -247,8 +266,8 @@ An argument is a repeat count; negative means move forward."
247 (".de" . ".."))) 266 (".de" . "..")))
248 267
249(defun nroff-electric-newline (arg) 268(defun nroff-electric-newline (arg)
250 "Insert newline for nroff mode; special if electric-nroff mode. 269 "Insert newline for nroff mode; special if nroff-electric mode.
251In `electric-nroff-mode', if ending a line containing an nroff opening request, 270In `nroff-electric-mode', if ending a line containing an nroff opening request,
252automatically inserts the matching closing request after point." 271automatically inserts the matching closing request after point."
253 (interactive "P") 272 (interactive "P")
254 (let ((completion (save-excursion 273 (let ((completion (save-excursion