# HG changeset patch # User Gerd Moellmann # Date 984415123 0 # Node ID 1e71d38a27dfd8f7318d79e5223fe6d94e25828e # Parent 3bc6ebd9fb390ae51f25c5b3e32382762e8086c0 (tags-loop-continue): Don't change point in a file that isn't interesting. In an interesting file, push the old value of point on the mark ring. diff -r 3bc6ebd9fb39 -r 1e71d38a27df lisp/progmodes/etags.el --- a/lisp/progmodes/etags.el Mon Mar 12 15:58:43 2001 +0000 +++ b/lisp/progmodes/etags.el Mon Mar 12 16:38:43 2001 +0000 @@ -1,5 +1,5 @@ ;;; etags.el --- etags facility for Emacs -;; Copyright (C) 1985, 86, 88, 89, 92, 93, 94, 95, 96, 98, 2000 +;; Copyright (C) 1985, 86, 88, 89, 92, 93, 94, 95, 96, 98, 2000, 2001 ;; Free Software Foundation, Inc. ;; Author: Roland McGrath @@ -1656,24 +1656,35 @@ ;; Non-nil means we have finished one file ;; and should not scan it again. file-finished + original-point (messaged nil)) (while (progn ;; Scan files quickly for the first or next interesting one. + ;; This starts at point in the current buffer. (while (or first-time file-finished (save-restriction (widen) (not (tags-loop-eval tags-loop-scan)))) + ;; If nothing was found in the previous file, and + ;; that file isn't in a temp buffer, restore point to + ;; where it was. + (when original-point + (goto-char original-point)) + (setq file-finished nil) (setq new (next-file first-time t)) + ;; If NEW is non-nil, we got a temp buffer, ;; and NEW is the file name. - (if (or messaged - (and (not first-time) - (> baud-rate search-slow-speed) - (setq messaged t))) - (message "Scanning file %s..." (or new buffer-file-name))) + (when (or messaged + (and (not first-time) + (> baud-rate search-slow-speed) + (setq messaged t))) + (message "Scanning file %s..." (or new buffer-file-name))) + (setq first-time nil) + (setq original-point (if new nil (point))) (goto-char (point-min))) ;; If we visited it in a temp buffer, visit it now for real. @@ -1683,7 +1694,8 @@ (set-buffer (find-file-noselect new)) (setq new nil) ;No longer in a temp buffer. (widen) - (goto-char pos))) + (goto-char pos)) + (push-mark original-point t)) (switch-to-buffer (current-buffer))