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:59:16 +0100 Message-ID: References: <87k4vf1zdh.fsf@telefonica.net> <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 1273103803 22999 80.91.229.12 (5 May 2010 23:56:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 23:56:43 +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:56:41 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 1O9oSF-0002Ew-Lc for ged-emacs-devel@m.gmane.org; Thu, 06 May 2010 01:56:40 +0200 Original-Received: from localhost ([127.0.0.1]:58126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9oSE-00033F-BY for ged-emacs-devel@m.gmane.org; Wed, 05 May 2010 19:56:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9kkb-0005n8-2e for emacs-devel@gnu.org; Wed, 05 May 2010 15:59:21 -0400 Original-Received: from [140.186.70.92] (port=50226 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9kkZ-0005kj-No for emacs-devel@gnu.org; Wed, 05 May 2010 15:59:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9kkY-0002Ik-0F for emacs-devel@gnu.org; Wed, 05 May 2010 15:59:19 -0400 Original-Received: from mail-ww0-f41.google.com ([74.125.82.41]:44384) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9kkX-0002Ia-S4 for emacs-devel@gnu.org; Wed, 05 May 2010 15:59:17 -0400 Original-Received: by wwc33 with SMTP id 33so178427wwc.0 for ; Wed, 05 May 2010 12:59:16 -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=pzZrrY6ldnKWlXDbVcc7EEUBvj5uRHnXGeBWDLD3Jk4=; b=dFy73vB+m5tbTo+nhNLlxksu0AgrVu4FBWhcBQ3wpLydtY7r+9M43RfE6BP/A+UYXQ Aw3JSsFUJ609qTqHiOymRN5oueM1oWnikLYlDQDpGfky+qLgORiJg9/LPtqUBSesUYZ6 kxRvTuomSJNQy+8Udw57B5K3A6U7xfNUUZ13w= 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=ZtFYQCbGRAPwfx2PZAT8JvPBvYBfIOvtzx3FPlpAjQsJDiInmYFkOowkxgK3Wpgg3D ejZ/l1zXXgIXuFBrp3ZalLvBxT2/M7zo6EwcfXBCbFPuii2vZUTKAQqsaiRQRGxw4mMP tX3zrvZnkTjb4V8R+uSLDtHkukG2hqqBEB/s0= Original-Received: by 10.216.93.13 with SMTP id k13mr6714994wef.180.1273089556616; Wed, 05 May 2010 12:59:16 -0700 (PDT) Original-Received: by 10.216.156.139 with HTTP; Wed, 5 May 2010 12:59:16 -0700 (PDT) In-Reply-To: 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:124571 Archived-At: > (defun ido-kill-buffer-at-head () > =A0"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." > =A0(interactive) > =A0(if (not (eobp)) > =A0 =A0 =A0(delete-region (point) (line-end-position)) > =A0 =A0(let ((enable-recursive-minibuffers t) > =A0 =A0 =A0 =A0 =A0(buf (ido-name (car ido-matches))) > =A0 =A0 =A0 =A0 =A0(nextbuf (get-buffer (cadr ido-matches)))) > =A0 =A0 =A0(when buf > =A0 =A0 =A0 =A0(if (null (kill-buffer buf)) > =A0 =A0 =A0 =A0 =A0 =A0;; buffer couldn't be killed. > =A0 =A0 =A0 =A0 =A0 =A0(setq ido-rescan t) > =A0 =A0 =A0 =A0 =A0;; else `kill-buffer' succeeds so re-make the buffer l= ist > =A0 =A0 =A0 =A0 =A0;; taking into account packages like uniquify may rena= me > =A0 =A0 =A0 =A0 =A0;; buffers. > =A0 =A0 =A0 =A0 =A0(setq ido-default-item (buffer-name nextbuf)) > =A0 =A0 =A0 =A0 =A0(setq ido-text-init ido-text) > =A0 =A0 =A0 =A0 =A0(setq ido-exit 'refresh) > =A0 =A0 =A0 =A0 =A0(exit-minibuffer)))))) Robustified version. I think we are close to a fix. (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 (cadr ido-matches))) (if (and nextbuf (buffer-live-p nextbuf)) (setq nextbuf (get-buffer nextbuf)) (setq nextbuf nil)) (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. (and nextbuf (setq ido-default-item (buffer-name nextbuf))) (setq ido-text-init ido-text) (setq ido-exit 'refresh) (exit-minibuffer))))))