unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: emacs-devel <emacs-devel@gnu.org>
Subject: define-derived-mode runs parent mode hook after evaluating body
Date: Fri, 20 Jul 2007 11:00:50 +0200	[thread overview]
Message-ID: <46A079C2.4000802@gmx.at> (raw)

A subtle bug with `define-derived-mode' I just met with
`change-log-mode'.  The latter's definition goes as ...

(define-derived-mode change-log-mode text-mode "Change Log"
   "..."
   (setq left-margin 8
	fill-column 74
         ...

...but in my .emacs I have:

(add-hook
  'text-mode-hook
  '(lambda () (setq fill-column 72)))

Consequently, my Change Log buffers have a `fill-column' of 72 which is
not really desirable.  I obviously don't have any intention to check
which of the major modes I eventually use derive from text-mode and add
the appropriate hooks there.

Is it really useful/needed to delay the hook of the parent mode in a
derived mode until after evaluating the body?

             reply	other threads:[~2007-07-20  9:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20  9:00 martin rudalics [this message]
2007-07-20 16:09 ` define-derived-mode runs parent mode hook after evaluating body Stefan Monnier
2007-07-21 16:54   ` Richard Stallman
2007-07-22  3:08     ` Stefan Monnier
2007-07-22 18:37       ` Richard Stallman
2007-07-20 16:11 ` Stefan Monnier
2007-07-21  9:21   ` martin rudalics
2007-07-22 18:36     ` Stefan Monnier
2007-07-22 21:22       ` martin rudalics

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=46A079C2.4000802@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@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).