From a53ea4e72bc174855021b2ecc4370eb4abc66efb Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 19 Dec 2008 06:14:55 +0100 Subject: [PATCH] New command org-ido-iswitchb. Patch by Chris Leyon. --- lisp/ChangeLog | 4 ++++ lisp/org.el | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f92e29371..87ab5164a 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2008-12-19 Carsten Dominik + + * org.el (org-ido-switchb): New function. + 2008-12-18 Carsten Dominik * org-agenda.el (org-agenda-show): New prefix argument diff --git a/lisp/org.el b/lisp/org.el index 745584f44..b1951e301 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11866,6 +11866,20 @@ Due to some yet unresolved reason, the global function "Switch-to: " nil t)) (or enabled (iswitchb-mode -1)))))) +;;;###autoload +(defun org-ido-switchb (&optional arg) + "Use `org-ido-completing-read' to prompt for an Org buffer to switch to. +With a prefix argument, restrict available to files. +With two prefix arguments, restrict available buffers to agenda files." + (interactive "P") + (let ((blist (cond ((equal arg '(4)) (org-buffer-list 'files)) + ((equal arg '(16)) (org-buffer-list 'agenda)) + (t (org-buffer-list))))) + (switch-to-buffer + (org-ido-completing-read "Org buffer: " + (mapcar 'buffer-name blist) + nil t)))) + (defun org-buffer-list (&optional predicate exclude-tmp) "Return a list of Org buffers. PREDICATE can be `export', `files' or `agenda'.