From: Juanma Barranquero <lekktu@gmail.com>
Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, miles@gnu.org
Subject: Re: occur-hook changing the current buffer
Date: Thu, 23 Jun 2005 01:37:24 +0200 [thread overview]
Message-ID: <f7ccd24b05062216375fc447b6@mail.gmail.com> (raw)
In-Reply-To: <871x6ucqat.fsf@jurta.org>
> Why setting the not-modified flag comes after running a hook? AFAIK,
> there is a convention that run-hook should be the last element in the
> function body, so users could override every default settings of the
> function, including in this particular case setting the modification flag.
The Emacs Lisp Reference makes that claim about major-mode hooks and,
less strongly, about minor-mode hooks. Certainly I'm not aware of such
a convention for non-mode hooks, like `occur-hook', and I don't think
it would make sense: hooks are set up at convenient moments, which do
not necessarily coincide with function boundaries.
> So it seems the correct fix is just to move (run-hooks 'occur-hook) down
> to be the last funcall in the `occur-1' function body.
Hey, it's funny: if I had proposed to move the code setting the
read-only and not-modified flags to before run-hooks, instead of
protecting the hook functions from changing the current buffer,
perhaps no one would have complained... :)
--
/L/e/k/t/u
next prev parent reply other threads:[~2005-06-22 23:37 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-21 2:00 occur-hook changing the current buffer Juanma Barranquero
2005-06-21 21:20 ` Stefan Monnier
2005-06-21 22:26 ` Juanma Barranquero
2005-06-22 3:34 ` Stefan Monnier
2005-06-22 3:56 ` Juanma Barranquero
2005-06-22 4:16 ` Miles Bader
2005-06-22 8:04 ` Juanma Barranquero
2005-06-22 8:11 ` Miles Bader
2005-06-22 8:35 ` Juanma Barranquero
2005-06-22 16:29 ` Juri Linkov
2005-06-22 23:37 ` Juanma Barranquero [this message]
2005-06-23 2:36 ` Miles Bader
2005-06-23 7:26 ` Juanma Barranquero
2005-06-23 13:44 ` Emilio Lopes
2005-06-23 14:45 ` Juanma Barranquero
2005-06-23 15:30 ` Jason Rumney
2005-06-23 15:42 ` Juanma Barranquero
2005-06-23 15:54 ` Lute Kamstra
2005-06-23 15:59 ` Juanma Barranquero
2005-06-24 6:53 ` Lute Kamstra
2005-06-24 8:04 ` Juanma Barranquero
2005-06-23 16:54 ` Richard M. Stallman
2005-06-24 2:45 ` Juanma Barranquero
2005-06-26 23:22 ` Juri Linkov
2005-06-27 5:46 ` Juanma Barranquero
2005-06-27 16:46 ` Richard M. Stallman
2005-06-27 20:31 ` Werner LEMBERG
2005-06-28 0:19 ` Juri Linkov
2005-06-28 4:56 ` Werner LEMBERG
2005-06-28 18:47 ` Richard M. Stallman
2005-06-29 4:40 ` Werner LEMBERG
2005-06-30 1:44 ` Richard M. Stallman
2005-06-22 11:10 ` Juanma Barranquero
2005-06-22 3:40 ` Richard M. Stallman
2005-06-22 3:56 ` Juanma Barranquero
2005-06-22 3:40 ` Richard M. Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7ccd24b05062216375fc447b6@mail.gmail.com \
--to=lekktu@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=miles@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.