GNU bug report logs -
#14332
24.3; Octave indentation bug
Previous Next
Reported by: Leo Liu <sdl.web <at> gmail.com>
Date: Thu, 2 May 2013 04:06:02 UTC
Severity: normal
Found in version 24.3
Done: Leo Liu <sdl.web <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 2013-05-06 11:29 +0800, Leo Liu wrote:
> What I would like is to have \ mean "." unless it is in double-quoted
> strings where it should be "\\".
This patch seems working. This is the first time I am using the
syntax-table property. Stefan, do you see any problem with the patch?
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 2e848600..66fda302 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -134,6 +134,12 @@ (defvar octave-font-lock-keywords
"Additional Octave expressions to highlight.")
(defun octave-syntax-propertize-function (start end)
+ (funcall (syntax-propertize-rules
+ ("\\\\" (0 (when (eq (nth 3 (save-excursion
+ (syntax-ppss (match-beginning 0))))
+ ?\")
+ (string-to-syntax "\\")))))
+ start end)
(goto-char start)
(octave-syntax-propertize-sqs end)
(funcall (syntax-propertize-rules
@@ -242,7 +248,7 @@ (defvar octave-mode-syntax-table
(modify-syntax-entry ?& "." table)
(modify-syntax-entry ?| "." table)
(modify-syntax-entry ?! "." table)
- (modify-syntax-entry ?\\ "\\" table)
+ (modify-syntax-entry ?\\ "." table)
(modify-syntax-entry ?\' "." table)
;; Was "w" for abbrevs, but now that it's not necessary any more,
(modify-syntax-entry ?\` "." table)
This bug report was last modified 12 years and 14 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.