all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@googlemail.com>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: "Óscar Fuentes" <ofv@wanadoo.es>,
	"Chong Yidong" <cyd@stupidchicken.com>,
	emacs-devel@gnu.org
Subject: Re: PATCH: Fix IDO interaction with uniquify.el
Date: Wed, 5 May 2010 13:40:49 +0100	[thread overview]
Message-ID: <g2s20a0c1021005050540n81e8b971qa5d7da2f8fd8c464@mail.gmail.com> (raw)
In-Reply-To: <y2mf7ccd24b1005050256s84f4920fr405155ab5a1dc345@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

On 5 May 2010 10:56, Juanma Barranquero <lekktu@gmail.com> wrote:
> [......]

I take the point. I have included a patch that fix the bug in a more
general but still cleaner way. Please let me know if it works for you
in both ido and iswitchb too. Thanks.

> IMHO the virtual buffers feature is still a bit unfinished. For
> example, it doesn't support multiple "virtual buffers" for files with
> the same name on different directories. There was talk of using
> uniquify to fix that, but again, my feeling is that tying ido to
> uniquify is unwise; the virtual buffers implementation (on ido) should
> fix its own problems in a more generic way.

This is put on hold until FSF received my paper. As soon as that
happens John will push patches from his repo, one of which will also
enable C-k to kill virtual buffers.

> Just my 0,02€
>
>    Juanma

Leo

[-- Attachment #2: 0001-Fix-a-bug-in-both-ido-and-switchb-related-to-killing.patch --]
[-- Type: application/octet-stream, Size: 1932 bytes --]

From 908978b51bb0a5edf0af01b42222887ac2ce12a6 Mon Sep 17 00:00:00 2001
From: Leo <sdl.web@gmail.com>
Date: Wed, 5 May 2010 13:33:13 +0100
Subject: [PATCH] Fix a bug in both ido and switchb related to killing buffers

by rebuilding buffer list since packages like uniquify may rename
buffers.
---
 lisp/ido.el      |   11 ++++++-----
 lisp/iswitchb.el |    5 +++--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/lisp/ido.el b/lisp/ido.el
index 7cdeb70..298eca7 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3965,13 +3965,14 @@ If cursor is not at the end of the user input, delete to end of input."
     (let ((enable-recursive-minibuffers t)
 	  (buf (ido-name (car ido-matches))))
       (when buf
-	(kill-buffer buf)
-	;; Check if buffer still exists.
-	(if (get-buffer buf)
+	(if (null (kill-buffer buf))
 	    ;; buffer couldn't be killed.
 	    (setq ido-rescan t)
-	  ;; else buffer was killed so remove name from list.
-	  (setq ido-cur-list (delq buf ido-cur-list)))))))
+	  ;; else re-generate the buffer list taking into account
+	  ;; packages like uniquify may rename buffers
+	  (setq ido-text-init ido-text)
+	  (setq ido-exit 'refresh)
+	  (exit-minibuffer))))))
 
 ;;; DELETE CURRENT FILE
 (defun ido-delete-file-at-head ()
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index ea4b00d..4e939c5 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -1042,8 +1042,9 @@ 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 buffer was killed so remove name from list.
-	    (setq iswitchb-buflist  (delq buf iswitchb-buflist)))))))
+	    ;; else re-generate the buffer list taking into account
+	    ;; packages like uniquify may rename buffers
+	    (iswitchb-make-buflist iswitchb-default))))))
 
 ;;; VISIT CHOSEN BUFFER
 (defun iswitchb-visit-buffer (buffer)
-- 
1.7.0.4


  reply	other threads:[~2010-05-05 12:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-18 10:27 PATCH: Fix IDO interaction with uniquify.el Óscar Fuentes
2010-01-18 10:59 ` Juanma Barranquero
2010-01-18 11:12   ` Juanma Barranquero
2010-01-18 14:13     ` Óscar Fuentes
2010-01-18 14:32       ` Juanma Barranquero
2010-01-18 14:41         ` Óscar Fuentes
2010-01-18 15:44           ` Chong Yidong
2010-01-18 17:35             ` Óscar Fuentes
2010-01-18 17:52               ` Óscar Fuentes
2010-01-18 18:06                 ` Chong Yidong
2010-01-18 19:17                   ` Juanma Barranquero
2010-05-05  8:27                     ` Leo
2010-05-05  9:56                       ` Juanma Barranquero
2010-05-05 12:40                         ` Leo [this message]
2010-05-05 16:47                           ` Juanma Barranquero
2010-05-05 17:35                             ` Leo
2010-05-05 19:12                               ` Leo
2010-05-05 19:48                                 ` Juanma Barranquero
2010-05-06 12:54                               ` Stefan Monnier
2010-05-05 17:56                             ` Leo
2010-05-05 19:25                               ` Juanma Barranquero
2010-05-05 18:14                         ` Stefan Monnier
2010-05-05 19:09                           ` Óscar Fuentes
2010-05-05 19:50                             ` Leo
2010-05-05 19:59                               ` Leo
2010-05-05 20:36                                 ` Óscar Fuentes
2010-05-06 20:43                                 ` Juri Linkov
2010-05-05 20:27                               ` Stefan Monnier
2010-05-05 20:38                                 ` Óscar Fuentes
2010-05-06 16:56                                   ` Kim F. Storm

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=g2s20a0c1021005050540n81e8b971qa5d7da2f8fd8c464@mail.gmail.com \
    --to=sdl.web@googlemail.com \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --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.