From: Miles Bader <miles@lsi.nec.co.jp>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: occur-hook changing the current buffer
Date: Wed, 22 Jun 2005 13:16:21 +0900 [thread overview]
Message-ID: <buou0jrgh62.fsf@mctpc71.ucom.lsi.nec.co.jp> (raw)
In-Reply-To: <f7ccd24b05062120564dc4b103@mail.gmail.com> (Juanma Barranquero's message of "Wed, 22 Jun 2005 05:56:04 +0200")
Juanma Barranquero <lekktu@gmail.com> writes:
>> Once your code is fixed this is not needed any more. If the occur-hook is
>> expected to set-buffer in most/many cases, it might make sense, but
>> otherwise it doesn't.
>
> Well, I think it makes sense even if occur-hook is not expected to
> change the current buffer in most/many cases. Just one is enough, if
> it makes the user lose work.
The hook-invoker shouldn't have to protect against every possible
bizarre action that a hook _might_ perform -- it's impossible to do, and
even trying to do it adds unnecessary overhead.
I find it hard to believe that anybody would expect changing the current
buffer in a hook _not_ to cause weird problems. Returning from a
function with the current buffer changed is a fairly serious thing; you
should never do it without considering the effects on your caller. This
is not something esoteric, it's elisp programming 101.
-Miles
--
Come now, if we were really planning to harm you, would we be waiting here,
beside the path, in the very darkest part of the forest?
next prev parent reply other threads:[~2005-06-22 4:16 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 [this message]
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
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
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=buou0jrgh62.fsf@mctpc71.ucom.lsi.nec.co.jp \
--to=miles@lsi.nec.co.jp \
--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 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).