Subject: Re: bug#31578: 24.3; vc-ignore-root-dir resets locate-dominating-stop-dir-regexp

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 22 Aug 2020 17:31:30 +0200

u0138544 <[email-masked]> 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