فهرست منبع

New command org-ido-iswitchb.

Patch by Chris Leyon.
Carsten Dominik 16 سال پیش
والد
کامیت
a53ea4e72b
2فایلهای تغییر یافته به همراه18 افزوده شده و 0 حذف شده
  1. 4 0
      lisp/ChangeLog
  2. 14 0
      lisp/org.el

+ 4 - 0
lisp/ChangeLog

@@ -1,3 +1,7 @@
+2008-12-19  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-ido-switchb): New function.
+
 2008-12-18  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-agenda.el (org-agenda-show): New prefix argument

+ 14 - 0
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'.