Subject: Re: bug#10650: view-mode inconsistencies wrt special mode-class

From: Chong Yidong <[email-masked]>
Date: Tue, 31 Jan 2012 14:17:07 +0800

Glenn Morris <[email-masked]> writes:

> AFAIK, the only documented meaning of special mode-class is:
>
> If the default-value of major-mode is nil, then creating a new buffer
> inherits the major-mode of the previously current buffer UNLESS that
> buffer has a special mode-class, in which case the new buffer gets
> fundamental mode. (Doesn't seem a very useful feature to me.)

The Lisp manual (node Basic Major Modes) says:

   Special mode is a basic major mode for buffers containing text
   that is produced specially by Emacs, rather than from a file.

That's the reason that special modes are never inherited when you make a
new buffer, even if major-mode has a nil default value.  The major mode
itself is not useful without other special "stuff" done by Emacs to
populate or process the buffer.

Unfortunately, this meaning tends to get obscured by the contents of
special-mode-map, where we've tried to "helpfully" set up keybindings
like "q" for quit-window.  But this is mostly tolerable.

I think view-file is right not to enable View mode for special mode, and
view-file-other-window/view-file-other-frame should be fixed up
similarly.  As for view-buffer, it is OK as is.