GNU bug report logs - #16971
24.3.50; comment-beginning behaves differently in current newcomment.el, leads to error in comment-indent-new-line

Previous Next

Package: emacs;

Reported by: Frank Ruben <frankruben27 <at> gmail.com>

Date: Sat, 8 Mar 2014 18:49:03 UTC

Severity: important

Tags: confirmed

Found in version 24.3.50

Fixed in version 24.4

Done: Dmitry Gutov <raaahh <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <raaahh <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16971 <at> debbugs.gnu.org, Frank Ruben <frankruben27 <at> gmail.com>
Subject: bug#16971: 24.3.50; comment-beginning behaves differently in current newcomment.el, leads to error in comment-indent-new-line
Date: Sat, 15 Mar 2014 07:25:08 +0200
AFAICS, only `lisp-mode-variables' and `scheme-mode-variables' set 
`comment-start-skip' to a value that looks for a character before the 
comment (and they're also the only two uses of 
`font-lock-comment-start-skip').

The patch below is probably the cleaner fix. I'll install it in a couple 
of days if no one objects.


=== modified file 'lisp/emacs-lisp/lisp-mode.el'
--- lisp/emacs-lisp/lisp-mode.el	2014-02-10 01:34:22 +0000
+++ lisp/emacs-lisp/lisp-mode.el	2014-03-15 05:21:12 +0000
@@ -449,15 +449,10 @@
   (setq-local outline-level 'lisp-outline-level)
   (setq-local add-log-current-defun-function #'lisp-current-defun-name)
   (setq-local comment-start ";")
-  ;; Look within the line for a ; following an even number of backslashes
-  ;; after either a non-backslash or the line beginning.
-  (setq-local comment-start-skip 
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
-  ;; Font lock mode uses this only when it KNOWS a comment is starting.
-  (setq-local font-lock-comment-start-skip ";+ *")
+  (setq-local comment-start-skip ";+ *")
   (setq-local comment-add 1)		;default to `;;' in comment-region
   (setq-local comment-column 40)
-  ;; Don't get confused by `;' in doc strings when paragraph-filling.
-  (setq-local comment-use-global-state t)
+  (setq-local comment-use-syntax t)
   (setq-local imenu-generic-expression lisp-imenu-generic-expression)
   (setq-local multibyte-syntax-as-symbol t)
   ;; (setq-local syntax-begin-function 'beginning-of-defun)  ;;Bug#16247.

=== modified file 'lisp/progmodes/scheme.el'
--- lisp/progmodes/scheme.el	2014-01-01 07:43:34 +0000
+++ lisp/progmodes/scheme.el	2014-03-15 05:15:57 +0000
@@ -140,11 +140,8 @@
   (setq-local add-log-current-defun-function #'lisp-current-defun-name)
   (setq-local comment-start ";")
   (setq-local comment-add 1)
-  ;; Look within the line for a ; following an even number of backslashes
-  ;; after either a non-backslash or the line beginning.
-  (setq-local comment-start-skip
-	      "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*")
-  (setq-local font-lock-comment-start-skip ";+ *")
+  (setq-local comment-start-skip ";+[ \t]*")
+  (setq-local comment-use-syntax t)
   (setq-local comment-column 40)
   (setq-local parse-sexp-ignore-comments t)
   (setq-local lisp-indent-function 'scheme-indent-function)





This bug report was last modified 11 years and 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.