unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Glenn Morris <rgm@gnu.org>
Cc: Chong Yidong <cyd@gnu.org>, 10650@debbugs.gnu.org
Subject: bug#10650: view-mode inconsistencies wrt special mode-class
Date: Wed, 01 Feb 2012 09:31:44 -0500	[thread overview]
Message-ID: <jwvd39yljkd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <ozobtjgg0y.fsf@fencepost.gnu.org> (Glenn Morris's message of "Wed, 01 Feb 2012 02:38:05 -0500")

>>> 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.
>> Then again, doc-view-mode is a special mode even though the PDF code is
>> rarely if ever generated by Emacs.
> I interpret special modes as being applicable to stuff where you won't
> ever want to create an empty buffer and just start writing said stuff.
> That covers PDFs, tar files, dired buffers, etc.

Yes, my understanding of it also revolves around this idea.  And I think
that's what:

   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.)

is hinting at.  Still, this notion of "special mode" seems of little
practical value since it only seems to be usable in the above case of
setting up the default major mode of a newly created buffer.

The default global value of major-mode is not nil, so in 99% of the
cases whether a mode is special will have zero effect.  I really would
be happy to declare that a nil default value for `major-mode' is not
supported any more.  So we can simply get rid of this "special
mode-class" mess.

> Personally I think a separate variable controlling which modes are
> incompatible with view-mode would be better, but I'm not going to
> complain if the definition of special modes is extended to cover this.

I'm not sure exactly what's the idea with view-mode's use of special
mode class, but IIUC it's that we don't want to enable view-mode in
major modes that already have view-mode-like keybindings, which might
boil down to something along the lines of "major modes which use
suppress-keymap".


        Stefan





  parent reply	other threads:[~2012-02-01 14:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30  9:05 bug#10650: view-mode inconsistencies wrt special mode-class Glenn Morris
2012-01-30 20:10 ` Glenn Morris
2012-01-30 23:29   ` Juri Linkov
2012-01-31  0:38     ` Glenn Morris
2012-01-31  1:49 ` Stefan Monnier
2012-01-31  2:50   ` Glenn Morris
2012-01-31  6:17     ` Chong Yidong
2012-01-31 17:37       ` Stefan Monnier
2012-02-01  7:38         ` Glenn Morris
2012-02-01  8:32           ` Chong Yidong
2012-02-01 17:15             ` Glenn Morris
2012-02-01 14:31           ` Stefan Monnier [this message]
2012-02-01 17:12             ` Glenn Morris
2012-02-02  0:40             ` Juri Linkov
2012-02-02 18:49               ` Stefan Monnier
2012-02-02 20:03                 ` Glenn Morris
2012-02-02 21:11                   ` Juri Linkov

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd39yljkd.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=10650@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=rgm@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).