changeset 49734:ee509ddc7a03

(find-tag-tag): Move (default foo) to before `:' in the prompt. (find-tag): Make sure we move point in the proper window.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 11 Feb 2003 21:40:17 +0000
parents 8c39780e4fdf
children 5cfff357b829
files lisp/progmodes/etags.el
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/etags.el	Tue Feb 11 21:24:35 2003 +0000
+++ b/lisp/progmodes/etags.el	Tue Feb 11 21:40:17 2003 +0000
@@ -793,7 +793,9 @@
 			       (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 @@
 
 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