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

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

bug#9214: `fundamental-mode-hook' not run when setting up `fundamental-m


From: Štěpán Němec
Subject: bug#9214: `fundamental-mode-hook' not run when setting up `fundamental-mode' under certain circumstances; Info documentation incorrect
Date: Mon, 30 Jan 2012 05:45:50 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Jan 29, 2012 at 11:16:11PM -0500, Stefan Monnier wrote:
> > Exactly. I need a way to run code for _any_ new buffer (I don't
> > really need to run the code for temporary buffers which never get
> > any user interaction, but I don't think there is a way to set those
> > apart), no
>
> There is a way: whether they call a major-mode function or not.

Ooh, I did not know that. Thanks. Is this documented somewhere? (I.e., a
recommendation that a major mode function should be called in any buffer
of potential interest to the user.)

In that case, `after-change-major-mode-hook' should do, after all.

> Of course, some packages may erroneously forget to call a major-mode
> function for those buffers, but the problem is in those packages.

Yes, I admit I have code around that does(n't do) that myself (e.g.
simple dumping of some text into a buffer left in fundamental-mode), as
I had no idea calling e.g. `fundamental-mode' in a buffer already in
fundamental-mode was supposed to be of some value (until I bumped into
this problem, that is).

-- 
Štěpán





reply via email to

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