From c125359a9bd13baef4a1ecc75aa55e7ee22be562 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 4 Sep 2009 12:30:06 +0200 Subject: [PATCH] Stop iswitchb tag completion from including virtual files Tassilo Horn writes: > When I want to set a tag using `C-c C-q TAB' I get a iswitchb completion > prompt, cause org-completion-use-iswitchb is t. I also use iswitchb's > virtual files feature (iswitchb-use-virtual-buffers set to t), which > includes files that aren't opened in a buffer, but are in the recentf > list. This is a cool thing when switching buffers (I barely use C-x C-f > anymore and switch to the virtual buffer instead), but totally useless > and annoying for tab completion in org. > > So when completing anything (files/tags/...) in org with iswitchb, > switchb-use-virtual-buffers should be let-bound to nil before. --- lisp/ChangeLog | 2 ++ lisp/org.el | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0e05f1a2..5b4eba05b 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,8 @@ implement a link with index zero. (org-cycle-show-empty-lines): Not keep empty line under header hidden. + (org-iswitchb-completing-read): Bind `switchb-use-virtual-buffers' + to nil for special completion. * org-agenda.el (org-agenda-open-link): Pass the prefix to `org-offer-links-in-entry'. diff --git a/lisp/org.el b/lisp/org.el index adc38a11e..1f7488034 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7706,9 +7706,10 @@ Use TAB to complete link prefixes, then RET for type-specific completion support "Use iswitch as a completing-read replacement to choose from choices. PROMPT is a string to prompt with. CHOICES is a list of strings to choose from." - (let ((iswitchb-make-buflist-hook - (lambda () - (setq iswitchb-temp-buflist choices)))) + (let* ((switchb-use-virtual-buffers nil) + (iswitchb-make-buflist-hook + (lambda () + (setq iswitchb-temp-buflist choices)))) (iswitchb-read-buffer prompt))) (defun org-icompleting-read (&rest args)