aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1992-07-22 21:17:34 +0000
committerRoland McGrath1992-07-22 21:17:34 +0000
commit21800cb80bdd7f1e5e2d3d96828c11ae96ddaed0 (patch)
treedf3cdd2b730824db455213b2d66b95f8910207b1
parente51e47f72998dacc5b8ebc2073a8dec7e6160af5 (diff)
downloademacs-21800cb80bdd7f1e5e2d3d96828c11ae96ddaed0.tar.gz
emacs-21800cb80bdd7f1e5e2d3d96828c11ae96ddaed0.zip
*** empty log message ***
-rw-r--r--lisp/progmodes/etags.el54
1 files changed, 39 insertions, 15 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 014832f46b3..28e7f8412c6 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -227,6 +227,24 @@ Returns t if it visits a tags table, or nil if there are no more in the list."
227 (cdr (assq 'tags-file-name (buffer-local-variables)))) 227 (cdr (assq 'tags-file-name (buffer-local-variables))))
228 (and default-tags-table-function 228 (and default-tags-table-function
229 (funcall default-tags-table-function)) 229 (funcall default-tags-table-function))
230 ;; Look for a tags table that contains
231 ;; tags for the current buffer's file.
232 (let ((tables tags-table-list)
233 (this-file (buffer-file-name))
234 (found nil))
235 (save-excursion
236 (while tables
237 (if (assoc this-file
238 (let ((tags-file-name (car tables)))
239 (visit-tags-file nil)
240 (or tags-table-files
241 (setq tags-table-files
242 (funcall
243 tags-table-files-function)))))
244 (setq found (car tables)
245 tables nil)
246 (setq tables (cdr tables)))))
247 found)
230 (car tags-table-list-pointer) 248 (car tags-table-list-pointer)
231 tags-file-name 249 tags-file-name
232 (expand-file-name 250 (expand-file-name
@@ -420,6 +438,9 @@ File names returned are absolute."
420 (or default (error "There is no default tag")) 438 (or default (error "There is no default tag"))
421 spec)))) 439 spec))))
422 440
441(defvar last-tag nil
442 "Last tag found by \\[find-tag].")
443
423;;;###autoload 444;;;###autoload
424(defun find-tag-noselect (tagname &optional next-p regexp-p) 445(defun find-tag-noselect (tagname &optional next-p regexp-p)
425 "Find tag (in current tags table) whose name contains TAGNAME. 446 "Find tag (in current tags table) whose name contains TAGNAME.
@@ -438,21 +459,24 @@ See documentation of variable `tags-file-name'."
438 '(nil t) 459 '(nil t)
439 (find-tag-tag "Find tag: "))) 460 (find-tag-tag "Find tag: ")))
440 (let ((local-find-tag-hook find-tag-hook)) 461 (let ((local-find-tag-hook find-tag-hook))
441 (if (not next-p) 462 (if next-p
442 (visit-tags-table-buffer 'reset)) 463 nil
443 (find-tag-in-order tagname 464 (setq last-tag tagname)
444 (if regexp-p 465 (visit-tags-table-buffer 'reset))
445 find-tag-regexp-search-function 466 (prog1
446 find-tag-search-function) 467 (find-tag-in-order (if next-p last-tag tagname)
447 (if regexp-p 468 (if regexp-p
448 find-tag-regexp-tag-order 469 find-tag-regexp-search-function
449 find-tag-tag-order) 470 find-tag-search-function)
450 (if regexp-p 471 (if regexp-p
451 find-tag-regexp-next-line-after-failure-p 472 find-tag-regexp-tag-order
452 find-tag-next-line-after-failure-p) 473 find-tag-tag-order)
453 (if regexp-p "matching" "containing") 474 (if regexp-p
454 (not next-p)) 475 find-tag-regexp-next-line-after-failure-p
455 (run-hooks 'local-find-tag-hook))) 476 find-tag-next-line-after-failure-p)
477 (if regexp-p "matching" "containing")
478 (not next-p))
479 (run-hooks 'local-find-tag-hook))))
456 480
457;;;###autoload 481;;;###autoload
458(defun find-tag (tagname &optional next-p) 482(defun find-tag (tagname &optional next-p)