aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2013-05-14 13:19:29 +0800
committerLeo Liu2013-05-14 13:19:29 +0800
commit4d25fd7e52b254e3ca57bbacf73217caa450c75d (patch)
tree3fa815771a5eef7d61d3a2240e3b5cd0a334fa46
parent61aaeb01ce01f380c8e7033a6a0fc4849eaed3f8 (diff)
downloademacs-4d25fd7e52b254e3ca57bbacf73217caa450c75d.tar.gz
emacs-4d25fd7e52b254e3ca57bbacf73217caa450c75d.zip
* progmodes/octave.el (octave-font-lock-keywords): Fix error
during redisplay. (octave-goto-function-definition, octave-find-definition): Minor tweaks.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/octave.el20
2 files changed, 17 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 75002528d21..803e2772109 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12013-05-14 Leo Liu <sdl.web@gmail.com>
2
3 * progmodes/octave.el (octave-font-lock-keywords): Fix error
4 during redisplay.
5 (octave-goto-function-definition, octave-find-definition): Minor tweaks.
6
12013-05-14 Glenn Morris <rgm@gnu.org> 72013-05-14 Glenn Morris <rgm@gnu.org>
2 8
3 * progmodes/flymake.el (flymake-xml-program): New option. 9 * progmodes/flymake.el (flymake-xml-program): New option.
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 7189b606a0c..e4e0dbc4ee1 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -459,13 +459,14 @@ Non-nil means always go to the next Octave code line after sending."
459 (let ((beg (match-beginning 0)) 459 (let ((beg (match-beginning 0))
460 (end (match-end 0))) 460 (end (match-end 0)))
461 (unless (octave-in-string-or-comment-p) 461 (unless (octave-in-string-or-comment-p)
462 (unwind-protect 462 (condition-case nil
463 (progn 463 (progn
464 (goto-char beg) 464 (goto-char beg)
465 (backward-up-list) 465 (backward-up-list)
466 (when (memq (char-after) '(?\( ?\[ ?\{)) 466 (when (memq (char-after) '(?\( ?\[ ?\{))
467 (put-text-property beg end 'face nil))) 467 (put-text-property beg end 'face nil))
468 (goto-char end))))) 468 (goto-char end))
469 (error (goto-char end))))))
469 nil)) 470 nil))
470 ;; Fontify all operators. 471 ;; Fontify all operators.
471 (cons octave-operator-regexp 'font-lock-builtin-face) 472 (cons octave-operator-regexp 'font-lock-builtin-face)
@@ -929,9 +930,9 @@ directory and makes this the current buffer's default directory."
929 930
930(defun octave-goto-function-definition () 931(defun octave-goto-function-definition ()
931 "Go to the first function definition." 932 "Go to the first function definition."
932 (when (save-excursion 933 (goto-char (point-min))
933 (goto-char (point-min)) 934 (if (not (re-search-forward octave-function-header-regexp nil t))
934 (re-search-forward octave-function-header-regexp nil t)) 935 (forward-comment (point-max))
935 (goto-char (match-beginning 3)) 936 (goto-char (match-beginning 3))
936 (match-string 3))) 937 (match-string 3)))
937 938
@@ -1681,9 +1682,10 @@ if iskeyword(\"%s\") disp(\"`%s' is a keyword\") else which(\"%s\") endif\n"
1681 (user-error "%s" (or line (format "`%s' not found" fn))) 1682 (user-error "%s" (or line (format "`%s' not found" fn)))
1682 (require 'etags) 1683 (require 'etags)
1683 (ring-insert find-tag-marker-ring (point-marker)) 1684 (ring-insert find-tag-marker-ring (point-marker))
1684 (find-file (funcall octave-find-definition-filename-function file)) 1685 (setq file (funcall octave-find-definition-filename-function file))
1685 (or (octave-goto-function-definition) 1686 (when file
1686 (forward-comment (point-max)))))) 1687 (find-file file)
1688 (octave-goto-function-definition)))))
1687 1689
1688 1690
1689(provide 'octave) 1691(provide 'octave)