all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: "Óscar Fuentes" <ofv@wanadoo.es>
Cc: 7231@debbugs.gnu.org
Subject: bug#7231: 23.3; Don't rebuild buffer list in iswitchb-visit-buffer
Date: Mon, 18 Oct 2010 03:16:44 +0800	[thread overview]
Message-ID: <m1sk04bper.fsf@cam.ac.uk> (raw)
In-Reply-To: <87r5foy90j.fsf@telefonica.net> ("Óscar Fuentes"'s message of "Sun, 17 Oct 2010 20:22:20 +0200")

On 2010-10-18 02:22 +0800, Óscar Fuentes wrote:
> The purpose of the patch you reverted was addressing that annoyance, so
> it is easy to infer that someone indeed was annoyed by that behavior.
[...]
>
> So why don't you implement that instead of reverting a patch that
> corrects a bug? (After killing a buffer, having a list containing
> non-existent buffers is a bug, right? while seeing how the list after
> the second item is reordered is an annoyance, so you are proposing to
> re-introduce a bug for avoiding an annoyance)

On 2010-10-18 02:48 +0800, Stefan Monnier wrote:
> I don't think we should just revert.  If the fix for the old problem
> introduces a new problem, we should try and find a solution that fixes
> both problems at once.
>
>         Stefan

Sorry for being too lazy. Please try the following patch.

From d61fe17fff2926731ea317b21d647a4cf2d136f4 Mon Sep 17 00:00:00 2001
Date: Mon, 18 Oct 2010 01:44:24 +0800
Subject: [PATCH] Rebuild buffer list using buffer objects

in iswitchb-kill-buffer.

Avoid `iswitchb-make-buflist' which changes the order of matches seen
by users.
---
 lisp/iswitchb.el |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index 081897a..4cab5ee 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -1033,7 +1033,9 @@ Return the modified list with the last element prepended to it."
     (setq buf (car iswitchb-matches))
     ;; check to see if buf is non-nil.
     (if buf
-	(progn
+	(let ((bufobjs (mapcar (lambda (name)
+				 (or (get-buffer name) name))
+			       iswitchb-buflist)))
 	  (kill-buffer buf)
 
 	  ;; Check if buffer exists.  XEmacs gnuserv.el makes alias
@@ -1042,10 +1044,13 @@ Return the modified list with the last element prepended to it."
 	  (if (get-buffer buf)
 	      ;; buffer couldn't be killed.
 	      (setq iswitchb-rescan t)
-	    ;; Else `kill-buffer' succeeds so re-make the buffer list
-	    ;; taking into account packages like uniquify may rename
-	    ;; buffers
-	    (iswitchb-make-buflist iswitchb-default))))))
+	    ;; else buffer was killed
+	    (setq iswitchb-buflist
+		  (delq nil (mapcar (lambda (b)
+				      (if (bufferp b)
+					  (buffer-name b)
+					b))
+				    bufobjs))))))))
 
 ;;; VISIT CHOSEN BUFFER
 (defun iswitchb-visit-buffer (buffer)
-- 
1.7.3






  reply	other threads:[~2010-10-17 19:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-17 17:59 bug#7231: 23.3; Don't rebuild buffer list in iswitchb-visit-buffer Leo
2010-10-17 18:22 ` Óscar Fuentes
2010-10-17 19:16   ` Leo [this message]
2010-10-18 14:54     ` Stefan Monnier
2010-10-20  3:00       ` Leo
2010-10-20  4:53         ` Leo
2010-10-20  9:19           ` Óscar Fuentes
2010-10-21  7:19           ` Leo
2010-10-20 16:13         ` Stefan Monnier
2010-10-23  5:36           ` Leo
2010-10-28  1:31     ` Stefan Monnier
2010-10-17 18:48 ` Stefan Monnier

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1sk04bper.fsf@cam.ac.uk \
    --to=sdl.web@gmail.com \
    --cc=7231@debbugs.gnu.org \
    --cc=ofv@wanadoo.es \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.