浏览代码

Resurrect `org-switchb'

* lisp/org.el (org-switchb): New function.

This was removed by mistake in commit
8eb0ef0b427142bbbe6073e3f8f02c7fccd7217e.
Nicolas Goaziou 9 年之前
父节点
当前提交
67a8b4026f
共有 1 个文件被更改,包括 17 次插入0 次删除
  1. 17 0
      lisp/org.el

+ 17 - 0
lisp/org.el

@@ -18364,6 +18364,23 @@ changes from another.  I believe the procedure must be like this:
 
 ;;;; Agenda files
 
+;;;###autoload
+(defun org-switchb (&optional arg)
+  "Switch between Org buffers.
+
+With \\[universal-argument] prefix, restrict available buffers to files.
+
+With \\[universal-argument] \\[universal-argument] \
+prefix, restrict available buffers to agenda files."
+  (interactive "P")
+  (let ((blist (org-buffer-list
+		(cond ((equal arg '(4))  'files)
+		      ((equal arg '(16)) 'agenda)))))
+    (org-pop-to-buffer-same-window
+     (completing-read "Org buffer: "
+		      (mapcar #'list (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'.