]> git.eshelyaron.com Git - emacs.git/commitdiff
(tags-loop-continue): Don't change point in a
authorGerd Moellmann <gerd@gnu.org>
Mon, 12 Mar 2001 16:39:22 +0000 (16:39 +0000)
committerGerd Moellmann <gerd@gnu.org>
Mon, 12 Mar 2001 16:39:22 +0000 (16:39 +0000)
file that isn't interesting.  In an interesting file, push the old
value of point on the mark ring.

lisp/ChangeLog
lisp/progmodes/etags.el

index 12f6bddd56f465c4485d0147f9c3e885dd6a2adb..21dde7721d534930d4a9e96cc1363a64160d0308 100644 (file)
@@ -1,5 +1,9 @@
 2001-03-12  Gerd Moellmann  <gerd@gnu.org>
 
+       * progmodes/etags.el (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.
+
        * mail/rmailsum.el (rmail-summary-override-mail-send-and-exit):
        New function.
        (rmail-summary-mail, rmail-summary-reply, rmail-summary-forward):
index 738f3ca2f8ab2104c97f786adf26f713f7480506..5efd54a9867550ccf6811d09cf49f5a0c3230933 100644 (file)
@@ -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 <roland@gnu.org>
@@ -1656,24 +1656,35 @@ nil, we exit; otherwise we scan the next file."
        ;; 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 @@ nil, we exit; otherwise we scan the next file."
                (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))