# HG changeset patch # User Stefan Monnier # Date 1281617184 -7200 # Node ID 1aa7bc345918634c6694de089d458431099d7b13 # Parent 47ffebe76e4227d06791bea9627f918ee32c301a 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. diff -r 47ffebe76e42 -r 1aa7bc345918 lisp/ChangeLog --- 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. diff -r 47ffebe76e42 -r 1aa7bc345918 lisp/progmodes/octave-mod.el --- 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 ()