GNU bug report logs - #31578
24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp

Previous Next

Package: emacs;

Reported by: u0138544 <rob.sargent <at> utah.edu>

Date: Thu, 24 May 2018 08:25:03 UTC

Severity: minor

Tags: moreinfo

Found in version 24.3

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31578 in the body.
You can then email your comments to 31578 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Thu, 24 May 2018 08:25:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to u0138544 <rob.sargent <at> utah.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 24 May 2018 08:25:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: u0138544 <rob.sargent <at> utah.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
Date: Wed, 23 May 2018 16:03:16 -0600
[Message part 1 (text/plain, inline)]
I could not successfully override locate-domination-stop-dir-regexp via .emacs because vc-find-root restores the default value.

STR:
override locate-dominating-stop-dir-regexp in .emacs with:
         (setq locate-dominating-stop-dir-regexp "\\`\\(?:/uufs/chpc.utah.edu/common/home/[^\\/]+/\\|~/\\)\\'")

edebug-defun locate-dominating-file
stop at string-match, note value of locate-dominating-stop-dir-regexp
continue to next call to string-match (for a different dominating file)
re-check value of locate-dominating-stop-dir-regexp

You will find that for calls from vc-find-root the value of
locate-dominating-stop-dir-regexp will be the default (from files.el) as
opposed to the value in the .emacs setq

I maintain that locate-dominating-stop-dir-regexp might be better served
as an extensible list though others believe concatenating regexp after
regexp is the way to go.

An exchange on the google gnu.emacs.help forum can be found here: https://groups.google.com/forum/#!topic/gnu.emacs.help/wec_aPpUmqg <https://groups.google.com/forum/#!topic/gnu.emacs.help/wec_aPpUmqg>

Thanks,
rjs

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sat, 13 Jul 2019 14:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 31578 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: u0138544 <rob.sargent <at> utah.edu>
Cc: 31578 <at> debbugs.gnu.org
Subject: Re: bug#31578: 24.3; vc-ignore-root-dir resets
 locate-dominating-stop-dir-regexp
Date: Sat, 13 Jul 2019 16:27:32 +0200
u0138544 <rob.sargent <at> utah.edu> writes:

> I could not successfully override locate-domination-stop-dir-regexp via .emacs because
> vc-find-root restores the default value.
>
> STR:
> override locate-dominating-stop-dir-regexp in .emacs with:
>          (setq locate-dominating-stop-dir-regexp "\\`\\(?:/uufs/chpc.utah.edu/common/home/
> [^\\/]+/\\|~/\\)\\'")

I couldn't find the string "locate-dominating-stop-dir-regexp" anywhere
in the current Emacs sources, so I'm guessing this is no longer an issue
and is closing the bug report.  Please reopen if this is a mistake.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 31578 <at> debbugs.gnu.org and u0138544 <rob.sargent <at> utah.edu> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 13 Jul 2019 14:28:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sat, 13 Jul 2019 16:32:02 GMT) Full text and rfc822 format available.

Message #13 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andy Moreton <andrewjmoreton <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#31578: 24.3;
 vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
Date: Sat, 13 Jul 2019 17:31:02 +0100
On Sat 13 Jul 2019, Lars Ingebrigtsen wrote:

> u0138544 <rob.sargent <at> utah.edu> writes:
>
>> I could not successfully override locate-domination-stop-dir-regexp via .emacs because
>> vc-find-root restores the default value.
>>
>> STR:
>> override locate-dominating-stop-dir-regexp in .emacs with:
>>          (setq locate-dominating-stop-dir-regexp "\\`\\(?:/uufs/chpc.utah.edu/common/home/
>> [^\\/]+/\\|~/\\)\\'")
>
> I couldn't find the string "locate-dominating-stop-dir-regexp" anywhere
> in the current Emacs sources, so I'm guessing this is no longer an issue
> and is closing the bug report.  Please reopen if this is a mistake.

`locate-dominating-stop-dir-regexp' is defined in files.el, so not so
hard to find.

Perhaps the reporter nees to sue `setq-default' rather than `setq'.

    AndyM







Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 13 Jul 2019 16:37:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sat, 13 Jul 2019 16:38:02 GMT) Full text and rfc822 format available.

Message #18 received at 31578 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andy Moreton <andrewjmoreton <at> gmail.com>
Cc: 31578 <at> debbugs.gnu.org
Subject: Re: bug#31578: 24.3;
 vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
