From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: next-error-last-buffer
Date: Fri, 28 May 2004 23:47:10 -0400 [thread overview]
Message-ID: <4nd64ndhdt.fsf@lifelogs.com> (raw)
In-Reply-To: 87n03sfd1x.fsf@mail.jurta.org
[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]
On Sat, 29 May 2004, juri@jurta.org wrote:
> But there is even simpler solution for the user to select a buffer
> for the next C-x `.
>
> Taking into account the recent addition of a rule in
> `next-error-find-buffer' which returns a buffer which is displayed
> only in one window with a next-error capable buffer on the selected
> frame, the user can simply remove the unwanted window with a
> next-error capable buffer (e.g. *grep* buffer in the aforementioned
> test case) from the selected frame and C-x ` will use the buffer from
> the remaining window (e.g. a patch file) even if it is not the same as
> next-error-last-buffer.
Nice, that simplifies things a lot.
> So the only change needed is to modify the rule order like you proposed,
> which could look as below:
>
> 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.
> ...
Patch attached (unified and context).
Ted
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: simple.patch --]
[-- Type: text/x-patch, Size: 2815 bytes --]
--- lisp/simple.el 2004-05-29 23:02:38.000000000 -0400
+++ /home/tzz/emacs/mine/simple.el 2004-05-29 23:04:45.000000000 -0400
@@ -92,33 +92,34 @@
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.
+;; 1. If next-error-last-buffer is set to a live buffer, use that.
+;; 2. If the current buffer is a next-error capable buffer, return it.
+;; 3. If one window on the selected frame displays such 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)
- (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
+ (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)
+ (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)))
(let ((buffers (buffer-list)))
(while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test))
(and other-buffer
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: simple.context.patch --]
[-- Type: text/x-patch, Size: 3348 bytes --]
*** lisp/simple.el Sat May 29 23:02:38 2004
--- /home/tzz/emacs/mine/simple.el Sat May 29 23:04:45 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 next-error-last-buffer is set to a live buffer, use that.
! ;; 2. If the current buffer is a next-error capable buffer, return it.
! ;; 3. If one window on the selected frame displays such 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)
! (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)
! (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)))
(let ((buffers (buffer-list)))
(while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test))
(and other-buffer
[-- Attachment #4: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2004-05-29 3:47 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-09 0:44 next-error-last-buffer Juri Linkov
2004-05-09 18:47 ` next-error-last-buffer Richard Stallman
2004-05-09 23:32 ` next-error-last-buffer Juri Linkov
2004-05-10 17:54 ` next-error-last-buffer Richard Stallman
2004-05-10 18:28 ` next-error-last-buffer Stefan Monnier
2004-05-10 23:45 ` next-error-last-buffer Juri Linkov
2004-05-11 12:23 ` next-error-last-buffer Richard Stallman
2004-05-10 23:35 ` next-error-last-buffer Juri Linkov
2004-05-11 2:19 ` next-error-last-buffer Stefan Monnier
2004-05-11 15:36 ` next-error-last-buffer Ted Zlatanov
2004-05-11 23:46 ` next-error-last-buffer Juri Linkov
2004-05-12 13:50 ` next-error-last-buffer Ted Zlatanov
2004-05-13 4:15 ` next-error-last-buffer Juri Linkov
2004-05-13 13:01 ` next-error-last-buffer Ted Zlatanov
2004-05-12 19:42 ` next-error-last-buffer Richard Stallman
2004-05-13 4:23 ` next-error-last-buffer Juri Linkov
2004-05-13 4:57 ` next-error-last-buffer Miles Bader
2004-05-13 5:17 ` next-error-last-buffer Stefan Monnier
2004-05-13 5:34 ` next-error-last-buffer Juri Linkov
2004-05-13 7:28 ` next-error-last-buffer Miles Bader
2004-05-13 12:54 ` next-error-last-buffer Ted Zlatanov
2004-05-14 9:21 ` next-error-last-buffer Richard Stallman
2004-05-14 14:58 ` next-error-last-buffer Ted Zlatanov
2004-05-15 8:21 ` next-error-last-buffer Juri Linkov
2004-05-15 18:34 ` next-error-last-buffer Richard Stallman
2004-05-15 8:53 ` next-error-last-buffer Richard Stallman
2004-05-24 8:46 ` next-error-last-buffer Juri Linkov
2004-05-24 14:16 ` next-error-last-buffer Ted Zlatanov
2004-05-25 20:09 ` next-error-last-buffer Juri Linkov
2004-05-26 13:49 ` next-error-last-buffer Ted Zlatanov
2004-05-27 12:46 ` next-error-last-buffer Richard Stallman
2004-05-28 15:38 ` next-error-last-buffer Ted Zlatanov
2004-05-28 21:07 ` next-error-last-buffer Juri Linkov
2004-05-29 3:47 ` Ted Zlatanov [this message]
2004-05-30 14:30 ` next-error-last-buffer Richard Stallman
2004-06-01 17:41 ` next-error-last-buffer Ted Zlatanov
2004-06-01 17:57 ` next-error-last-buffer Ted Zlatanov
2004-06-02 17:36 ` next-error-last-buffer Richard Stallman
2004-06-03 15:21 ` next-error-last-buffer Ted Zlatanov
2004-06-04 2:03 ` next-error-last-buffer Richard Stallman
2004-06-07 16:18 ` next-error-last-buffer Ted Zlatanov
2004-06-08 20:31 ` next-error-last-buffer Richard Stallman
2004-06-30 18:38 ` next-error-last-buffer Ted Zlatanov
2004-07-01 17:14 ` next-error-last-buffer Richard Stallman
2004-05-25 16:06 ` next-error-last-buffer Richard Stallman
2004-05-25 20:14 ` next-error-last-buffer Juri Linkov
2004-05-26 13:56 ` next-error-last-buffer Ted Zlatanov
2004-05-27 21:55 ` next-error-last-buffer Juri Linkov
2004-05-27 23:53 ` next-error-last-buffer Richard Stallman
2004-05-28 15:29 ` next-error-last-buffer Stefan Monnier
2004-05-28 21:55 ` next-error-last-buffer Juri Linkov
2004-05-29 3:35 ` next-error-last-buffer Ted Zlatanov
2004-05-29 17:03 ` next-error-last-buffer Richard Stallman
2004-05-25 20:22 ` next-error-last-buffer Juri Linkov
2004-05-29 1:44 ` next-error-last-buffer Richard Stallman
2004-05-29 23:10 ` next-error-last-buffer Kim F. Storm
2004-05-30 19:41 ` next-error-last-buffer Richard Stallman
2004-05-31 6:39 ` next-error-last-buffer Werner LEMBERG
2004-05-31 7:20 ` next-error-last-buffer Juanma Barranquero
2004-06-01 17:52 ` next-error-last-buffer Ted Zlatanov
2004-06-01 21:33 ` next-error-last-buffer Kim F. Storm
2004-06-02 17:36 ` next-error-last-buffer Richard Stallman
2004-06-03 23:42 ` next-error-last-buffer Juri Linkov
2004-06-05 13:48 ` next-error-last-buffer Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4nd64ndhdt.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).