From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Add M-x occur to the menu-bar Date: 13 Feb 2004 00:19:32 +0100 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> , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Feb 12 23:31:45 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ArPN3-0006gY-00 for ; Thu, 12 Feb 2004 23:31:45 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ArPN2-0003kd-00 for ; Thu, 12 Feb 2004 23:31:45 +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 1ArPHX-0001GX-UY for emacs-devel@quimby.gnus.org; Thu, 12 Feb 2004 17:26:03 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ArPBu-0008KY-9N for emacs-devel@gnu.org; Thu, 12 Feb 2004 17:20:14 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ArPBK-00089v-Pe for emacs-devel@gnu.org; Thu, 12 Feb 2004 17:20:09 -0500 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ArPBK-00089f-00 for emacs-devel@gnu.org; Thu, 12 Feb 2004 17:19:38 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepc.post.tele.dk (Postfix) with SMTP id A6DDB2628BE; Thu, 12 Feb 2004 23:19:33 +0100 (CET) Original-To: Ted Zlatanov In-Reply-To: <4nr7x0ox3l.fsf@collins.bwh.harvard.edu> Original-Lines: 52 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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:19902 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19902 Ted Zlatanov writes: > On 12 Feb 2004, monnier@iro.umontreal.ca wrote: > > > By the way: why (make-variable-buffer-local > > 'compilation-next-error-function)? It seems completely unnecessary. > > People can make-local-variable when needed. It's generally clearer > > if they do it anyway. > > I think Kim suggested that. Indeed. I find this more logical, as it never makes sense to set the global value of compilation-next-error-function to a non-nil value. > > Also why not rename next-error to compilation-next-error, then > > default compilation-next-error-function to compilation-next-error > > and just write: > > > > (defun next-error (argp) > > (interactive ...) > > (with-current-buffer compilation-last-buffer > > (funcall compilation-next-error-function argp)) > > compilation-last-buffer is not necessarily what we want. Indeed, but Stefan has a good point here. You could define: (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) -- Kim F. Storm http://www.cua.dk