changeset 5892:c9b930106073

(etags-goto-tag-location): First go directly to STARTPOS and see if PAT is right there.
author Roland McGrath <roland@gnu.org>
date Fri, 11 Feb 1994 05:54:37 +0000
parents ffe51baf2728
children 57c1061d77ff
files lisp/progmodes/etags.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/etags.el	Fri Feb 11 02:52:17 1994 +0000
+++ b/lisp/progmodes/etags.el	Fri Feb 11 05:54:37 1994 +0000
@@ -959,6 +959,11 @@
     (forward-line 1)
     (cons tag-text startpos)))
 
+;; TAG-INFO is a cons (TEXT . POSITION) where TEXT is the initial part of a
+;; line containing the tag and POSITION is the character position of TEXT
+;; within the file (starting from 1).  If the tag isn't exactly at the
+;; given position then look around that position using a search window
+;; which expands until it hits the start of file.
 (defun etags-goto-tag-location (tag-info)
   (let ((startpos (cdr tag-info))
 	;; This constant is 1/2 the initial search window.
@@ -972,6 +977,9 @@
 		     (regexp-quote (car tag-info)))))
     (or startpos
 	(setq startpos (point-min)))
+    ;; First see if the tag is right at the specified location.
+    (goto-char startpos)
+    (setq found (looking-at pat))
     (while (and (not found)
 		(progn
 		  (goto-char (- startpos offset))