From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Add M-x occur to the menu-bar Date: 07 Apr 2004 17:50:30 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: 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 1BBL64-0008KU-00 for ; Thu, 08 Apr 2004 00:00:36 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BBL64-0001pm-00 for ; Thu, 08 Apr 2004 00:00:36 +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 1BBL0g-0000g5-7P for emacs-devel@quimby.gnus.org; Wed, 07 Apr 2004 17:55:02 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BBKy3-0007rn-Bd for emacs-devel@gnu.org; Wed, 07 Apr 2004 17:52:19 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BBKwu-0006yp-6K for emacs-devel@gnu.org; Wed, 07 Apr 2004 17:51:39 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BBKwM-0006MA-SQ for emacs-devel@gnu.org; Wed, 07 Apr 2004 17:50:34 -0400 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 45AF6211CB; Wed, 7 Apr 2004 17:50:32 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 70FAE8B4C3; Wed, 7 Apr 2004 17:50:30 -0400 (EDT) Original-To: Ted Zlatanov In-Reply-To: <4nwu4r33k8.fsf@b2-15-1.bwh.harvard.edu> Original-Lines: 62 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.9, requis 5, BAYES_00 -4.90) 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:21323 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21323 > (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. > + (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? And (setq next-error-function 'compilation-next-error-function) should be in compilation-setup. > +;;; 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). > +(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? > + (setq next-error-function 'occur-next-error)) This should be placed in occur-mode. > +(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 ? Stefan