From: martin rudalics <rudalics@gmx.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: define-derived-mode runs parent mode hook after evaluating body
Date: Sun, 22 Jul 2007 23:22:20 +0200 [thread overview]
Message-ID: <46A3CA8C.2090908@gmx.at> (raw)
In-Reply-To: <jwvy7h8thhs.fsf-monnier+emacs@gnu.org>
>>(add-hook
>> 'text-mode-hook
>> '(lambda ()
>> (unless (and (local-variable-p 'fill-column)
>> (not (equal fill-column
>> (default-value 'fill-column))))
>> (setq fill-column 72))))
>
>
> Other than spurious quote in front of the lambda, this looks fine to me.
> More specifically it says in Elisp basically the same as what you said above
> in English, so it seems to be The Right Thing.
It works when the derived mode sets a buffer-local variable. I wouldn't
know what to do for normal variables though - maybe a non-problem.
>>but this strikes me as inconvenient, ugly, and maybe faulty.
>
>
> The problem is that if what you want to do is "always add 4 to fill-column",
> the current behavior allows you to do that whereas your suggestion to run
> the parent mode early would preclude it.
Hmmm .... the parent mode runs early in any case. Do we really want its
hooks to add 4 to something defined in the body of the derived mode?
What if a hook of the derived mode wants to add another four? Do we add
eight?
martin, who never wanted to "suggest" anything in this context.
prev parent reply other threads:[~2007-07-22 21:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-20 9:00 define-derived-mode runs parent mode hook after evaluating body martin rudalics
2007-07-20 16:09 ` 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 [this message]
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=46A3CA8C.2090908@gmx.at \
--to=rudalics@gmx.at \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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).