bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposed patch - Better choice of default for gtags-visit-rootdir


From: Shigio YAMAGUCHI
Subject: Re: Proposed patch - Better choice of default for gtags-visit-rootdir
Date: Mon, 28 Sep 2015 07:38:49 +0900

Hello,
Sorry but I don't understand what is problem.
Would you please tell me a method by example which reproduce
the situation of the problem?

Regards,
Shigio


2015-09-27 5:56 GMT+09:00 Earl Chew <address@hidden>:
When in a file buffer that resides in what will be the gtags
root directory (because the GTAGS et al have not yet been created),
invoking gtags-visit-rootdir and pressing RETURN to accept the
default results in the file being chosen rather than the
(displayed) directory.

This is because read-file-name is using the absolute file name
of the file:

> If both default and initial are nil and the buffer is visiting
> a file, read-file-name uses the absolute file name of that
> file as default.


--- gtags.el    2015-09-14 19:48:17.000000000 -0700
+++ ../share/gtags/gtags.el     2015-09-26 13:22:52.490185835 -0700
@@ -515,13 +515,17 @@
 (defun gtags-visit-rootdir ()
   "Tell tags commands the root directory of source tree."
   (interactive)
-  (let (path input)
+  (let (path input default-path)
     (setq path gtags-rootdir)
     (if (not path)
         (setq path (gtags-get-rootpath)))
     (if (not path)
         (setq insert-default-directory (if (string-match gtags-tramp-path-regexp default-directory) nil t)))
-    (setq input (read-file-name "Visit root directory: " path path t))
+    (setq default-path
+        (if (and insert-default-directory (not path))
+            default-directory
+            path))
+    (setq input (read-file-name "Visit root directory: " path default-path t))
     (if (equal "" input) nil
       (if (not (file-directory-p input))
         (message "%s is not directory." input)

_______________________________________________
Bug-global mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-global



--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

reply via email to

[Prev in Thread] Current Thread [Next in Thread]