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: Fri, 13 Feb 2004 12:03:48 -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: <4n4qtuj4i3.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 1Argot-0008Eb-00 for ; Fri, 13 Feb 2004 18:09:39 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Argos-0007Xz-00 for ; Fri, 13 Feb 2004 18:09:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Argnx-0006Rq-7t for emacs-devel@quimby.gnus.org; Fri, 13 Feb 2004 12:08:41 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Argm1-0005q9-95 for emacs-devel@gnu.org; Fri, 13 Feb 2004 12:06:41 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Argl9-0005Q2-Q7 for emacs-devel@gnu.org; Fri, 13 Feb 2004 12:06:18 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Argkq-0004wt-Dk for emacs-devel@gnu.org; Fri, 13 Feb 2004 12:05:28 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Argkn-0002rw-00 for ; Fri, 13 Feb 2004 18:05:25 +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 ; Fri Feb 13 17:05:25 2004 Original-Received: from tzz by collins.bwh.harvard.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri Feb 13 17:05:25 2004 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 43 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:bGhwLaoqxCLPn32jJNNMmyMC8MI= 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:19918 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19918 On 13 Feb 2004, storm@cua.dk wrote: > (defun compilation-next-error (arg) > (interactive "P") > (compilation-goto-locus (compilation-next-error-locus > ;; We want to pass a number here only if > ;; we got a numeric prefix arg, not just C-u. > (and (not (consp argp)) > (prefix-numeric-value argp)) > (consp argp)))) > and > (defun next-error (arg) > (interactive "P") > (when (setq compilation-last-buffer (compilation-find-buffer)) > (with-current-buffer compilation-last-buffer > (funcall compilation-next-error-function argp)))) > And then > (defvar compilation-next-error-function 'compilation-next-error) I see. I took Stefan literally with his example. This looks fine (by now, you've written the patch for me :) and it adds a whole new dimension to the patch. A lot of other modes in Emacs could use a general-purpose function like this, and most already have it but without this "glue" to hold it all together. This makes me wonder if this should be a separate next-error.el file, instead of a patch to compile.el... That way we don't have to load compile.el, and the code presents a standard interface to other modules. What do you think? If you like next-error.el, I can write that up. If we're just modifying compile.el, I need to know if you and Stefan agree about whether the variable should be just local or buffer-local. I'm OK with either, though I think just make-local-variable makes more sense because of the reasons Stefan gave. Thanks Ted