bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23407: .dir-local settings get obliterated on running a major mode f


From: Stefan Monnier
Subject: bug#23407: .dir-local settings get obliterated on running a major mode function.
Date: Mon, 02 May 2016 00:02:11 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> Anyhow, I've hacked a patch together.  The idea is to call
> `hack-local-variables' from `run-mode-hooks' rather than from
> `normal-mode'.

Good idea.

> +    ;; delay-mode-hooks is set when `byte-compile-file' is the caller.
> +    ;; It is essential that we call `hack-local-variables' in order to
> +    ;; set up `lexical-binding', since `run-mode-hooks' is prevented
> +    ;; from doing its job.
> +    (when delay-mode-hooks
> +      (with-demoted-errors "File local-variables error: %s"
> +        (hack-local-variables 'no-mode))))

But this seems terribly brittle.  Do we care about delay-mode-hooks (as
the code says) or about byte-compile-file (as the comment says)?
If it's the former, then the comment needs to be fixed, if it's the
latter, than we need to find some other way to tell this code what's
going on.


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]