From: Noam Postavsky <npostavs@gmail.com>
To: "Štěpán Němec" <stepnem@gmail.com>
Cc: tastytea <tastytea@tastytea.de>,
36837@debbugs.gnu.org, Andreas Schwab <schwab@linux-m68k.org>
Subject: bug#36837: 26.2; whitespace-mode: whitespace-line-column is not set to local fill-column
Date: Fri, 02 Aug 2019 17:14:34 -0400 [thread overview]
Message-ID: <85y30b2rt1.fsf@gmail.com> (raw)
In-Reply-To: <87blx7cpwf.fsf@gmail.com> ("Štěpán Němec"'s message of "Fri, 02 Aug 2019 21:45:36 +0200")
Štěpán Němec <stepnem@gmail.com> writes:
> On Fri, 02 Aug 2019 15:28:01 -0400
> Noam Postavsky wrote:
>
>> It sounds like you are confusing defcustom settings with file-local [...]
>
> I'm not sure what you mean.
I think it was me who was confused about what you meant. See the last
section of this message.
> Whether a library will need to be loaded or not depends on whether the
> feature required by a particular hook or variable value (e.g. in case
> of "eval" file-local variables) is already provided or not.
>
> In this particular case, if you follow OP's recipe (emacs -Q),
> `whitespace-mode' is autoloaded, so the whitespace library will be
> loaded only at the point the hook is run.
You are right that, strictly speaking, whitespace.el does get loaded
while opening the file (via running conf-mode-hook). But if I modify
the OP's recipe by adding a require:
(require 'whitespace)
(setq whitespace-line-column nil)
(add-hook 'conf-mode-hook
(lambda () (whitespace-mode)))
I get the same result. So I don't think the autoloading is relevant.
> Really, isn't this how we all customize all kinds of variables? In your
> init file you have (setq some-var some-value) (or the equivalent
> customize forms if you're into that) even before the relevant feature is
> provided (by loading the library), and the defvar form in the pertinent
> library will of course not clobber the user-specified value. Unless I'm
> missing something, it works the same way if you `hack-local-variables'
> before loading the whitespace.el library in this particular case.
Oh, the digression into the defvars/defcustom thing was just an analogy?
Ignore my previous message then.
If I've now understood correctly, you are assuming the file-local
setting is a kind of default setting, like (defvar foo DEFAULT) which
you expect to override from your init file. But the intended usage is
that you do:
(setq some-var some-value) in your init file as a global setting,
(add-hook some-mode-hook (lambda () (setq some-var another-value)) as
a mode-specific seting, and
-*- some-var: yet-another-value -*- as a file-specific setting.
So they go in that order: global may be overridden by mode-specific,
which may be overriden by file-specific.
next prev parent reply other threads:[~2019-08-02 21:14 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 9:17 bug#36837: 26.2; whitespace-mode: whitespace-line-column is not set to local fill-column tastytea
2019-08-02 14:57 ` Štěpán Němec
2019-08-02 15:04 ` Andreas Schwab
2019-08-02 15:11 ` Štěpán Němec
2019-08-02 15:15 ` Andreas Schwab
2019-08-02 15:22 ` Štěpán Němec
2019-08-02 15:33 ` Andreas Schwab
2019-08-02 15:20 ` Eli Zaretskii
2019-08-02 15:30 ` Štěpán Němec
2019-08-02 18:51 ` Eli Zaretskii
2019-08-02 19:10 ` Štěpán Němec
2019-08-02 19:39 ` Eli Zaretskii
2019-08-02 19:28 ` Noam Postavsky
2019-08-02 19:45 ` Štěpán Němec
2019-08-02 21:14 ` Noam Postavsky [this message]
2019-08-02 21:50 ` Štěpán Němec
2019-08-02 21:54 ` Andreas Schwab
2019-08-03 7:50 ` tastytea
2019-08-03 9:23 ` Štěpán Němec
2020-02-24 19:56 ` Noam Postavsky
2020-02-24 20:12 ` Štěpán Němec
2020-02-26 0:38 ` Noam Postavsky
2020-02-28 5:01 ` Eli Zaretskii
2020-02-28 8:14 ` Štěpán Němec
2020-03-02 3:58 ` Noam Postavsky
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=85y30b2rt1.fsf@gmail.com \
--to=npostavs@gmail.com \
--cc=36837@debbugs.gnu.org \
--cc=schwab@linux-m68k.org \
--cc=stepnem@gmail.com \
--cc=tastytea@tastytea.de \
/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.