emacs-devel
[Top][All Lists]
Advanced

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

Re: so-long and special major modes


From: Phil Sainty
Subject: Re: so-long and special major modes
Date: Wed, 9 Dec 2020 09:08:45 +1300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 8/12/20 6:30 pm, Richard Stallman wrote:
> Emacs distinguishes two kinds of major modes: those that are for a
> kind of data, and those that correspond to special applications.  In
> the former, q will self-insert.  In the latter, q probably means
> "quit".  The way to distinguish is to test the mode-class property of
> the major mode symbol.
> 
> Dired, Rmail and Info are examples of special major modes.
> 
> so-long-major-mode may be ok to use in an ordinary major mode, but it
> is no good in a special mode.  In that situation, it is necessary to
> use so-long-minor-mode.

In general I felt it was necessary to white-list the modes for which
it is acceptable for so-long to take action, because I don't think it's
possible to automatically detect every mode in which it might be
problematic.

The `so-long-target-modes' variable serves this purpose -- the automated
behaviour only kicks in for buffers using a major mode (or derivative
thereof) from this list.  That's (prog-mode css-mode sgml-mode nxml-mode)
by default.


-Phil



reply via email to

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