aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-06-18 17:58:18 +0000
committerStefan Monnier2002-06-18 17:58:18 +0000
commitf23a0f3a2fcd3d9f7125c70d4a4262304c22bd98 (patch)
tree6b6eb65089013b3a0a7a521b9ec85d3ee767fe85
parente0e7f2d5360f710014e78063b363fb79b36a5042 (diff)
downloademacs-f23a0f3a2fcd3d9f7125c70d4a4262304c22bd98.tar.gz
emacs-f23a0f3a2fcd3d9f7125c70d4a4262304c22bd98.zip
(comment-normalize-vars): Refresh the comment-foo-skip
regexp when they don't match comment-foo any more.
-rw-r--r--lisp/newcomment.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 3e20679afef..b161b0c7779 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -5,7 +5,6 @@
5;; Author: code extracted from Emacs-20's simple.el 5;; Author: code extracted from Emacs-20's simple.el
6;; Maintainer: Stefan Monnier <monnier@cs.yale.edu> 6;; Maintainer: Stefan Monnier <monnier@cs.yale.edu>
7;; Keywords: comment uncomment 7;; Keywords: comment uncomment
8;; Revision: $Id: newcomment.el,v 1.47 2002/04/29 23:43:11 monnier Exp $
9 8
10;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
11 10
@@ -240,14 +239,18 @@ This is obsolete because you might as well use \\[newline-and-indent]."
240 ;; (kill-local-variable 'comment-continue)) 239 ;; (kill-local-variable 'comment-continue))
241 ) 240 )
242 ;; comment-skip regexps 241 ;; comment-skip regexps
243 (unless comment-start-skip 242 (unless (and comment-start-skip
243 ;; In case comment-start has changed since last time.
244 (string-match comment-start-skip comment-start))
244 (set (make-local-variable 'comment-start-skip) 245 (set (make-local-variable 'comment-start-skip)
245 (concat "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(\\s<+\\|" 246 (concat "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(\\s<+\\|"
246 (regexp-quote (comment-string-strip comment-start t t)) 247 (regexp-quote (comment-string-strip comment-start t t))
247 ;; Let's not allow any \s- but only [ \t] since \n 248 ;; Let's not allow any \s- but only [ \t] since \n
248 ;; might be both a comment-end marker and \s-. 249 ;; might be both a comment-end marker and \s-.
249 "+\\)[ \t]*"))) 250 "+\\)[ \t]*")))
250 (unless comment-end-skip 251 (unless (and comment-end-skip
252 ;; In case comment-end has changed since last time.
253 (string-match comment-end-skip comment-end))
251 (let ((ce (if (string= "" comment-end) "\n" 254 (let ((ce (if (string= "" comment-end) "\n"
252 (comment-string-strip comment-end t t)))) 255 (comment-string-strip comment-end t t))))
253 (set (make-local-variable 'comment-end-skip) 256 (set (make-local-variable 'comment-end-skip)