From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: PATCH: Fix IDO interaction with uniquify.el Date: Wed, 5 May 2010 20:50:12 +0100 Message-ID: References: <87k4vf1zdh.fsf@telefonica.net> <87d417h0z6.fsf@stupidchicken.com> <87tyujz57h.fsf@telefonica.net> <87ockrz4eu.fsf@telefonica.net> <87pr57uw25.fsf@stupidchicken.com> <878w7y6u92.fsf@telefonica.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273103449 22090 80.91.229.12 (5 May 2010 23:50:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 23:50:49 +0000 (UTC) Cc: Juanma Barranquero , Chong Yidong , emacs-devel@gnu.org, Stefan Monnier , Leo To: =?ISO-8859-1?Q?=D3scar_Fuentes?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 06 01:50:47 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9oMY-0008On-6I for ged-emacs-devel@m.gmane.org; Thu, 06 May 2010 01:50:46 +0200 Original-Received: from localhost ([127.0.0.1]:41568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9oMX-0007FY-C9 for ged-emacs-devel@m.gmane.org; Wed, 05 May 2010 19:50:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9kib-0003Gu-S7 for emacs-devel@gnu.org; Wed, 05 May 2010 15:57:18 -0400 Original-Received: from [140.186.70.92] (port=53670 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9kiZ-0002Wj-Lt for emacs-devel@gnu.org; Wed, 05 May 2010 15:57:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9kbl-0000Mo-Fd for emacs-devel@gnu.org; Wed, 05 May 2010 15:50:17 -0400 Original-Received: from mail-ww0-f41.google.com ([74.125.82.41]:43291) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9kbl-0000MV-As for emacs-devel@gnu.org; Wed, 05 May 2010 15:50:13 -0400 Original-Received: by wwc33 with SMTP id 33so171373wwc.0 for ; Wed, 05 May 2010 12:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=aKk5BTpfgn4wy8bRKyTilB81FZpkDENHtl/LXA8Wjh4=; b=JHvqSg5pR8MYiL8kPBwKFGxJb90MSLLa9xt+XJzyWXuPcgEQ2mvTe8itu5ghtbFHRF FmNtPvn99MRDgzdLtXKK+Rvm17dcdc99VmcILcYucVFeX/pESpHRakWxsV/c5/kq0BCU ZfWrVPKazYq0M0W+UdE6w9O6O7lL60lNxSE8M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MKZJlJRQslQcvpiSInxh9zqfoJ6V3U4McGFSGAKxXHRwE7PbMfE96My48+bIpuaJCb w0/QrtzYE+6RHZ8cdJUfLRI3GKdEheIyg4Kg6ehPLin7V9qil0j4zCiXK22eWjojDUJg Qks7rgFxsEyXEqCgi2ABNw/k/v5TI2zXUj0VY= Original-Received: by 10.216.160.12 with SMTP id t12mr2267722wek.154.1273089012252; Wed, 05 May 2010 12:50:12 -0700 (PDT) Original-Received: by 10.216.156.139 with HTTP; Wed, 5 May 2010 12:50:12 -0700 (PDT) In-Reply-To: <878w7y6u92.fsf@telefonica.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124570 Archived-At: On 5 May 2010 20:09, =D3scar Fuentes wrote: > It was installed long time ago. > >> BTW, I don't understand why his patch changes (defvar ido-cur-list) >> and (defvar ido-choice-list) into (defvar ido-cur-list nil) >> and (defvar ido-choice-list nil). =A0These changes aren't necessarily ba= d, >> but I suspect the change is either unneeded or hiding a bug. > > I was unable to obtain a solid insight on how ido managed the list of > buffers. It looked quite complicated and dispersed to me. So tried some > code, tested (with Juanma's help) and submitted the patch. The last > patch posted by Leo looks great because it is so simple, but IIRC I > considered some simple ways of fixing the bug and they introduced > strange bugs and annoyances(*), so maybe my fix doesn't contain so much > gratuitous code at it seems, or maybe Leo is right and I was unlucky > with my attempts at fixing the bug with a simple change. > > * One of those annoyances was changing the "next" item on the list of > =A0buffers once you kill the first one, something that I find > =A0confusing. Right now ido may change the order of the buffers after a > =A0kill, but the previous second item appears as the first item on the > =A0new list. > Could you try this function to see if it does what you want? Also let me know what is missing. I will try fix it today. Thanks. (defun ido-kill-buffer-at-head () "Kill the buffer at the head of `ido-matches'. If cursor is not at the end of the user input, delete to end of input." (interactive) (if (not (eobp)) (delete-region (point) (line-end-position)) (let ((enable-recursive-minibuffers t) (buf (ido-name (car ido-matches))) (nextbuf (get-buffer (cadr ido-matches)))) (when buf (if (null (kill-buffer buf)) ;; buffer couldn't be killed. (setq ido-rescan t) ;; else `kill-buffer' succeeds so re-make the buffer list ;; taking into account packages like uniquify may rename ;; buffers. (setq ido-default-item (buffer-name nextbuf)) (setq ido-text-init ido-text) (setq ido-exit 'refresh) (exit-minibuffer)))))) Leo