changeset 109755:1aa7bc345918

Fix last change. * lisp/progmodes/octave-mod.el (octave-mode-syntax-table): Better describe the problem. (octave-fill-paragraph): Also update caller. (octave-completion-at-point-function): Fix up typo.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 12 Aug 2010 14:46:24 +0200
parents 47ffebe76e42
children 23910b0d49d9
files lisp/ChangeLog lisp/progmodes/octave-mod.el
diffstat 2 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Aug 12 13:22:16 2010 +0200
+++ b/lisp/ChangeLog	Thu Aug 12 14:46:24 2010 +0200
@@ -11,7 +11,7 @@
 	(octave-uncomment-region, octave-comment-indent)
 	(octave-indent-for-comment): Remove.
 	(octave-indent-calculate): Rename from calculate-octave-indent.
-	(octave-indent-line): Update caller.
+	(octave-indent-line, octave-fill-paragraph): Update caller.
 	(octave-initialize-completions): No need to make an alist.
 	(octave-completion-at-point-function): New function.
 	(octave-complete-symbol): Use it.
--- a/lisp/progmodes/octave-mod.el	Thu Aug 12 13:22:16 2010 +0200
+++ b/lisp/progmodes/octave-mod.el	Thu Aug 12 14:46:24 2010 +0200
@@ -294,17 +294,17 @@
     (modify-syntax-entry ?\" "\"" table)
     (modify-syntax-entry ?. "w"   table)
     (modify-syntax-entry ?_ "w"   table)
-    ;; FIXME: The < property of # and % makes Emacs-23 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.
-    ;; Hopefully we'll get to fix this in Emacs-24.
+    ;; FIXME: The "b" flag only applies to the second letter of the comstart
+    ;; and the first letter of the comend, i.e. the "4b" below is ineffective.
+    ;; If we try to put `b' on the single-line comments, we get a similar
+    ;; problem where the % and # chars appear as first chars of the 2-char
+    ;; comend, so the multi-line ender is also turned into style-b.
+    ;; Really, we can't make it work without extending the syntax-tables, or
+    ;; via font-lock-syntactic-keywords.
     (modify-syntax-entry ?\% "< 13"  table)
     (modify-syntax-entry ?\# "< 13"  table)
     (modify-syntax-entry ?\{ "(} 2b"  table)
-    (modify-syntax-entry ?\} "){ 4"  table)
+    (modify-syntax-entry ?\} "){ 4b"  table)
     (modify-syntax-entry ?\n ">"  table)
     table)
   "Syntax table in use in `octave-mode' buffers.")
@@ -1118,7 +1118,7 @@
 		(beginning-of-line)
 		(point)))
 	 (cfc (current-fill-column))
-	 (ind (calculate-octave-indent))
+	 (ind (octave-indent-calculate))
 	 comment-prefix)
      (save-restriction
        (goto-char beg)
@@ -1195,10 +1195,10 @@
 
 (defun octave-completion-at-point-function ()
   "Find the text to complete and the corresponding table."
-  (let ((beg (save-excursion (backward-sexp 1) (point)))
-        (end (if (< beg (point))
-                 (save-excursion (goto-char beg) (forward-sexp 1) (point))
-               (point))))
+  (let* ((beg (save-excursion (backward-sexp 1) (point)))
+         (end (if (< beg (point))
+                  (save-excursion (goto-char beg) (forward-sexp 1) (point))
+                (point))))
     (list beg end octave-completion-alist)))
 
 (defun octave-complete-symbol ()