unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
@ 2018-05-23 22:03 u0138544
  2019-07-13 14:27 ` Lars Ingebrigtsen
  2020-08-22 15:31 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 11+ messages in thread
From: u0138544 @ 2018-05-23 22:03 UTC (permalink / raw)
  To: 31578

[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 1963 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2018-05-23 22:03 bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp u0138544
@ 2019-07-13 14:27 ` Lars Ingebrigtsen
  2019-07-13 16:31   ` Andy Moreton
  2019-07-14 20:01   ` Juri Linkov
  2020-08-22 15:31 ` Lars Ingebrigtsen
  1 sibling, 2 replies; 11+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-13 14:27 UTC (permalink / raw)
  To: u0138544; +Cc: 31578

u0138544 <rob.sargent@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2019-07-13 14:27 ` Lars Ingebrigtsen
@ 2019-07-13 16:31   ` Andy Moreton
  2019-07-13 16:37     ` Lars Ingebrigtsen
  2019-07-14 20:01   ` Juri Linkov
  1 sibling, 1 reply; 11+ messages in thread
From: Andy Moreton @ 2019-07-13 16:31 UTC (permalink / raw)
  To: 31578

On Sat 13 Jul 2019, Lars Ingebrigtsen wrote:

> u0138544 <rob.sargent@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








^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2019-07-13 16:31   ` Andy Moreton
@ 2019-07-13 16:37     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-13 16:37 UTC (permalink / raw)
  To: Andy Moreton; +Cc: 31578

Andy Moreton <andrewjmoreton@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2019-07-13 14:27 ` Lars Ingebrigtsen
  2019-07-13 16:31   ` Andy Moreton
@ 2019-07-14 20:01   ` Juri Linkov
  2019-07-14 20:14     ` Dmitry Gutov
  1 sibling, 1 reply; 11+ messages in thread
From: Juri Linkov @ 2019-07-14 20:01 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: u0138544, 31578

>> 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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2019-07-14 20:01   ` Juri Linkov
@ 2019-07-14 20:14     ` Dmitry Gutov
  2019-07-14 20:51       ` Juri Linkov
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Gutov @ 2019-07-14 20:14 UTC (permalink / raw)
  To: Juri Linkov, Lars Ingebrigtsen; +Cc: u0138544, 31578

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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2019-07-14 20:14     ` Dmitry Gutov
@ 2019-07-14 20:51       ` Juri Linkov
  2019-07-14 21:27         ` Dmitry Gutov
  0 siblings, 1 reply; 11+ messages in thread
From: Juri Linkov @ 2019-07-14 20:51 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Lars Ingebrigtsen, u0138544, 31578

>> 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?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2019-07-14 20:51       ` Juri Linkov
@ 2019-07-14 21:27         ` Dmitry Gutov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Gutov @ 2019-07-14 21:27 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Ingebrigtsen, u0138544, 31578

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.





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2018-05-23 22:03 bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp u0138544
  2019-07-13 14:27 ` Lars Ingebrigtsen
@ 2020-08-22 15:31 ` Lars Ingebrigtsen
  2020-08-22 15:40   ` ROB SARGENT
  1 sibling, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-22 15:31 UTC (permalink / raw)
  To: u0138544; +Cc: 31578

u0138544 <rob.sargent@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2020-08-22 15:31 ` Lars Ingebrigtsen
@ 2020-08-22 15:40   ` ROB SARGENT
  2020-08-22 15:41     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: ROB SARGENT @ 2020-08-22 15:40 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 31578@debbugs.gnu.org



> On Aug 22, 2020, at 9:31 AM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> u0138544 <rob.sargent@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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp
  2020-08-22 15:40   ` ROB SARGENT
@ 2020-08-22 15:41     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-22 15:41 UTC (permalink / raw)
  To: ROB SARGENT; +Cc: 31578@debbugs.gnu.org

ROB SARGENT <rob.sargent@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-08-22 15:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 22:03 bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp u0138544
2019-07-13 14:27 ` Lars Ingebrigtsen
2019-07-13 16:31   ` Andy Moreton
2019-07-13 16:37     ` Lars Ingebrigtsen
2019-07-14 20:01   ` Juri Linkov
2019-07-14 20:14     ` Dmitry Gutov
2019-07-14 20:51       ` Juri Linkov
2019-07-14 21:27         ` Dmitry Gutov
2020-08-22 15:31 ` Lars Ingebrigtsen
2020-08-22 15:40   ` ROB SARGENT
2020-08-22 15:41     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).