From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: Add M-x occur to the menu-bar Date: Mon, 23 Feb 2004 15:18:05 -0500 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <4n8yitk0si.fsf@collins.bwh.harvard.edu> References: <3F69E6FF.9050702@yahoo.com> <4n8yjto16h.fsf@collins.bwh.harvard.edu> <4nisixjibl.fsf@collins.bwh.harvard.edu> <20040127230323.GB5407@fencepost> <4n7jzc919v.fsf@collins.bwh.harvard.edu> <4nn085i7nl.fsf@collins.bwh.harvard.edu> <4noese37h0.fsf@collins.bwh.harvard.edu> <4nbrodxwqm.fsf@collins.bwh.harvard.edu> <4n8yjcccvj.fsf@collins.bwh.harvard.edu> <4nwu6sp7ni.fsf@collins.bwh.harvard.edu> Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvMmC-0005qn-00 for ; Mon, 23 Feb 2004 21:34:04 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvMmB-0002PM-00 for ; Mon, 23 Feb 2004 21:34:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AvMlm-0002Eq-9w for emacs-devel@quimby.gnus.org; Mon, 23 Feb 2004 15:33:38 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AvMlA-0001xH-2R for emacs-devel@gnu.org; Mon, 23 Feb 2004 15:33:00 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AvMkP-0001BC-7L for emacs-devel@gnu.org; Mon, 23 Feb 2004 15:32:45 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1AvMjW-00086N-KW for emacs-devel@gnu.org; Mon, 23 Feb 2004 15:31:18 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by mx20.gnu.org with esmtp (Exim 4.30) id 1AvMYT-0001O5-Ju for emacs-devel@gnu.org; Mon, 23 Feb 2004 15:19:53 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AvMYR-0005tB-00 for ; Mon, 23 Feb 2004 21:19:51 +0100 Original-Received: from collins.bwh.harvard.edu ([134.174.9.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon Feb 23 20:19:51 2004 Original-Received: from tzz by collins.bwh.harvard.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon Feb 23 20:19:51 2004 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 52 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: collins.bwh.harvard.edu X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (usg-unix-v) Cancel-Lock: sha1:D+xGc265DnPk8R5HUn5VoWSvhJ8= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20139 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20139 On Sat, 14 Feb 2004, rms@gnu.org wrote: > In making a change of this kind, > think the most important question is: > > what is the criterion for deciding which buffer to use? > > What does the current proposed patch do? Note I'm discussing the updated version of this patch, which I will post to emacs-devel shortly (in both a unified and a context diff version). I follow the behavior of compile.el, which is: - is the current buffer usable? if yes, use it - else, if we were given a usable buffer, use that - else, look through all the buffer for a usable buffer - else, throw an error Now, the major difference is that I no longer use compilation-buffer-p, which also tests if a buffer is a compilation-mode buffer: ;;; test if a buffer is a compilation buffer (defsubst compilation-buffer-p (buffer) "Test if BUFFER is a compilation buffer." (with-current-buffer buffer (or compilation-shell-minor-mode compilation-minor-mode (eq major-mode 'compilation-mode) compilation-next-error-function))) I now use just next-error-buffer-p: (defsubst next-error-buffer-p (buffer) "Test if BUFFER is a next-error capable buffer." (with-current-buffer buffer next-error-function)) Which will work properly with compile.el (because compile-internal sets next-error-function), with grep.el (because it uses compile-internal), and with any other modes that set and support next-error-function (such as occur, as noted in the modified replace.el). So backwards compatibility is guaranteed. I'll mention my other modifications in the post with the patch. Ted