GNU bug report logs -
#23827
25.1.50; tab-width file-local variable has no effect in etc/HELLO
Previous Next
Reported by: Eli Zaretskii <eliz <at> gnu.org>
Date: Wed, 22 Jun 2016 17:07:01 UTC
Severity: normal
Found in version 25.1.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 23827 <at> debbugs.gnu.org (full text, mbox):
> Date: 24 Jun 2016 11:07:13 -0000
> From: Alan Mackenzie <acm <at> muc.de>
> Cc: Eli Zaretskii <eliz <at> gnu.org>
>
> However, the C function `set-buffer-major-mode', optimises the call to
> `fundamental-mode' away, because that call previously didn't do anything.
>
> (`set-buffer-major-mode' is the last fallback function which choses the
> major mode when all other methods have been tried and failed in
> `set-auto-mode'.)
>
> So I propose to remove that special optimisation from
> `set-buffer-major-mode', so that `fundamental-mode' actually gets called.
> As an alternative, it would be possible to add special handling at the
> Lisp level for `fundamental-mode', but I think that would be a worse fix.
>
> Here's my proposed patch, which works:
>
>
> diff --git a/src/buffer.c b/src/buffer.c
> index b4b8304..8756cbb 100644
> --- a/src/buffer.c
> +++ b/src/buffer.c
> @@ -1984,7 +1984,9 @@ the current buffer's major mode. */)
> function = BVAR (current_buffer, major_mode);
> }
>
> - if (NILP (function) || EQ (function, Qfundamental_mode))
> + if (NILP (function)) /* If function is `fundamental-mode', allow it to run
> + so that `run-mode-hooks' and thus
> + `hack-local-variables' get run. */
> return Qnil;
>
> count = SPECPDL_INDEX ();
>
>
> What do you think?
LGTM, but I'm not an expert on modes. I'd like to hear opinions from
others. Stefan?
Thanks.
This bug report was last modified 8 years and 213 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.