comparison lisp/textmodes/nroff-mode.el @ 81650:b6aa03e14a51

Groff \# comments. (nroff-mode-syntax-table): \# comment intro, plain # as punct per global table. (nroff-font-lock-keywords): Add # as a single char escape. (nroff-mode): In comment-start-skip, match \#.
author Thien-Thi Nguyen <ttn@gnuvola.org>
date Thu, 28 Jun 2007 07:13:23 +0000
parents e3694f1cb928
children b98604865ea0 988f1edc9674
comparison
equal deleted inserted replaced
81649:e40762570726 81650:b6aa03e14a51
64 ;; " isn't given string quote syntax in text-mode but it 64 ;; " isn't given string quote syntax in text-mode but it
65 ;; (arguably) should be for use round nroff arguments (with ` and 65 ;; (arguably) should be for use round nroff arguments (with ` and
66 ;; ' used otherwise). 66 ;; ' used otherwise).
67 (modify-syntax-entry ?\" "\" 2" st) 67 (modify-syntax-entry ?\" "\" 2" st)
68 ;; Comments are delimited by \" and newline. 68 ;; Comments are delimited by \" and newline.
69 ;; And in groff also \# to newline.
70 (modify-syntax-entry ?# ". 2" st)
69 (modify-syntax-entry ?\\ "\\ 1" st) 71 (modify-syntax-entry ?\\ "\\ 1" st)
70 (modify-syntax-entry ?\n ">" st) 72 (modify-syntax-entry ?\n ">" st)
71 st) 73 st)
72 "Syntax table used while in `nroff-mode'.") 74 "Syntax table used while in `nroff-mode'.")
73 75
90 (concat "\\\\" ; backslash 92 (concat "\\\\" ; backslash
91 "\\(" ; followed by various possibilities 93 "\\(" ; followed by various possibilities
92 (mapconcat 'identity 94 (mapconcat 'identity
93 '("[f*n]*\\[.+?]" ; some groff extensions 95 '("[f*n]*\\[.+?]" ; some groff extensions
94 "(.." ; two chars after ( 96 "(.." ; two chars after (
95 "[^(\"]" ; single char escape 97 "[^(\"#]" ; single char escape
96 ) "\\|") 98 ) "\\|")
97 "\\)") 99 "\\)")
98 ) 100 )
99 "Font-lock highlighting control in `nroff-mode'." 101 "Font-lock highlighting control in `nroff-mode'."
100 :group 'nroff 102 :group 'nroff
125 (concat "[.']\\|" paragraph-start)) 127 (concat "[.']\\|" paragraph-start))
126 (set (make-local-variable 'paragraph-separate) 128 (set (make-local-variable 'paragraph-separate)
127 (concat "[.']\\|" paragraph-separate)) 129 (concat "[.']\\|" paragraph-separate))
128 ;; comment syntax added by mit-erl!gildea 18 Apr 86 130 ;; comment syntax added by mit-erl!gildea 18 Apr 86
129 (set (make-local-variable 'comment-start) "\\\" ") 131 (set (make-local-variable 'comment-start) "\\\" ")
130 (set (make-local-variable 'comment-start-skip) "\\\\\"[ \t]*") 132 (set (make-local-variable 'comment-start-skip) "\\\\[\"#][ \t]*")
131 (set (make-local-variable 'comment-column) 24) 133 (set (make-local-variable 'comment-column) 24)
132 (set (make-local-variable 'comment-indent-function) 'nroff-comment-indent) 134 (set (make-local-variable 'comment-indent-function) 'nroff-comment-indent)
133 (set (make-local-variable 'imenu-generic-expression) nroff-imenu-expression)) 135 (set (make-local-variable 'imenu-generic-expression) nroff-imenu-expression))
134 136
135 (defun nroff-outline-level () 137 (defun nroff-outline-level ()