From unknown Mon Jun 23 16:45:25 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#5952 <5952@debbugs.gnu.org> To: bug#5952 <5952@debbugs.gnu.org> Subject: Status: 23.1.95; Some new ido features on top of virtual buffers Reply-To: bug#5952 <5952@debbugs.gnu.org> Date: Mon, 23 Jun 2025 23:45:25 +0000 retitle 5952 23.1.95; Some new ido features on top of virtual buffers reassign 5952 emacs submitter 5952 Leo severity 5952 wishlist tag 5952 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 15 06:54:52 2010 Received: (at submit) by debbugs.gnu.org; 15 Apr 2010 10:54:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2Mih-0001tZ-Rq for submit@debbugs.gnu.org; Thu, 15 Apr 2010 06:54:52 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2Mig-0001tU-5c for submit@debbugs.gnu.org; Thu, 15 Apr 2010 06:54:50 -0400 Received: from lists.gnu.org ([199.232.76.165]:37964) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O2Mia-0003FD-OH for submit@debbugs.gnu.org; Thu, 15 Apr 2010 06:54:44 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2Mia-0004o9-AM for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2010 06:54:44 -0400 Received: from [140.186.70.92] (port=37462 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2MiS-0004km-8X for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2010 06:54:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL,T_TVD_MIME_NO_HEADERS autolearn=unavailable version=3.3.0 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2MiN-0000ve-Mw for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2010 06:54:34 -0400 Received: from ppsw-52.csi.cam.ac.uk ([131.111.8.152]:35939) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2MiN-0000v1-D0 for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2010 06:54:31 -0400 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from lapwing-gw-1.csx.cam.ac.uk ([131.111.1.66]:53618 helo=Victoria.local) by ppsw-52.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1O2MiL-0005HF-HM (Exim 4.70) (return-path ); Thu, 15 Apr 2010 11:54:29 +0100 From: Leo To: bug-gnu-emacs@gnu.org Subject: 23.1.95; Some new ido features on top of virtual buffers Date: Thu, 15 Apr 2010 11:54:37 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit Cc: John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) --=-=-= Hello John, Thank you for the new feature 'virtual buffers' to ido.el in the devel repo. I have been using a similar feature locally but since discovered your patch, I switched to it. Here are three patches that add three features: 1. make it possible to toggle the use of virtual buffers. Bind the command to C-o when switching buffer (o for 'old' buffers). 2. handle files with same base names by appending one level of parent directory. Some files may still be ignored but the chance is much slimmer. 3. automatically bring in virtual buffers when user input doesn't match existing ones. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-function-ido-toggle-virtual-buffers-and-bind-to-.patch >From 9577b975915066f95ea744b54d25f594d7ceeeac Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 15 Apr 2010 08:39:13 +0100 Subject: [PATCH 1/3] New function ido-toggle-virtual-buffers and bind to C-o --- lisp/ido.el | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/lisp/ido.el b/lisp/ido.el index ac97aed..704bf22 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1633,6 +1633,7 @@ This function also adds a hook to the minibuffer." (define-key map "\C-x\C-f" 'ido-enter-find-file) (define-key map "\C-x\C-b" 'ido-fallback-command) (define-key map "\C-k" 'ido-kill-buffer-at-head) + (define-key map "\C-o" 'ido-toggle-virtual-buffers) (set-keymap-parent map ido-common-completion-map) (setq ido-buffer-completion-map map))) @@ -2182,6 +2183,7 @@ If cursor is not at the end of the user input, move to end of input." (ido-current-directory nil) (ido-directory-nonreadable nil) (ido-directory-too-big nil) + (ido-use-virtual-buffers ido-use-virtual-buffers) (require-match (confirm-nonexistent-file-or-buffer)) (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default require-match initial)) @@ -2707,6 +2709,16 @@ C-x C-f ... C-d enter `dired' on current directory." (setq ido-exit 'keep) (exit-minibuffer)))) +(defun ido-toggle-virtual-buffers () + "Toggle the use of virtual buffers. +See `ido-use-virtual-buffers' for explanation of virtual buffer." + (interactive) + (when (and ido-mode (eq ido-cur-item 'buffer)) + (setq ido-use-virtual-buffers (not ido-use-virtual-buffers)) + (setq ido-text-init ido-text) + (setq ido-exit 'refresh) + (exit-minibuffer))) + (defun ido-reread-directory () "Read current directory again. May be useful if cached version is no longer valid, but directory -- 1.7.0.4 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Use-parent-directory-for-files-with-same-base-name.patch >From 8ed6d4f903efcab1d915ec67bb907bd9bb4f2c09 Mon Sep 17 00:00:00 2001 From: Leo Date: Wed, 14 Apr 2010 18:58:18 +0100 Subject: [PATCH 2/3] Use parent directory for files with same base name --- lisp/ido.el | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/lisp/ido.el b/lisp/ido.el index 704bf22..92d2a09 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -3410,6 +3410,21 @@ for first matching file." (run-hooks 'ido-make-buffer-list-hook) ido-temp-list)) +(defun ido-find-duplicate-basenames (files) + "Find all the duplicate base names in FILES." + (let ((names (mapcar 'file-name-nondirectory files)) + dups head dup-p) + (setq names (sort names 'string<)) + (while names + (setq head (pop names)) + (while (string= head (car names)) + (pop names) + (setq dup-p t)) + (when dup-p + (push head dups) + (setq dup-p nil))) + dups)) + (defun ido-add-virtual-buffers-to-list () "Add recently visited files, and bookmark files, to the buffer list. This is to make them appear as if they were \"virtual buffers\"." @@ -3418,10 +3433,17 @@ This is to make them appear as if they were \"virtual buffers\"." ;; the file which the user might thought was still open. (unless recentf-mode (recentf-mode 1)) (setq ido-virtual-buffers nil) - (let (name) + (let ((dups (ido-find-duplicate-basenames recentf-list)) + name dir) (dolist (head recentf-list) (and (setq name (file-name-nondirectory head)) (null (get-file-buffer head)) + (if (not (member name dups)) + t + (setq dir head) + (dotimes (__ 2) + (setq dir (directory-file-name (file-name-directory dir)))) + (setq name (file-relative-name head dir))) (not (assoc name ido-virtual-buffers)) (not (member name ido-temp-list)) (not (ido-ignore-item-p name ido-ignore-buffers)) -- 1.7.0.4 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-Turn-on-virtual-buffers-automatically-when-no-matche.patch >From ed1321a6ea51ece2a90bb63842081a5ccee495a9 Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 15 Apr 2010 08:27:59 +0100 Subject: [PATCH 3/3] Turn on virtual buffers automatically when no matches --- lisp/ido.el | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/lisp/ido.el b/lisp/ido.el index 92d2a09..671e8a8 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -4491,7 +4491,14 @@ For details of keybindings, see `ido-find-file'." (setq ido-exit 'refresh) (exit-minibuffer))) + (when (and (eq ido-cur-item 'buffer) + (not ido-matches) + (not ido-use-virtual-buffers)) + (setq ido-text-init ido-text) + (setq ido-use-virtual-buffers t) + (setq ido-exit 'refresh) + (exit-minibuffer)) + (when (and ido-rescan (not ido-matches) -- 1.7.0.4 --=-=-= Leo --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 15 14:29:17 2010 Received: (at control) by debbugs.gnu.org; 15 Apr 2010 18:29:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2ToS-0006Lv-G1 for submit@debbugs.gnu.org; Thu, 15 Apr 2010 14:29:16 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2ToQ-0006Lk-Gy for control@debbugs.gnu.org; Thu, 15 Apr 2010 14:29:15 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1O2ToE-0004Yp-8p; Thu, 15 Apr 2010 14:29:02 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19399.23277.131729.705471@fencepost.gnu.org> Date: Thu, 15 Apr 2010 14:29:01 -0400 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: black X-Ran: I2osu0uqhYF(oLTuF1AB"l21"KvQ3eLee*z=|sh+n2)N_$p!_]VW&cPXC&Mgg;U0FphPs\ X-Debbugs-No-Ack: yes X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) reassign 5922 aquamacs severity 5931 minor tags 5931 moreinfo merge 5252 5921 retitle 5921 /sw and /opt/local on OSX tags 5531 moreinfo tags 5568 wontfix notabug severity 5568 minor reassign 5932 emacs,cc-mode reassign 5953 emacs,cc-mode severity 5952 wishlist severity 5953 wishlist tags 5952 patch reassign 5946 emacs,ns severity 5937 minor From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 06 08:58:57 2013 Received: (at 5952) by debbugs.gnu.org; 6 Jul 2013 12:58:57 +0000 Received: from localhost ([127.0.0.1]:33923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UvS4m-0005Cv-5o for submit@debbugs.gnu.org; Sat, 06 Jul 2013 08:58:56 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:41320) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UvS4i-0005CF-SR for 5952@debbugs.gnu.org; Sat, 06 Jul 2013 08:58:53 -0400 Received: by mail-pb0-f44.google.com with SMTP id uo1so2879361pbc.31 for <5952@debbugs.gnu.org>; Sat, 06 Jul 2013 05:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=YMyLMzGJaHSqaQ7t++3qMB4v+FCPeFe/NHCTxovI7nM=; b=Jig5Naiv4GYaTbxuN3bm9PNelyk5rCJUHMEjQ+xJdBlkmlwY31tKnQh1/6uQhKOI+9 n7B179OWhKBt4XcJyfCsb+BW5FPhcdot89SVazaTqZIrPvHZRVw3B8Khi8YOEjGtVFCF KmFf1vF6axIU20SIEeMT4cvzlKNj2cESbnsrPqC6TyQRFzacspK9DHzITTjuNsMwUxmr 1t8Lctujr5ySWRQyxI9X+nLXvJ/wGL7wbDJ1Pa0PH0aPNtboywJ7/RC3tdCjmzS5elqG 1wlqkkgB7BIsbj4kR4mUnSmbyeyYp+xRnsIvvxJO9OAxTGbUpY1xcfKUM5EgaU3V3JXK +r4Q== X-Received: by 10.68.201.66 with SMTP id jy2mr13551247pbc.90.1373115526375; Sat, 06 Jul 2013 05:58:46 -0700 (PDT) Received: from localhost ([182.48.101.29]) by mx.google.com with ESMTPSA id y6sm12216197pbl.23.2013.07.06.05.58.44 for <5952@debbugs.gnu.org> (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 06 Jul 2013 05:58:45 -0700 (PDT) From: Leo Liu To: 5952@debbugs.gnu.org Subject: Re: bug#5952: 23.1.95; Some new ido features on top of virtual buffers References: Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoAgMAAADxkFD+AAAADFBMVEUvT09qWs3/pQD///+J kUVcAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMLOd3veKQA AACuSURBVBjTldE9CgIxEAXgB+lEyFUC2wo5ikdZ8DSypxhMY7H9VuIVwlqkGRgnm59VsHGafIQ3 CZlAtmKIRaHETgYa12lqvEsPYKf8wXHsPGfqPaUM0g9aJPKFXkmNQmSDqwzz4Fpgpz+6WAPY2z5o uPJJpu0uypcl4nyCibMLQ8lCiVjayLoQvw5LsVKQuHPRR958HZbOcVsKeepcLxpByjycGvnKmY+c MBvrtyjfe0vmuLvdq/kAAAAASUVORK5CYII= Date: Sat, 06 Jul 2013 20:58:39 +0800 In-Reply-To: (Leo's message of "Thu, 15 Apr 2010 11:54:37 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.8.4) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 5952 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2010-04-15 18:54 +0800, Leo wrote: > 1. make it possible to toggle the use of virtual buffers. Bind the > command to C-o when switching buffer (o for 'old' buffers). > > 2. handle files with same base names by appending one level of parent > directory. Some files may still be ignored but the chance is much > slimmer. > > 3. automatically bring in virtual buffers when user input doesn't match > existing ones. Update: item 1 and 3 are done. Leo From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 00:53:34 2016 Received: (at 5952) by debbugs.gnu.org; 28 Feb 2016 05:53:34 +0000 Received: from localhost ([127.0.0.1]:49347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZuIQ-0007vo-K7 for submit@debbugs.gnu.org; Sun, 28 Feb 2016 00:53:34 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:34243) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZuIO-0007vf-RA for 5952@debbugs.gnu.org; Sun, 28 Feb 2016 00:53:33 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZuHz-0003Yp-De; Sun, 28 Feb 2016 06:53:08 +0100 From: Lars Ingebrigtsen To: Leo Subject: Re: bug#5952: 23.1.95; Some new ido features on top of virtual buffers References: Date: Sun, 28 Feb 2016 16:22:56 +1030 In-Reply-To: (Leo's message of "Thu, 15 Apr 2010 11:54:37 +0100") Message-ID: <8760x9v0sn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aZuHz-0003Yp-De X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1457243588.59076@3D5fmcCnzR18SA/t/ULMxA X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 5952 Cc: 5952@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Leo writes: > 2. handle files with same base names by appending one level of parent > directory. Some files may still be ignored but the chance is much > slimmer. [...] > +(defun ido-find-duplicate-basenames (files) > + "Find all the duplicate base names in FILES." > + (let ((names (mapcar 'file-name-nondirectory files)) > + dups head dup-p) > + (setq names (sort names 'string<)) > + (while names > + (setq head (pop names)) > + (while (string= head (car names)) > + (pop names) > + (setq dup-p t)) > + (when dup-p > + (push head dups) > + (setq dup-p nil))) > + dups)) [...] > + (let ((dups (ido-find-duplicate-basenames recentf-list)) > + name dir) > (dolist (head recentf-list) > (and (setq name (file-name-nondirectory head)) > (null (get-file-buffer head)) > + (if (not (member name dups)) > + t > + (setq dir head) > + (dotimes (__ 2) > + (setq dir (directory-file-name (file-name-directory dir)))) > + (setq name (file-relative-name head dir))) I don't think this is needed any more, since Emacs now creates buffers like foo.c instead of <1>, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 28 00:53:47 2016 Received: (at control) by debbugs.gnu.org; 28 Feb 2016 05:53:47 +0000 Received: from localhost ([127.0.0.1]:49350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZuIc-0007wD-SQ for submit@debbugs.gnu.org; Sun, 28 Feb 2016 00:53:47 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:34253) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZuIb-0007w4-2a for control@debbugs.gnu.org; Sun, 28 Feb 2016 00:53:45 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZuI9-0003ZB-Tf for control@debbugs.gnu.org; Sun, 28 Feb 2016 06:53:18 +0100 Date: Sun, 28 Feb 2016 16:23:14 +1030 Message-Id: <874mctv0s5.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #5952 X-MailScanner-ID: 1aZuI9-0003ZB-Tf X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1457243599.00015@c9OHQ3Z7rRQIb4ud5Nr63w X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) close 5952 From unknown Mon Jun 23 16:45:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 27 Mar 2016 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator