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: Changing occur-hook to occur-functions Date: Tue, 05 Jul 2005 08:27:35 +0300 Organization: JURTA Message-ID: <87oe9hnah4.fsf@jurta.org> References: <874qbbnrzy.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1120543689 5313 80.91.229.2 (5 Jul 2005 06:08:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2005 06:08:09 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 05 08:08:09 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DpgbA-00023s-A2 for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2005 08:08:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpgcP-0004GL-5i for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2005 02:09:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DpgVD-00025P-D8 for emacs-devel@gnu.org; Tue, 05 Jul 2005 02:01:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DpgV6-00022b-Fo for emacs-devel@gnu.org; Tue, 05 Jul 2005 02:01:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpgV5-0001o8-9i for emacs-devel@gnu.org; Tue, 05 Jul 2005 02:01:43 -0400 Original-Received: from [194.126.101.98] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DpgNk-0005Cu-8n for emacs-devel@gnu.org; Tue, 05 Jul 2005 01:54:08 -0400 Original-Received: from mail.neti.ee (80-235-32-204-dsl.mus.estpak.ee [80.235.32.204]) by Relayhost2.neti.ee (Postfix) with ESMTP id 1DE131EA6; Tue, 5 Jul 2005 08:47:53 +0300 (EEST) Original-To: Juanma Barranquero In-Reply-To: (Juanma Barranquero's message of "Mon, 4 Jul 2005 10:00:44 +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:40394 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40394 >> Why do you think it is a mistake? It doesn't work with `occur-mode-hook'. > > Neither does with `occur-hook'. You have to add > > (lambda () (occur-rename-buffer t)) That's exactly what I tried. With the latest CVS state (add-hook 'occur-hook (lambda () (occur-rename-buffer t))) renames the *Occur* buffer to `*Occur: original-buffer-name*', but (add-hook 'occur-mode-hook (lambda () (occur-rename-buffer t))) produces a name with empty original-buffer-name (i.e. just `*Occur: *'), because `occur-1' sets the value of `occur-revert-arguments' after running `occur-mode-hook', but before `occur-hook'. > to `occur-mode-hook' for it to work. That's why I proposed to add a > new parameter INTERACTIVE-P to `occur-rename-buffer' so it can be just > dropped onto the hook. This would be good, but without adding original-buffer-name to the buffer name, to produce a unique buffer name, the user can simply put (add-hook 'occur-mode-hook 'rename-uniquely) -- Juri Linkov http://www.jurta.org/emacs/