emacs-devel
[Top][All Lists]
Advanced

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

Re: Fundamental mode.


From: Johan Bockgård
Subject: Re: Fundamental mode.
Date: Sat, 18 Jun 2005 17:04:45 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

I have some questions.

Richard Stallman <address@hidden> writes:

> Lute Kamstra wrote:

>> Modes derived from fundamental mode run after-change-major-mode-hook
>> twice because fundamental mode runs it unconditionally.

I don't understand this. As define-derived-mode is currently defined modes
derived from fundamental-mode do not automatically call the fundamental-mode
function.

[define-derived-mode]

      (when (eq parent 'fundamental-mode) (setq parent nil))
      [...]
      (,(or parent 'kill-all-local-variables))

> Fundamental mode does not run a mode hook because what it means is "put
> settings in their default values". But it needs to run
> after-change-major-mode-hook, since the minor modes that should apply to
> all buffers apply to these buffers too.

Which are "these buffers" that this refers to? A buffer that defaults to
fundamental-mode (as created through C-x C-f on some unknown file type or
through C-x b) does not run the `fundamental-mode' lisp function. Currently
set-buffer-major-mode does not call the major-mode function when the default
mode is fundamental-mode.

[Fset_buffer_major_mode]

      if (NILP (function) || EQ (function, Qfundamental_mode))
        return Qnil;
      [...]
      call0 (function);

-- 
Johan Bockgård





reply via email to

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