GNU bug report logs - #6834
octave-mode block comments need highlighting

Previous Next

Package: emacs;

Reported by: "Sprague, Webb (OFM)" <Webb.Sprague <at> ofm.wa.gov>

Date: Mon, 9 Aug 2010 20:02:03 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 6834 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Sprague\, Webb \(OFM\)" <Webb.Sprague <at> ofm.wa.gov>
Cc: 6834 <at> debbugs.gnu.org
Subject: Re: bug#6834: octave-mode block comments need highlighting
Date: Thu, 12 Aug 2010 11:48:32 +0200
> In octave mode, block comments (separated by "%{" and "%}") should be
> highlighted in the same font as regular line comments.

The patch below should morally fix it, but as the comment explains, it
won't work until we fix the underlying C code.


        Stefan


=== modified file 'lisp/progmodes/octave-mod.el'
--- lisp/progmodes/octave-mod.el	2010-05-20 15:12:20 +0000
+++ lisp/progmodes/octave-mod.el	2010-08-12 09:46:20 +0000
@@ -298,8 +295,16 @@
     (modify-syntax-entry ?\" "\"" table)
     (modify-syntax-entry ?. "w"   table)
     (modify-syntax-entry ?_ "w"   table)
-    (modify-syntax-entry ?\% "<"  table)
-    (modify-syntax-entry ?\# "<"  table)
+    ;; FIXME: The < property of # and % makes Emacs ignore any subsequent char
+    ;; including {, so it never gets to see the multi-line comments.
+    ;; This is a shortcoming in syntax.c.  In Twelf-mode (which also
+    ;; suffers from this problem) we work around the issue by setting
+    ;; "% " rather than just "%" as a comment-starter, but it seems
+    ;; this wouldn't cut it for Octave.
+    (modify-syntax-entry ?\% "< 13"  table)
+    (modify-syntax-entry ?\# "< 13"  table)
+    (modify-syntax-entry ?\{ "(} 2b"  table)
+    (modify-syntax-entry ?\} "){ 4"  table)
     (modify-syntax-entry ?\n ">"  table)
     table)
   "Syntax table in use in `octave-mode' buffers.")





This bug report was last modified 14 years and 290 days ago.

Previous Next


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