unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Štěpán Němec" <stepnem@gmail.com>
To: Noam Postavsky <npostavs@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 23:50:19 +0200	[thread overview]
Message-ID: <877e7vck4k.fsf@gmail.com> (raw)
In-Reply-To: <85y30b2rt1.fsf@gmail.com>

On Fri, 02 Aug 2019 17:14:34 -0400
Noam Postavsky wrote:

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

Yes, but OP's case is a bit more subtle, as I described in my very
first e-mail. Maybe a more visual representation will help. Here's
what happens (simplified) when visiting test.cfg during OP's recipe:

1. fill-column is at default value
2. `run-mode-hooks' is called
3. `conf-mode-hook' is run
4. `whitespace-mode' is called
5. `whitespace-color-on' is called, which sets up whitespace-font-lock-keywords,
    still with the default value of fill-column
6. `hack-local-variables' is called to parse and apply file-local settings
7. fill-column is set to 200

If what's really intended is that file-local settings prevail as much
as possible, this is a failure. That's why I'm wondering whether
reversing the order wouldn't actually work better, for reasons I
detailed in the reply to Andreas. As this case illustrates, libraries
often do all kinds of setup during load or mode activation, so unless
the relevant settings are applied before that, they don't really take
the desired effect.

Sure, if the order _was_ reversed and the mode hooks run _after_
`hack-local-variables', they could override file-local variable
settings, but I'm wondering how likely such conflicts really are or if
that's really a bad thing at all, given typical usage.

-- 
Štěpán





  reply	other threads:[~2019-08-02 21:50 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
2019-08-02 21:50             ` Štěpán Němec [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=877e7vck4k.fsf@gmail.com \
    --to=stepnem@gmail.com \
    --cc=36837@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    --cc=schwab@linux-m68k.org \
    --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 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).