]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-tag-tag): Move (default foo) to before `:' in the prompt.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 11 Feb 2003 21:40:17 +0000 (21:40 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 11 Feb 2003 21:40:17 +0000 (21:40 +0000)
(find-tag): Make sure we move point in the proper window.

lisp/progmodes/etags.el

index e3154ae4c4a1293f2e3ebeaddc539c837a40f887..c91d18418d8d8feea51ccdbd52611c69f344b39b 100644 (file)
@@ -793,7 +793,9 @@ Assumes the tags table is the current buffer."
                               (get major-mode 'find-tag-default-function)
                               'find-tag-default)))
         (spec (completing-read (if default
-                                   (format "%s(default %s) " string default)
+                                   (format "%s (default %s): "
+                                           (substring string 0 (string-match "[ :]+\\'" string))
+                                           default)
                                  string)
                                'tags-complete-tag
                                nil nil nil nil default)))
@@ -914,10 +916,12 @@ Contrast this with the ring of marks gone to by the command.
 
 See documentation of variable `tags-file-name'."
   (interactive (find-tag-interactive "Find tag: "))
-  (let ((buf (find-tag-noselect tagname next-p regexp-p)))
+  (let* ((buf (find-tag-noselect tagname next-p regexp-p))
+        (pos (with-current-buffer buf (point))))
     (condition-case nil
        (switch-to-buffer buf)
-      (error (pop-to-buffer buf)))))
+      (error (pop-to-buffer buf)))
+    (goto-char pos)))
 ;;;###autoload (define-key esc-map "." 'find-tag)
 
 ;;;###autoload