From f23a0f3a2fcd3d9f7125c70d4a4262304c22bd98 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 18 Jun 2002 17:58:18 +0000 Subject: [PATCH] (comment-normalize-vars): Refresh the comment-foo-skip regexp when they don't match comment-foo any more. --- lisp/newcomment.el | 9 ++++++--- 1 file 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 @@ ;; Author: code extracted from Emacs-20's simple.el ;; Maintainer: Stefan Monnier ;; Keywords: comment uncomment -;; Revision: $Id: newcomment.el,v 1.47 2002/04/29 23:43:11 monnier Exp $ ;; This file is part of GNU Emacs. @@ -240,14 +239,18 @@ This is obsolete because you might as well use \\[newline-and-indent]." ;; (kill-local-variable 'comment-continue)) ) ;; comment-skip regexps - (unless comment-start-skip + (unless (and comment-start-skip + ;; In case comment-start has changed since last time. + (string-match comment-start-skip comment-start)) (set (make-local-variable 'comment-start-skip) (concat "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(\\s<+\\|" (regexp-quote (comment-string-strip comment-start t t)) ;; Let's not allow any \s- but only [ \t] since \n ;; might be both a comment-end marker and \s-. "+\\)[ \t]*"))) - (unless comment-end-skip + (unless (and comment-end-skip + ;; In case comment-end has changed since last time. + (string-match comment-end-skip comment-end)) (let ((ce (if (string= "" comment-end) "\n" (comment-string-strip comment-end t t)))) (set (make-local-variable 'comment-end-skip) -- 2.39.2