f90.el fix for bug#7919.
authorGlenn Morris <rgm@gnu.org>
Fri, 4 Feb 2011 03:21:11 +0000 (19:21 -0800)
committerGlenn Morris <rgm@gnu.org>
Fri, 4 Feb 2011 03:21:11 +0000 (19:21 -0800)
* lisp/progmodes/f90.el (f90-find-tag-default): New function.
(f90-mode): Use it for mode's `find-tag-default-function' property.

lisp/ChangeLog
lisp/progmodes/f90.el

index b0e901c..58d30fc 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-04  Glenn Morris  <rgm@gnu.org>
+
+       * progmodes/f90.el (f90-find-tag-default): New function.  (Bug#7919)
+       (f90-mode): Use it for mode's `find-tag-default-function' property.
+
 2011-02-03  Glenn Morris  <rgm@gnu.org>
 
        * ibuf-ext.el (ibuffer-filter-disable): Make it work.  (Bug#7969)
index a4a986b..afdd2f2 100644 (file)
@@ -2205,6 +2205,16 @@ CHANGE-WORD should be one of 'upcase-word, 'downcase-word, 'capitalize-word."
   (save-excursion
     (nth 1 (f90-beginning-of-subprogram))))
 
+(defun f90-find-tag-default ()
+  "Function to use for `find-tag-default-function' property in F90 mode."
+  (let ((tag (find-tag-default)))
+    (or (and tag
+             ;; See bug#7919. TODO I imagine there are other cases...?
+             (string-match "%\\(.+\\)" tag)
+             (match-string-no-properties 1 tag))
+        tag)))
+
+(put 'f90-mode 'find-tag-default-function 'f90-find-tag-default)
 
 (defun f90-backslash-not-special (&optional all)
   "Make the backslash character (\\) be non-special in the current buffer.