From: Tassilo Horn <tassilo@member.fsf.org>
To: Leo <sdl.web@gmail.com>
Cc: John Wiegley <jwiegley@gmail.com>, "Kim F. Storm" <storm@cua.dk>,
emacs-devel@gnu.org
Subject: Re: Concerning the new `ido-use-virtual-buffers' feature
Date: Thu, 27 May 2010 12:57:00 +0200 [thread overview]
Message-ID: <201005271257.02056.tassilo@member.fsf.org> (raw)
In-Reply-To: <m18w75hdlm.fsf@cam.ac.uk>
[-- Attachment #1: Type: Text/Plain, Size: 823 bytes --]
On Thursday 27 May 2010 11:56:53 Leo wrote:
Hi Leo, John, Kim,
> Meanwhile feel free to change the patch.
Hm, it doesn't apply to the current bzr trunk. Anyway, I rewrote it to
be controled by the ido-use-virtual-buffers variable solely with 3
values 'never, 'auto, and 'always.
The resulting patch is attached. Basically, it works, but there's one
bug I cannot figure out how to solve. When ido-use-virtual-buffers is
'auto and the current input doesn't even match any closed buffer
(recentf file), then it's stuck instead of displaying [no match].
I don't know ido very well and cannot figure out how to get that right.
Kim, maybe you could check what's wrong?
I have papers on file. I use 7 lines originating from Leo's patch, so I
don't know if that has to wait till Leo's assignments arrive...
Bye,
Tassilo
[-- Attachment #2: ido-virtual-buffers.diff --]
[-- Type: text/x-patch, Size: 4474 bytes --]
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2010-05-27 07:08:37 +0000
+++ lisp/ChangeLog 2010-05-27 10:48:36 +0000
@@ -1,3 +1,14 @@
+2010-05-27 Tassilo Horn <tassilo@member.fsf.org>
+
+ * ido.el (ido-exhibit, ido-buffer-internal)
+ (ido-toggle-virtual-buffers, ido-make-buffer-list)
+ (ido-buffer-internal): ido-use-virtual-buffers now is a choice
+ option with values 'never (default), 'always, and 'auto. The
+ latter means, show virtual buffers if the current input doesn't
+ match any existing buffer.
+
+ Based on a patch by Leo <sdl.web@gmail.com>.
+
2010-05-27 Kenichi Handa <handa@m17n.org>
* language/hebrew.el (hebrew-shape-gstring): Check if a glyph
=== modified file 'lisp/ido.el'
--- lisp/ido.el 2010-05-25 02:11:08 +0000
+++ lisp/ido.el 2010-05-27 10:41:37 +0000
@@ -774,8 +774,10 @@
:type '(repeat string)
:group 'ido)
-(defcustom ido-use-virtual-buffers nil
- "If non-nil, refer to past buffers as well as existing ones.
+(defcustom ido-use-virtual-buffers 'never
+ "If `always', refer to past buffers as well as existing ones.
+If `auto', refer to past buffers only when the current input
+doesn't match an existing buffer.
Essentially it works as follows: Say you are visiting a file and
the buffer gets cleaned up by mignight.el. Later, you want to
switch to that buffer, but find it's no longer open. With
@@ -785,11 +787,12 @@
to think less about whether recently opened files are still open
or not. Most of the time you can quit Emacs, restart, and then
switch to a file buffer that was previously open as if it still
-were.
- This feature relies upon the `recentf' package, which will be
-enabled if this variable is configured to a non-nil value."
+were. This feature relies upon the `recentf' package, which will
+be enabled if this variable is configured to a non-nil value."
:version "24.1"
- :type 'boolean
+ :type '(choice (const always)
+ (const auto)
+ (const never))
:group 'ido)
(defcustom ido-use-faces t
@@ -1056,7 +1059,7 @@
(defvar ido-virtual-buffers nil
"List of virtual buffers, that is, past visited files.
This is a copy of `recentf-list', pared down and with faces applied.
-Only used if `ido-use-virtual-buffers' is non-nil.")
+Only used if `ido-use-virtual-buffers' is not `never'.")
;;; Variables with dynamic bindings.
;;; Declared here to keep the byte compiler quiet.
@@ -2182,7 +2185,7 @@
(ido-directory-nonreadable nil)
(ido-directory-too-big nil)
(ido-use-virtual-buffers (if (eq method 'kill)
- nil ;; Don't consider virtual buffers for killing
+ 'never ;; Don't consider virtual buffers for killing
ido-use-virtual-buffers))
(require-match (confirm-nonexistent-file-or-buffer))
(buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default
@@ -2224,7 +2227,9 @@
(ido-visit-buffer buf method t)))
;; check for a virtual buffer reference
- ((and ido-use-virtual-buffers ido-virtual-buffers
+ ((and (or (eq ido-use-virtual-buffers 'always)
+ (eq ido-use-virtual-buffers 'auto))
+ ido-virtual-buffers
(setq filename (assoc buf ido-virtual-buffers)))
(ido-visit-buffer (find-file-noselect (cdr filename)) method t))
@@ -2712,7 +2717,9 @@
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-use-virtual-buffers (if (eq ido-use-virtual-buffers 'never)
+ 'always
+ 'never))
(setq ido-text-init ido-text)
(setq ido-exit 'refresh)
(exit-minibuffer)))
@@ -3403,7 +3410,9 @@
(when (and default (buffer-live-p (get-buffer default)))
(setq ido-temp-list
(cons default (delete default ido-temp-list))))
- (if ido-use-virtual-buffers
+ (if (or (eq ido-use-virtual-buffers 'always)
+ (and (eq ido-use-virtual-buffers 'auto)
+ (not ido-matches)))
(ido-add-virtual-buffers-to-list))
(run-hooks 'ido-make-buffer-list-hook)
ido-temp-list))
@@ -4465,6 +4474,13 @@
(setq ido-exit 'refresh)
(exit-minibuffer)))
+ (when (and (eq ido-use-virtual-buffers 'auto)
+ (eq ido-cur-item 'buffer)
+ (not ido-matches))
+ (setq ido-text-init ido-text)
+ (setq ido-exit 'refresh)
+ (exit-minibuffer))
+
(when (and
ido-rescan
(not ido-matches)
next prev parent reply other threads:[~2010-05-27 10:57 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 9:56 Concerning the new `ido-use-virtual-buffers' feature Leo
2010-05-27 10:57 ` Tassilo Horn [this message]
2010-05-27 18:01 ` Leo
2010-05-27 19:05 ` Tassilo Horn
2010-05-28 1:21 ` Leo
2010-05-28 1:45 ` Leo
2010-05-28 6:21 ` Tassilo Horn
2010-05-28 9:07 ` Leo
2010-05-28 9:26 ` Leo
2010-05-28 10:35 ` Juanma Barranquero
2010-05-28 12:15 ` Leo
2010-05-28 12:29 ` Tassilo Horn
2010-05-29 14:15 ` Leo
2010-06-01 23:54 ` Juanma Barranquero
2010-06-02 3:28 ` Leo
2010-06-02 5:57 ` Juanma Barranquero
2010-06-02 9:43 ` Leo
[not found] ` <AANLkTilMurdEZBA-kiWHlS9-r0VK6W5v@mail.gmail.com>
2011-10-16 10:06 ` Antoine Levitt
2013-07-06 12:57 ` Leo Liu
[not found] ` <201006020842.48913.tassilo@member.fsf.org>
[not found] ` <AANLkTikTDRtnbzNHTzVlMvHyl0pDHuhpQLu5k8Il4vP0@mail.gmail.com>
2010-06-02 8:29 ` Tassilo Horn
2010-06-02 9:28 ` Juanma Barranquero
2010-06-02 9:55 ` Tassilo Horn
2010-06-02 10:27 ` Juanma Barranquero
-- strict thread matches above, loose matches on Subject: below --
2010-05-26 10:14 Tassilo Horn
2010-05-26 20:59 ` John Wiegley
2010-05-27 6:54 ` Tassilo Horn
2010-05-27 6:57 ` John Wiegley
2010-05-27 8:10 ` Tassilo Horn
2010-05-27 8:26 ` John Wiegley
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=201005271257.02056.tassilo@member.fsf.org \
--to=tassilo@member.fsf.org \
--cc=emacs-devel@gnu.org \
--cc=jwiegley@gmail.com \
--cc=sdl.web@gmail.com \
--cc=storm@cua.dk \
/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.