Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mimsy!oddjob!hao!boulder!sunybcs!rutgers!mit-eddie!uw-beaver!tikal!sigma!uw-nsr!uw-warp!tom From: tom@uw-warp.UUCP (F. Thomas May) Newsgroups: comp.emacs Subject: Re: gnuemacs quesion: what does (put 'xxxx-mode 'mode-class 'special) do? Message-ID: <269@uw-warp.UUCP> Date: Sat, 5-Sep-87 16:01:05 EDT Article-I.D.: uw-warp.269 Posted: Sat Sep 5 16:01:05 1987 Date-Received: Sun, 6-Sep-87 09:52:11 EDT References: <740@hplabsz.HPL.HP.COM> Organization: The Warp, Seattle, WA Lines: 32 In-reply-to: mayer@hplabsz.HPL.HP.COM's message of 31 Aug 87 01:12:57 GMT In article <740@hplabsz.HPL.HP.COM> mayer@hplabsz.HPL.HP.COM (Niels Mayer) writes: a few examples of where the mode-class property is used: blackbox.el :: (put 'blackbox-mode 'mode-class 'special) buff-menu.el :: (put 'buffer-menu-mode 'mode-class 'special) dired.el :: (put 'dired-mode 'mode-class 'special) ebuff-menu.el :: (put 'Electric-buffer-menu-mode 'mode-class 'special) Can someone explain why this is done? This is not at all obvious, but if you look at the documentation for the variable default-major-mode it says: *Major mode for new buffers. Defaults to fundamental-mode. nil here means use current buffer's major mode. What it should say is: *Major mode for new buffers. Defaults to fundamental-mode. nil here means use current buffer's major mode, unless the mode-class property of the current buffer's major mode is non-nil, in which case use fundamental-mode. This just keeps newly created buffers from being in modes, such as blackbox-mode, that are useful only for specially formatted data or for doing special things. The result is that if you C-x b to a new buffer in the middle of a blackbox game to write yourself a note or something, the buffer ends up in a mode you can use for editing. -- Tom May uw-nsr!uw-warp!tom@beaver.cs.washington.edu uw-beaver!uw-nsr!uw-warp!tom