From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#11008: 24.0.94; ido-mode: Setting ido-completion-buffer to nil is broken Date: Wed, 14 Mar 2012 00:56:07 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1331657846 11089 80.91.229.3 (13 Mar 2012 16:57:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Mar 2012 16:57:26 +0000 (UTC) Cc: 11008@debbugs.gnu.org To: Anmol Khirbat Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 13 17:57:22 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S7V2F-0003G8-GN for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Mar 2012 17:57:19 +0100 Original-Received: from localhost ([::1]:50751 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7V2F-0002uk-08 for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Mar 2012 12:57:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7V27-0002u7-3O for bug-gnu-emacs@gnu.org; Tue, 13 Mar 2012 12:57:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7V21-0000K8-FG for bug-gnu-emacs@gnu.org; Tue, 13 Mar 2012 12:57:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7V21-0000Js-9a for bug-gnu-emacs@gnu.org; Tue, 13 Mar 2012 12:57:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S7VUz-0003Hv-N5 for bug-gnu-emacs@gnu.org; Tue, 13 Mar 2012 13:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Mar 2012 17:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11008 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11008-submit@debbugs.gnu.org id=B11008.133165959212598 (code B ref 11008); Tue, 13 Mar 2012 17:27:01 +0000 Original-Received: (at 11008) by debbugs.gnu.org; 13 Mar 2012 17:26:32 +0000 Original-Received: from localhost ([127.0.0.1]:49262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S7VUV-0003H8-MP for submit@debbugs.gnu.org; Tue, 13 Mar 2012 13:26:32 -0400 Original-Received: from mail-iy0-f172.google.com ([209.85.210.172]:40665) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S7VUI-0003Gq-Rv for 11008@debbugs.gnu.org; Tue, 13 Mar 2012 13:26:29 -0400 Original-Received: by iazz13 with SMTP id z13so962595iaz.3 for <11008@debbugs.gnu.org>; Tue, 13 Mar 2012 09:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=ljpE607r2IRUTvu2AxkHrTVTJuWGS/7JXYX6WMFGTAc=; b=eu1jTwRLBNi8Q4HXjc5+Hf7IfPinc2Z+feyGFRok8X4rd/giMvrxuCVWrptveibRsN Nh7+zjwSJ3xxFwaonmoZQteSSuRUviFPB+Bvi2S2PTfhP1Y6IE4zuFgbJONLYKaCsfjF njFJl8uKi3s8X9DpGPPjT3eWZmEzq5N9qtLRggWJ5YYKRoOLwI0iUxMbQbwbyBzDAgHr 0PpycG10Vv0/jrznQWxFqm6d6tvBZEtqitWf1gw8tR/Y31lfBjHRBdeLLJxhxZ160ZVD wZ0+lkgj+7peVgktm4Y7QOGq5rNKkCxb5r4uNEhA/xA/M/3kR7hO9emF5hWLGqMIgyAJ EXeA== Original-Received: by 10.50.85.130 with SMTP id h2mr6013114igz.47.1331657781157; Tue, 13 Mar 2012 09:56:21 -0700 (PDT) Original-Received: from Victoria.local ([123.114.34.29]) by mx.google.com with ESMTPS id cv10sm994073igc.13.2012.03.13.09.56.15 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Mar 2012 09:56:20 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAMFBMVEUaFRZLMy1dTENxVzKQ WiCrXQ97cmO/dSqSh3akjGTApXy5sJ7Sxo/Sz8Xo6eP9//xJbkruAAAAAWJLR0QAiAUdSAAAAAlw SFlzAAACxQAAAsUBidZ/7wAAAAd0SU1FB9cBBwMJOwHXewoAAAIBSURBVCjPVdNBiNNAFADQ6J4F x3hThHZBBC+WCFI8SS0iezRDcMHLHkLAg6gJH/fgYQ9xYlj2sLK4KHgqCgXFhda2Idmr4kkQPZQ0 nkQMbTypbMmMM2m7ZgYSmMef/5OZPwo7HFnx3uKPcmj0Dht1LWZJ+Hvr7dIFZXRUwl9VRTuuKDJ+ U44gjscknK4hhJaCkYRsWjmBtLqXlJAG2wipNe18OZJu1BBq1E8xafl4s6Jq2mUZGftU1y7CCxnp FVUDWJXx4C66BKBnErbuoaYNtoRTu6EZBsCbMn7W+5qOAR6WvxNOby9jHWC9hAf3n304CdiAByXs 3Nh9roLDkyb/sWV712vYwaLSAn8CPMHIAAzOPDKP2COAFm4Y4ODVWc6xG7KXsN7UeUJjjimx2uwd gCgNhr0i8C/xyCD5CiCKAMY3Bf5oDzx//w/fimscdcAZU2jv9sedx6+nYPPFIoWI/GK6QZ+EFGOR ErAjCnV3vPZ7XqlTIMbOLY7fLcvvmT7rXNWaGDexIY44N12TG2PDp7vqyl57dnCeuWwyNpnEURxk fTbDYeBnKRn4oejPYI4sH6WviBumEZ/GxX4X/x6EcURFZ7E071bjQGAxpcOAEOJuTiroDEea5Szv rVWLYfl7ZiQwSUToxrkux7OLixAWGz22+HIyWTRYcVfomOwvzusfjtVIGgLHf3MAAAAASUVORK5C YII= In-Reply-To: (Anmol Khirbat's message of "Tue, 13 Mar 2012 00:58:03 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (Mac OS X 10.6.8) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57769 Archived-At: Could you try the following patch? Thanks. === modified file 'lisp/ido.el' --- lisp/ido.el 2012-02-04 00:59:58 +0000 +++ lisp/ido.el 2012-03-13 16:47:52 +0000 @@ -1722,8 +1722,8 @@ (unless (and ido-enable-tramp-completion (string-match "\\`/[^/]*@\\'" dir)) (setq dir (ido-final-slash dir t)))) - (if (get-buffer ido-completion-buffer) - (kill-buffer ido-completion-buffer)) + (when (and ido-completion-buffer (get-buffer ido-completion-buffer)) + (kill-buffer ido-completion-buffer)) (cond ((equal dir ido-current-directory) nil) @@ -1736,8 +1736,8 @@ (t (ido-trace "cd" dir) (setq ido-current-directory dir) - (if (get-buffer ido-completion-buffer) - (kill-buffer ido-completion-buffer)) + (when (and ido-completion-buffer (get-buffer ido-completion-buffer)) + (kill-buffer ido-completion-buffer)) (setq ido-directory-nonreadable (ido-nonreadable-directory-p dir)) (setq ido-directory-too-big (and (not ido-directory-nonreadable) (ido-directory-too-big-p dir))) @@ -1982,8 +1982,8 @@ (setq ido-text-init nil)) ido-completion-map nil hist)))) (ido-trace "read-from-minibuffer" ido-final-text) - (if (get-buffer ido-completion-buffer) - (kill-buffer ido-completion-buffer)) + (when (and ido-completion-buffer (get-buffer ido-completion-buffer)) + (kill-buffer ido-completion-buffer)) (ido-trace "\n_EXIT_" ido-exit) @@ -3837,8 +3837,8 @@ (defun ido-choose-completion-string (choice &rest ignored) (when (ido-active) ;; Insert the completion into the buffer where completion was requested. - (if (get-buffer ido-completion-buffer) - (kill-buffer ido-completion-buffer)) + (when (and ido-completion-buffer (get-buffer ido-completion-buffer)) + (kill-buffer ido-completion-buffer)) (cond ((ido-active t) ;; ido-use-merged-list (setq ido-current-directory "" @@ -3857,7 +3857,8 @@ "Show possible completions in a *File Completions* buffer." (interactive) (setq ido-rescan nil) - (let ((temp-buf (get-buffer ido-completion-buffer)) + (let ((temp-buf (and ido-completion-buffer + (get-buffer ido-completion-buffer))) display-it full-list) (if (and (eq last-command this-command) temp-buf) ;; scroll buffer @@ -3876,37 +3877,37 @@ (scroll-other-window)) (set-buffer buf)) (setq display-it t)) - (if display-it - (with-output-to-temp-buffer ido-completion-buffer - (let ((completion-list (sort - (cond - (ido-directory-too-big - (message "Reading directory...") - (setq ido-directory-too-big nil - ido-ignored-list nil - ido-cur-list (ido-all-completions) - ido-rescan t) - (ido-set-matches) - (or ido-matches ido-cur-list)) - (ido-use-merged-list - (ido-flatten-merged-list (or ido-matches ido-cur-list))) - ((or full-list ido-completion-buffer-all-completions) - (ido-all-completions)) - (t - (copy-sequence (or ido-matches ido-cur-list)))) - #'ido-file-lessp))) - (if (featurep 'xemacs) - ;; XEmacs extents are put on by default, doesn't seem to be - ;; any way of switching them off. - ;; This obscure code avoids a byte compiler warning in Emacs. - (let ((f 'display-completion-list)) - (funcall f completion-list - :help-string "ido " - :activate-callback - (lambda (x y z) (message "Doesn't work yet, sorry!")))) - ;; else running Emacs - ;;(add-hook 'completion-setup-hook 'completion-setup-function) - (display-completion-list completion-list))))))) + (when (and display-it ido-completion-buffer) + (with-output-to-temp-buffer ido-completion-buffer + (let ((completion-list (sort + (cond + (ido-directory-too-big + (message "Reading directory...") + (setq ido-directory-too-big nil + ido-ignored-list nil + ido-cur-list (ido-all-completions) + ido-rescan t) + (ido-set-matches) + (or ido-matches ido-cur-list)) + (ido-use-merged-list + (ido-flatten-merged-list (or ido-matches ido-cur-list))) + ((or full-list ido-completion-buffer-all-completions) + (ido-all-completions)) + (t + (copy-sequence (or ido-matches ido-cur-list)))) + #'ido-file-lessp))) + (if (featurep 'xemacs) + ;; XEmacs extents are put on by default, doesn't seem to be + ;; any way of switching them off. + ;; This obscure code avoids a byte compiler warning in Emacs. + (let ((f 'display-completion-list)) + (funcall f completion-list + :help-string "ido " + :activate-callback + (lambda (x y z) (message "Doesn't work yet, sorry!")))) + ;; else running Emacs + ;;(add-hook 'completion-setup-hook 'completion-setup-function) + (display-completion-list completion-list))))))) ;;; KILL CURRENT BUFFER (defun ido-kill-buffer-at-head ()