emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112576: * progmodes/octave.el (octav


From: Leo Liu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112576: * progmodes/octave.el (octave-font-lock-keywords): Fix error
Date: Tue, 14 May 2013 13:19:29 +0800
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112576
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Tue 2013-05-14 13:19:29 +0800
message:
  * progmodes/octave.el (octave-font-lock-keywords): Fix error
  during redisplay.
  (octave-goto-function-definition, octave-find-definition): Minor tweaks.
modified:
  lisp/ChangeLog
  lisp/progmodes/octave.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-05-14 02:42:17 +0000
+++ b/lisp/ChangeLog    2013-05-14 05:19:29 +0000
@@ -1,3 +1,9 @@
+2013-05-14  Leo Liu  <address@hidden>
+
+       * progmodes/octave.el (octave-font-lock-keywords): Fix error
+       during redisplay.
+       (octave-goto-function-definition, octave-find-definition): Minor tweaks.
+
 2013-05-14  Glenn Morris  <address@hidden>
 
        * progmodes/flymake.el (flymake-xml-program): New option.

=== modified file 'lisp/progmodes/octave.el'
--- a/lisp/progmodes/octave.el  2013-05-13 07:24:22 +0000
+++ b/lisp/progmodes/octave.el  2013-05-14 05:19:29 +0000
@@ -459,13 +459,14 @@
              (let ((beg (match-beginning 0))
                    (end (match-end 0)))
                (unless (octave-in-string-or-comment-p)
-                 (unwind-protect
+                 (condition-case nil
                      (progn
                        (goto-char beg)
                        (backward-up-list)
                        (when (memq (char-after) '(?\( ?\[ ?\{))
-                         (put-text-property beg end 'face nil)))
-                   (goto-char end)))))
+                         (put-text-property beg end 'face nil))
+                       (goto-char end))
+                   (error (goto-char end))))))
            nil))
    ;; Fontify all operators.
    (cons octave-operator-regexp 'font-lock-builtin-face)
@@ -929,9 +930,9 @@
 
 (defun octave-goto-function-definition ()
   "Go to the first function definition."
-  (when (save-excursion
-          (goto-char (point-min))
-          (re-search-forward octave-function-header-regexp nil t))
+  (goto-char (point-min))
+  (if (not (re-search-forward octave-function-header-regexp nil t))
+      (forward-comment (point-max))
     (goto-char (match-beginning 3))
     (match-string 3)))
 
@@ -1681,9 +1682,10 @@
         (user-error "%s" (or line (format "`%s' not found" fn)))
       (require 'etags)
       (ring-insert find-tag-marker-ring (point-marker))
-      (find-file (funcall octave-find-definition-filename-function file))
-      (or (octave-goto-function-definition)
-          (forward-comment (point-max))))))
+      (setq file (funcall octave-find-definition-filename-function file))
+      (when file
+        (find-file file)
+        (octave-goto-function-definition)))))
 
 
 (provide 'octave)


reply via email to

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