bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14332: 24.3; Octave indentation bug


From: Leo Liu
Subject: bug#14332: 24.3; Octave indentation bug
Date: Mon, 06 May 2013 16:26:13 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.8.3)

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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]