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: next-error-last-buffer Date: Tue, 01 Jun 2004 13:57:46 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <4n8yf76u05.fsf@lifelogs.com> References: <871xluig40.fsf@mail.jurta.org> <87u0y6jjq9.fsf@mail.jurta.org> <4nwu31j4ff.fsf@lifelogs.com> <87zn7wgtel.fsf@mail.jurta.org> <4nu0y0ef4z.fsf@lifelogs.com> <87n03sfd1x.fsf@mail.jurta.org> <4nd64ndhdt.fsf@lifelogs.com> <4nllj76uqz.fsf@lifelogs.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1086113773 15997 80.91.224.253 (1 Jun 2004 18:16:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 1 Jun 2004 18:16:13 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Jun 01 20:16:03 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 1BVDnv-0004oh-00 for ; Tue, 01 Jun 2004 20:16:03 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BVDnu-000147-00 for ; Tue, 01 Jun 2004 20:16:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BVDo9-0004xc-Lk for emacs-devel@quimby.gnus.org; Tue, 01 Jun 2004 14:16:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BVDo1-0004xN-RF for emacs-devel@gnu.org; Tue, 01 Jun 2004 14:16:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BVDo1-0004xB-7u for emacs-devel@gnu.org; Tue, 01 Jun 2004 14:16:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BVDo1-0004x8-2T for emacs-devel@gnu.org; Tue, 01 Jun 2004 14:16:09 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BVDn4-0002F8-Tw for emacs-devel@gnu.org; Tue, 01 Jun 2004 14:15:11 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BVDn4-0008SP-00 for ; Tue, 01 Jun 2004 20:15:10 +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 ; Tue, 01 Jun 2004 20:15:10 +0200 Original-Received: from tzz by asimov.bwh.harvard.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Jun 2004 20:15:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 169 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.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:gjka/ksWWh79pVu5ZkcB7GCQVCU= 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:24356 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24356 --=-=-= On Tue, 01 Jun 2004, tzz@lifelogs.com wrote: > Sorry. Consider the attached patch, which does the right thing (the > first 3 rules you quoted from Juri's e-mail are implemented). Yes, the patch would be nice too :) Ted --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=simple.patch 95,97c95,97 < ;; 1. If the current buffer is a next-error capable buffer, return it. < ;; 2. If one window on the selected frame displays such buffer, return it. < ;; 3. If next-error-last-buffer is set to a live buffer, use that. --- > ;; 1. If one window on the selected frame displays such buffer, return it. > ;; 2. If next-error-last-buffer is set to a live buffer, use that. > ;; 3. If the current buffer is a next-error capable buffer, return it. 101,121c101,122 < (if (and (not other-buffer) < (next-error-buffer-p (current-buffer) extra-test)) < ;; The current buffer is a next-error capable buffer. < (current-buffer) < (or < (let ((window-buffers < (delete-dups < (delq nil < (mapcar (lambda (w) < (and (next-error-buffer-p (window-buffer w) extra-test) < (window-buffer w))) < (window-list)))))) < (if other-buffer < (setq window-buffers (delq (current-buffer) window-buffers))) < (if (eq (length window-buffers) 1) < (car window-buffers))) < (if (and next-error-last-buffer (buffer-name next-error-last-buffer) < (next-error-buffer-p next-error-last-buffer extra-test) < (or (not other-buffer) (not (eq next-error-last-buffer < (current-buffer))))) < next-error-last-buffer --- > (or > (let ((window-buffers > (delete-dups > (delq nil > (mapcar (lambda (w) > (and (next-error-buffer-p (window-buffer w) extra-test) > (window-buffer w))) > (window-list)))))) > (if other-buffer > (setq window-buffers (delq (current-buffer) window-buffers))) > (if (eq (length window-buffers) 1) > (car window-buffers))) > (if (and next-error-last-buffer > (buffer-name next-error-last-buffer) > (next-error-buffer-p next-error-last-buffer extra-test) > (or (not other-buffer) > (not (eq next-error-last-buffer (current-buffer))))) > next-error-last-buffer > (if (and (not other-buffer) > (next-error-buffer-p (current-buffer) extra-test)) > ;; The current buffer is a next-error capable buffer. > (current-buffer)))) 136c137 < (error "No next-error capable buffer found!")))))))) --- > (error "No next-error capable buffer found!"))))) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=simple.context.patch *** lisp/simple.el Tue Jun 1 13:35:21 2004 --- /home/tzz/emacs/mine/simple.el Tue Jun 1 13:53:43 2004 *************** *** 92,124 **** next-error-function))) ;; Return a next-error capable buffer according to the following rules: ! ;; 1. If the current buffer is a next-error capable buffer, return it. ! ;; 2. If one window on the selected frame displays such buffer, return it. ! ;; 3. If next-error-last-buffer is set to a live buffer, use that. ;; 4. Otherwise, look for a next-error capable buffer in a buffer list. ;; 5. Signal an error if there are none. (defun next-error-find-buffer (&optional other-buffer extra-test) ! (if (and (not other-buffer) ! (next-error-buffer-p (current-buffer) extra-test)) ! ;; The current buffer is a next-error capable buffer. ! (current-buffer) ! (or ! (let ((window-buffers ! (delete-dups ! (delq nil ! (mapcar (lambda (w) ! (and (next-error-buffer-p (window-buffer w) extra-test) ! (window-buffer w))) ! (window-list)))))) ! (if other-buffer ! (setq window-buffers (delq (current-buffer) window-buffers))) ! (if (eq (length window-buffers) 1) ! (car window-buffers))) ! (if (and next-error-last-buffer (buffer-name next-error-last-buffer) ! (next-error-buffer-p next-error-last-buffer extra-test) ! (or (not other-buffer) (not (eq next-error-last-buffer ! (current-buffer))))) ! next-error-last-buffer (let ((buffers (buffer-list))) (while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test)) (and other-buffer --- 92,125 ---- next-error-function))) ;; Return a next-error capable buffer according to the following rules: ! ;; 1. If one window on the selected frame displays such buffer, return it. ! ;; 2. If next-error-last-buffer is set to a live buffer, use that. ! ;; 3. If the current buffer is a next-error capable buffer, return it. ;; 4. Otherwise, look for a next-error capable buffer in a buffer list. ;; 5. Signal an error if there are none. (defun next-error-find-buffer (&optional other-buffer extra-test) ! (or ! (let ((window-buffers ! (delete-dups ! (delq nil ! (mapcar (lambda (w) ! (and (next-error-buffer-p (window-buffer w) extra-test) ! (window-buffer w))) ! (window-list)))))) ! (if other-buffer ! (setq window-buffers (delq (current-buffer) window-buffers))) ! (if (eq (length window-buffers) 1) ! (car window-buffers))) ! (if (and next-error-last-buffer ! (buffer-name next-error-last-buffer) ! (next-error-buffer-p next-error-last-buffer extra-test) ! (or (not other-buffer) ! (not (eq next-error-last-buffer (current-buffer))))) ! next-error-last-buffer ! (if (and (not other-buffer) ! (next-error-buffer-p (current-buffer) extra-test)) ! ;; The current buffer is a next-error capable buffer. ! (current-buffer)))) (let ((buffers (buffer-list))) (while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test)) (and other-buffer *************** *** 133,139 **** (if other-buffer (message "This is the only next-error capable buffer.")) (current-buffer))) ! (error "No next-error capable buffer found!")))))))) (defun next-error (arg &optional reset) "Visit next next-error message and corresponding source code. --- 134,140 ---- (if other-buffer (message "This is the only next-error capable buffer.")) (current-buffer))) ! (error "No next-error capable buffer found!"))))) (defun next-error (arg &optional reset) "Visit next next-error message and corresponding source code. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--