all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alan Mackenzie <acm@muc.de>, Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 23827@debbugs.gnu.org
Subject: bug#23827: 25.1.50; tab-width file-local variable has no effect in etc/HELLO
Date: Fri, 24 Jun 2016 16:28:52 +0300	[thread overview]
Message-ID: <83vb0y1zsb.fsf@gnu.org> (raw)
In-Reply-To: <20160624110713.13909.qmail@mail.muc.de> (message from Alan Mackenzie on 24 Jun 2016 11:07:13 -0000)

> Date: 24 Jun 2016 11:07:13 -0000
> From: Alan Mackenzie <acm@muc.de>
> Cc: Eli Zaretskii <eliz@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.





  reply	other threads:[~2016-06-24 13:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 17:05 bug#23827: 25.1.50; tab-width file-local variable has no effect in etc/HELLO Eli Zaretskii
     [not found] ` <mailman.2018.1466615229.1216.bug-gnu-emacs@gnu.org>
2016-06-24 11:07   ` Alan Mackenzie
2016-06-24 13:28     ` Eli Zaretskii [this message]
2016-06-24 14:12       ` Stefan Monnier
2016-06-24 14:17         ` Eli Zaretskii
2016-06-24 14:27           ` Stefan Monnier
2016-06-24 16:09             ` Alan Mackenzie
2016-06-25  0:21               ` Stefan Monnier
2016-06-27 12:52                 ` Alan Mackenzie
2016-06-27 22:03                   ` Stefan Monnier
2016-06-28 10:10                     ` Alan Mackenzie
2016-06-28 21:43                       ` Stefan Monnier
2016-06-30  9:22                         ` Alan Mackenzie
2016-06-30 22:37                           ` Stefan Monnier
2016-06-30 22:39                           ` Stefan Monnier
2016-10-10 10:37                             ` Eli Zaretskii
2016-10-15 14:07                               ` Eli Zaretskii
2016-06-24 16:35 ` Leo Liu
     [not found] ` <mailman.2101.1466786228.1216.bug-gnu-emacs@gnu.org>
2016-06-24 17:17   ` Alan Mackenzie

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=83vb0y1zsb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=23827@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=monnier@iro.umontreal.ca \
    /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.