unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* applying .dir-locals.el settings when buffer-file-name is nil
@ 2009-07-19 17:47 Dan Nicolaescu
  2009-07-19 18:21 ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Nicolaescu @ 2009-07-19 17:47 UTC (permalink / raw)
  To: emacs-devel


.dir-locals.el settings do not apply to buffers when (null
buffer-file-name) even when `default-directory' for those buffers is
dominated by .dir-locals.el.

VC for example creates buffers for which it would be good to be able to
have .dir-locals.el.  Examples: the log-edit-mode buffers - be able to
set some checkin rules, or automatically add things to the commit
message,  the vc-diff buffers  - show trailing whitespace, etc.






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

* Re: applying .dir-locals.el settings when buffer-file-name is nil
  2009-07-19 17:47 applying .dir-locals.el settings when buffer-file-name is nil Dan Nicolaescu
@ 2009-07-19 18:21 ` Juri Linkov
  2009-08-03 21:18   ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2009-07-19 18:21 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

> .dir-locals.el settings do not apply to buffers when (null
> buffer-file-name) even when `default-directory' for those buffers is
> dominated by .dir-locals.el.
>
> VC for example creates buffers for which it would be good to be able to
> have .dir-locals.el.  Examples: the log-edit-mode buffers - be able to
> set some checkin rules, or automatically add things to the commit
> message,  the vc-diff buffers  - show trailing whitespace, etc.

I noticed this limitation as well and know no reason why it should be.
For file-local variables it is justified because only file can hold a list
of file-local variables.  But I think dir-local variables should have
a wider coverage including non-file buffers.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: applying .dir-locals.el settings when buffer-file-name is nil
  2009-07-19 18:21 ` Juri Linkov
@ 2009-08-03 21:18   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2009-08-03 21:18 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Dan Nicolaescu, emacs-devel

>> .dir-locals.el settings do not apply to buffers when (null
>> buffer-file-name) even when `default-directory' for those buffers is
>> dominated by .dir-locals.el.
>> 
>> VC for example creates buffers for which it would be good to be able to
>> have .dir-locals.el.  Examples: the log-edit-mode buffers - be able to
>> set some checkin rules, or automatically add things to the commit
>> message,  the vc-diff buffers  - show trailing whitespace, etc.

> I noticed this limitation as well and know no reason why it should be.
> For file-local variables it is justified because only file can hold a list
> of file-local variables.  But I think dir-local variables should have
> a wider coverage including non-file buffers.

The idea sounds good, but I'm not sure how it should be implemented.
Non-file buffers tend to be built in different ways (and their
default-directory may be set at different times, and/or may or may not
matter depending on the buffer), so they probably would need to
explicitly ask for dir-locals to be applied, rather than having it be
applied automatically to all non-file buffers.

Patches/ideas welcome,


        Stefan




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

end of thread, other threads:[~2009-08-03 21:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 17:47 applying .dir-locals.el settings when buffer-file-name is nil Dan Nicolaescu
2009-07-19 18:21 ` Juri Linkov
2009-08-03 21:18   ` Stefan Monnier

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