all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sergio Pokrovskij <sergio.pokrovskij@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 17489@debbugs.gnu.org
Subject: bug#17489: 24.3; Major mode spec in .dir-locals.el breaks dired
Date: Thu, 15 May 2014 00:24:47 +0700	[thread overview]
Message-ID: <87vbt846jk.fsf@gmail.com> (raw)
In-Reply-To: <831tvwpfar.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 May 2014 18:10:04 +0300")

>>>>> "Eli" == Eli Zaretskii wrote:

[...]

  Eli> It's not clear what did you expect instead.  Did you expect
  Eli> that unconditionally turning on some mode in a Dired buffer
  Eli> be ignored, just because it's a Dired buffer?

Kind of.  It is not quite a "local file".  Cf:

,----
| Sometimes, you may wish to define the same set of local variables
| to all the files in a certain directory ...
`---- (info "(emacs)Directory Variables")

  Eli> Or did you expect that your .dir-locals.el settings be in
  Eli> effect only for files, not for directories?

This too, normally "local variables" are not attributable to
directories, are they?

  Eli> Or did you expect that cc-mode somehow gracefully does
  Eli> nothing when the buffer text is not a C-like program
  Eli> source?

It seems that it's a dired's problem rather than cc-mode's.

  Eli> Or something else?

My expectation was that I could specify a local-variable setting
common to all the files from the directory in question.  And
actually it does work.  The only problem is that it breaks the
dired buffer.

  Eli> IOW, why isn't that .dir-locals.el setting of yours not a
  Eli> cockpit error?

Because there is no appropriate means to impose a reasonable
condition.  Just the "nil" or a major mode name.  It may happen
that I do not know the a-priori mode; actually it is mode that I
would like to set.

After all, I've found a workaround; but I believe the feature
would be more useful if it could be restricted to '-' files only
(i.e. only to those which normally can contain
"Local variables:"):

,----
| Whenever Emacs visits any file IN THAT DIRECTORY or any of its
| subdirectories, it will apply the directory-local variables
| specified in `.dir-locals.el', AS THOUGH THEY HAD BEEN DEFINED AS
| FILE-LOCAL VARIABLES for that file ...
`----

-- 
Sergio





  parent reply	other threads:[~2014-05-14 17:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14  7:14 bug#17489: 24.3; Major mode spec in .dir-locals.el breaks dired Sergio Pokrovskij
2014-05-14 15:10 ` Eli Zaretskii
2014-05-14 16:56   ` Stefan Monnier
2014-05-14 17:24   ` Sergio Pokrovskij [this message]
2014-05-14 17:31     ` Glenn Morris
2014-05-14 17:38       ` Glenn Morris
2014-05-14 18:20         ` Eli Zaretskii
2014-05-14 18:29           ` Glenn Morris
2014-05-14 18:40             ` Eli Zaretskii
2014-05-14 19:01               ` Glenn Morris
2014-05-14 19:38                 ` Eli Zaretskii
2014-05-14 19:40                   ` Glenn Morris
2022-02-22 14:29       ` Lars Ingebrigtsen
2014-05-14 18:17     ` Eli Zaretskii
2014-05-15  0:39       ` Sergio Pokrovskij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbt846jk.fsf@gmail.com \
    --to=sergio.pokrovskij@gmail.com \
    --cc=17489@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.