unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Where does a dir-local variable come from?
@ 2022-09-05  8:58 Eduardo Ochs
  2022-09-05 11:47 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Eduardo Ochs @ 2022-09-05  8:58 UTC (permalink / raw)
  To: help-gnu-emacs

Hi list,

is there a good low-level way to discover where a certain dir-local
variable "comes from"? For example, in my machine these two files

  /home/edrx/.dir-locals.el
  /home/edrx/eev-current/.dir-locals.el

specify different values for the variable `ee-preferred-c', and so I
(usually) have at least two different entries in
`dir-locals-class-alist' that mention `ee-preferred-c'. They can be
accessed with:

  (alist-get '/home/edrx/             dir-locals-class-alist)
  (alist-get '/home/edrx/eev-current/ dir-locals-class-alist)

I am looking for code that parses the value of
`dir-locals-class-alist', and that can say things like "the dir-local
variable `ee-preferred-c' appears in the entries for
/home/edrx/eev-current/, /home/edrx/, and /home/edrx/dednat6/ of
`dir-locals-class-alist'; as your current directory is
/home/edrx/eev-current/experimental/ then the entries for
/home/edrx/eev-current/ and /home/edrx/ are relevant here, and the one
in /home/edrx/eev-current/ is the one that takes precedence"...

  Thanks in advance!
    Eduardo Ochs
    http://angg.twu.net/#eev



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

* Re: Where does a dir-local variable come from?
  2022-09-05  8:58 Where does a dir-local variable come from? Eduardo Ochs
@ 2022-09-05 11:47 ` Eli Zaretskii
  2022-09-06  2:59   ` Eduardo Ochs
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2022-09-05 11:47 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Eduardo Ochs <eduardoochs@gmail.com>
> Date: Mon, 5 Sep 2022 05:58:12 -0300
> 
> is there a good low-level way to discover where a certain dir-local
> variable "comes from"? For example, in my machine these two files
> 
>   /home/edrx/.dir-locals.el
>   /home/edrx/eev-current/.dir-locals.el

"C-h v" is supposed to tell you which dir-locals file have set the
current value of a variable.



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

* Re: Where does a dir-local variable come from?
  2022-09-05 11:47 ` Eli Zaretskii
@ 2022-09-06  2:59   ` Eduardo Ochs
  2022-09-06  3:27     ` Emanuel Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Eduardo Ochs @ 2022-09-06  2:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Mon, 5 Sept 2022 at 09:16, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Eduardo Ochs <eduardoochs@gmail.com>
> > Date: Mon, 5 Sep 2022 05:58:12 -0300
> >
> > is there a good low-level way to discover where a certain dir-local
> > variable "comes from"? For example, in my machine these two files
> >
> >   /home/edrx/.dir-locals.el
> >   /home/edrx/eev-current/.dir-locals.el
>
> "C-h v" is supposed to tell you which dir-locals file have set the
> current value of a variable.

Oops, you're right!

When I run `C-h v ee-preferred-c' inside a file it reports which
.dir-locals.el file has set that variable, but when I run `C-h v
ee-preferred-c' inside a dired buffer it doesn't, and I had only
tested that in a dired buffer.

My mistake! Sorry! =(
  [[]],
    Eduardo Ochs
    http://angg.twu.net/eepitch.html
    http://angg.twu.net/#eev



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

* Re: Where does a dir-local variable come from?
  2022-09-06  2:59   ` Eduardo Ochs
@ 2022-09-06  3:27     ` Emanuel Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Emanuel Berg @ 2022-09-06  3:27 UTC (permalink / raw)
  To: help-gnu-emacs

Eduardo Ochs wrote:

> When I run `C-h v ee-preferred-c' inside a file it reports
> which .dir-locals.el file has set that variable

It does?

I tried C-h v with `enable-recursive-minibuffers',
`fill-column' and `minibuffer-default-prompt-format' and it
doesn't say anything to that end what I can see.

Maybe only works for certain variables ...

-- 
underground experts united
https://dataswamp.org/~incal




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

end of thread, other threads:[~2022-09-06  3:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-05  8:58 Where does a dir-local variable come from? Eduardo Ochs
2022-09-05 11:47 ` Eli Zaretskii
2022-09-06  2:59   ` Eduardo Ochs
2022-09-06  3:27     ` Emanuel Berg

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