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: Wed, 14 Apr 2004 14:04:56 -0400 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: <4nzn9ewi47.fsf@lifelogs.com> 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 1BDp6E-0004l2-00 for ; Wed, 14 Apr 2004 20:27:02 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BDp6E-0005Da-00 for ; Wed, 14 Apr 2004 20:27:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BDp0D-0006Z6-Ke for emacs-devel@quimby.gnus.org; Wed, 14 Apr 2004 14:20:49 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BDoz8-0006KX-SQ for emacs-devel@gnu.org; Wed, 14 Apr 2004 14:19:42 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BDoyb-00063v-CF for emacs-devel@gnu.org; Wed, 14 Apr 2004 14:19:40 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BDoya-00063M-EQ for emacs-devel@gnu.org; Wed, 14 Apr 2004 14:19:08 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BDoyZ-0001LP-00 for ; Wed, 14 Apr 2004 20:19:07 +0200 Original-Received: from asimov.bwh.harvard.edu ([134.174.9.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Apr 2004 20:19:07 +0200 Original-Received: from tzz by asimov.bwh.harvard.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Apr 2004 20:19:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 85 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: asimov.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 (gnu/linux) Cancel-Lock: sha1:76VvzENEor6jPPzZ8Kyst6EYzvk= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 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:21636 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21636 On 07 Apr 2004, monnier@iro.umontreal.ca wrote: >> (select-window outwin) >> (goto-char (point-max)))) >> ;; Make it so the next C-x ` will use this buffer. >> - (setq compilation-last-buffer outbuf))) >> + (setq compilation-last-buffer outbuf) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > duplicate with the one below. Fixed. + (setq next-error-last-buffer outbuf) + (setq compilation-last-buffer outbuf) + (with-current-buffer outbuf + ;; note that compilation-next-error-function is for interfacing + ;; with the next-error function in simple.el, and it's only + ;; coincidentally named similarly to compilation-next-error + (setq next-error-function 'compilation-next-error-function)))) > > Shouldn't we get rid of compilation-last-buffer? I think that would be OK. Any dissenters? :) > And (setq next-error-function 'compilation-next-error-function) > should be in compilation-setup. Done. >> +;;; test if a buffer is a compilation buffer, using compilation-buffer-internal-p >> (defsubst compilation-buffer-p (buffer) >> - (local-variable-p 'compilation-locs buffer)) >> + "Test if BUFFER is a compilation buffer." >> + (with-current-buffer buffer >> + (compilation-buffer-internal-p))) >> + >> +;;; test if a buffer is a compilation buffer, assuming we're in the buffer >> +(defsubst compilation-buffer-internal-p () >> + "Test if inside a compilation buffer." >> + (local-variable-p 'compilation-locs (current-buffer))) > > Huh? This looks like a complicated way to do thing. Just make > the BUFFER argument optional instead (local-variable-p will > DTRT). Done, thanks. > >> +(defun compilation-next-error-function (argp &optional reset) > > I'd use a special value like `first' for ARGP instead of adding > a RESET argument. BTW, what does `argp' stand for and wouldn't > you have to update the body since it still presumably refers to the old > N argument name instead? With RESET, the function acts as if first-error was called and then next-error N was called. Good catch on ARGP, that was my mistake. > >> + (setq next-error-function 'occur-next-error)) > > This should be placed in occur-mode. It's in replace.el, where occur-mode is defined. >> +(defvar next-error-last-buffer nil >> +(defvar next-error-function nil >> +(make-variable-buffer-local 'next-error-function) >> +(defsubst next-error-buffer-p (buffer &optional extra-test) >> +(defun next-error-find-buffer (&optional other-buffer extra-test) >> +(defun next-error (argp &optional reset) >> +(defalias 'goto-next-locus 'next-error) >> +(defalias 'next-match 'next-error) >> +(define-key ctl-x-map "`" 'next-error) >> +(defun previous-error (n) >> +(defun first-error (n) > > Should we also move next-error-no-select and previous-error-no-select ? Done. Thank you very much for the thorough review. All the changes are in the latest patch I just posted. Ted