Date: Sat, 13 Jul 2019 18:37:01 +0200
Andy Moreton <andrewjmoreton <at> gmail.com> writes:

> `locate-dominating-stop-dir-regexp' is defined in files.el, so not so
> hard to find.

Sorry; I must have been in the wrong directory when I grepped...

Reopened.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sun, 14 Jul 2019 20:03:02 GMT) Full text and rfc822 format available.

Message #21 received at 31578 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: u0138544 <rob.sargent <at> utah.edu>, 31578 <at> debbugs.gnu.org
Subject: Re: bug#31578: 24.3; vc-ignore-root-dir resets
 locate-dominating-stop-dir-regexp
Date: Sun, 14 Jul 2019 23:01:41 +0300
>> I could not successfully override locate-domination-stop-dir-regexp via .emacs because
>> vc-find-root restores the default value.

BTW, doesn't vc-find-root have the same purpose as vc-root-dir?
I don't understand the difference between them.  Why the same
functionality under two different names?  If they do similar
things, then we could expropriate vc-root-dir as a command
to visit the root dir in vc-dir mode.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sun, 14 Jul 2019 20:15:02 GMT) Full text and rfc822 format available.

Message #24 received at 31578 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: u0138544 <rob.sargent <at> utah.edu>, 31578 <at> debbugs.gnu.org
Subject: Re: bug#31578: 24.3; vc-ignore-root-dir resets
 locate-dominating-stop-dir-regexp
Date: Sun, 14 Jul 2019 23:14:21 +0300
On 14.07.2019 23:01, Juri Linkov wrote:
> BTW, doesn't vc-find-root have the same purpose as vc-root-dir?
> I don't understand the difference between them.

Take a look at the usages.

vc-find-root is used in the implementations of vc-root-dir.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sun, 14 Jul 2019 20:58:02 GMT) Full text and rfc822 format available.

Message #27 received at 31578 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, u0138544 <rob.sargent <at> utah.edu>,
 31578 <at> debbugs.gnu.org
Subject: Re: bug#31578: 24.3; vc-ignore-root-dir resets
 locate-dominating-stop-dir-regexp
Date: Sun, 14 Jul 2019 23:51:01 +0300
>> BTW, doesn't vc-find-root have the same purpose as vc-root-dir?
>> I don't understand the difference between them.
>
> Take a look at the usages.
>
> vc-find-root is used in the implementations of vc-root-dir.

Ah, I see now, thanks.  Then we could name a new command vc-dir-root
(that will use vc-root-dir to visit root dir in vc-dir-mode).

BTW, I tried `M-x vc-dir-search' (not bound to any key)
but it raises an error.  Should I create a bug report?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sun, 14 Jul 2019 21:28:02 GMT) Full text and rfc822 format available.

Message #30 received at 31578 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, u0138544 <rob.sargent <at> utah.edu>,
 31578 <at> debbugs.gnu.org
Subject: Re: bug#31578: 24.3; vc-ignore-root-dir resets
 locate-dominating-stop-dir-regexp
Date: Mon, 15 Jul 2019 00:27:23 +0300
On 14.07.2019 23:51, Juri Linkov wrote:

> Then we could name a new command vc-dir-root
> (that will use vc-root-dir to visit root dir in vc-dir-mode).

OK, sure.

> BTW, I tried `M-x vc-dir-search' (not bound to any key)
> but it raises an error.  Should I create a bug report?

Or go ahead and fix it, I guess.

This patch seems to do the trick:

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 41b1087ee5..daa2865d88 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -805,8 +805,7 @@ vc-dir-search
 To continue searching for next match, use command \\[tags-loop-continue]."
   (interactive "sSearch marked files (regexp): ")
   (tags-search regexp
-               (lambda ()
-                 (mapcar #'car (vc-dir-marked-only-files-and-states)))))
+               (mapcar #'car (vc-dir-marked-only-files-and-states))))

 (defun vc-dir-query-replace-regexp (from to &optional delimited)
   "Do `query-replace-regexp' of FROM with TO, on all marked files.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sat, 22 Aug 2020 15:32:02 GMT) Full text and rfc822 format available.

Message #33 received at 31578 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: u0138544 <rob.sargent <at> utah.edu>
Cc: 31578 <at> debbugs.gnu.org
Subject: Re: bug#31578: 24.3; vc-ignore-root-dir resets
 locate-dominating-stop-dir-regexp
Date: Sat, 22 Aug 2020 17:31:30 +0200
u0138544 <rob.sargent <at> utah.edu> writes:

