From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: occur-hook changing the current buffer Date: Wed, 22 Jun 2005 19:29:59 +0300 Organization: JURTA Message-ID: <871x6ucqat.fsf@jurta.org> References: <87slzbqd6r.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1119458654 443 80.91.229.2 (22 Jun 2005 16:44:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Jun 2005 16:44:14 +0000 (UTC) Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, miles@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 22 18:44:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dl8KV-0001F9-Gs for ged-emacs-devel@m.gmane.org; Wed, 22 Jun 2005 18:43:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dl8RA-0002mV-8w for ged-emacs-devel@m.gmane.org; Wed, 22 Jun 2005 12:50:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dl8Oh-0001jD-JB for emacs-devel@gnu.org; Wed, 22 Jun 2005 12:48:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dl8Oa-0001fS-JV for emacs-devel@gnu.org; Wed, 22 Jun 2005 12:48:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dl8OY-0001Vw-BL for emacs-devel@gnu.org; Wed, 22 Jun 2005 12:48:10 -0400 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dl8Cr-0007mY-Li; Wed, 22 Jun 2005 12:36:05 -0400 Original-Received: from mail.neti.ee (80-235-32-88-dsl.mus.estpak.ee [80.235.32.88]) by Relayhost1.neti.ee (Postfix) with ESMTP id C05F81E94; Wed, 22 Jun 2005 19:32:52 +0300 (EEST) Original-To: Juanma Barranquero In-Reply-To: (Juanma Barranquero's message of "Wed, 22 Jun 2005 10:35:30 +0200") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:39312 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39312 > I'm not putting the "blame" on the change (which is, AFAICS, > correct), only stressing that when a function runs a hook and > *afterwards* sets the not-modified flag, protecting against the > change of the buffer is not a defense against "random crap". 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. 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. -- Juri Linkov http://www.jurta.org/emacs/