> I could not successfully override locate-domination-stop-dir-regexp via .emacs
> because vc-find-root restores the default value.
>
> STR:
> override locate-dominating-stop-dir-regexp in .emacs with:
>          (setq locate-dominating-stop-dir-regexp "\\`\\
> (?:/uufs/chpc.utah.edu/common/home/[^\\/]+/\\|~/\\)\\'")
>
> edebug-defun locate-dominating-file
> stop at string-match, note value of locate-dominating-stop-dir-regexp
> continue to next call to string-match (for a different dominating file)
> re-check value of locate-dominating-stop-dir-regexp
>
> You will find that for calls from vc-find-root the value of
> locate-dominating-stop-dir-regexp will be the default (from files.el) as
> opposed to the value in the .emacs setq

I think you're seeing the effect of this:

(defun vc-find-root (file witness)
  "Find the root of a checked out project.
The function walks up the directory tree from FILE looking for WITNESS.
If WITNESS if not found, return nil, otherwise return the root."
  (let ((locate-dominating-stop-dir-regexp
         (or vc-ignore-dir-regexp locate-dominating-stop-dir-regexp)))
    (locate-dominating-file file witness)))

vc-ignore-dir-regexp defaults to locate-dominating-stop-dir-regexp,
though, so could it be that you're setting
locate-dominating-stop-dir-regexp after you've loaded vc.el?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 22 Aug 2020 15:32:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 31578 <at> debbugs.gnu.org and u0138544 <rob.sargent <at> utah.edu> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 22 Aug 2020 15:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sat, 22 Aug 2020 15:43:02 GMT) Full text and rfc822 format available.

Message #40 received at 31578 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ROB SARGENT <rob.sargent <at> utah.edu>
Cc: "31578 <at> debbugs.gnu.org" <31578 <at> debbugs.gnu.org>
Subject: Re: bug#31578: 24.3; vc-ignore-root-dir resets
 locate-dominating-stop-dir-regexp
Date: Sat, 22 Aug 2020 17:41:58 +0200
ROB SARGENT <rob.sargent <at> utah.edu> writes:

> I think this has been taken care of. Thanks

OK; closing the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31578; Package emacs. (Sat, 22 Aug 2020 19:42:02 GMT) Full text and rfc822 format available.

Message #43 received at 31578 <at> debbugs.gnu.org (full text, mbox):

From: ROB SARGENT <rob.sargent <at> utah.edu>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "31578 <at> debbugs.gnu.org" <31578 <at> debbugs.gnu.org>
Subject: Re: bug#31578: 24.3; vc-ignore-root-dir resets
 locate-dominating-stop-dir-regexp
Date: Sat, 22 Aug 2020 15:40:36 +0000

> On Aug 22, 2020, at 9:31 AM, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> 
> u0138544 <rob.sargent <at> utah.edu> writes:
> 
>> I could not successfully override locate-domination-stop-dir-regexp via .emacs
>> because vc-find-root restores the default value.
>> 
>> STR:
>> override locate-dominating-stop-dir-regexp in .emacs with:
>>         (setq locate-dominating-stop-dir-regexp "\\`\\
>> (?:/uufs/chpc.utah.edu/common/home/[^\\/]+/\\|~/\\)\\'")
>> 
>> edebug-defun locate-dominating-file
>> stop at string-match, note value of locate-dominating-stop-dir-regexp
>> continue to next call to string-match (for a different dominating file)
>> re-check value of locate-dominating-stop-dir-regexp
>> 
>> You will find that for calls from vc-find-root the value of
>> locate-dominating-stop-dir-regexp will be the default (from files.el) as
>> opposed to the value in the .emacs setq
> 
> I think you're seeing the effect of this:
> 
> (defun vc-find-root (file witness)
>  "Find the root of a checked out project.
> The function walks up the directory tree from FILE looking for WITNESS.
> If WITNESS if not found, return nil, otherwise return the root."
>  (let ((locate-dominating-stop-dir-regexp
>         (or vc-ignore-dir-regexp locate-dominating-stop-dir-regexp)))
>    (locate-dominating-file file witness)))
> 
> vc-ignore-dir-regexp defaults to locate-dominating-stop-dir-regexp,
> though, so could it be that you're setting
> locate-dominating-stop-dir-regexp after you've loaded vc.el?
> 

I think this has been taken care of. Thanks
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>   bloggy blog: http://lars.ingebrigtsen.no

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Sep 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 267 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.