瀏覽代碼

Move `org-unlogged-message' to "org-macs.el"

* lisp/org.el (org-unlogged-message): Move function to...
* lisp/org-macs.el: ... here.
Nicolas Goaziou 7 年之前
父節點
當前提交
6f89177ee6
共有 2 個文件被更改,包括 17 次插入5 次删除
  1. 5 1
      lisp/org-macs.el
  2. 12 4
      lisp/org.el

+ 5 - 1
lisp/org-macs.el

@@ -31,7 +31,6 @@
 
 ;;; Code:
 
-(declare-function org-key "org" (key))
 (declare-function org-defkey "org" (keymap key def))
 
 
@@ -743,6 +742,11 @@ program is needed for, so that the error message can be more informative."
   "Display the given MESSAGE as a warning."
   (display-warning 'org message :warning))
 
+(defun org-unlogged-message (&rest args)
+  "Display a message, but avoid logging it in the *Messages* buffer."
+  (let ((message-log-max nil))
+    (apply #'message args)))
+
 (defun org-let (list &rest body)
   (eval (cons 'let (cons list body))))
 (put 'org-let 'lisp-indent-function 1)

+ 12 - 4
lisp/org.el

@@ -6592,10 +6592,18 @@ and subscripts."
 
 (defvar org-inlinetask-min-level)
 
-(defun org-unlogged-message (&rest args)
-  "Display a message, but avoid logging it in the *Messages* buffer."
-  (let ((message-log-max nil))
-    (apply 'message args)))
+(defun org-show-all (&optional types)
+  "Show all contents in the visible part of the buffer.
+By default, the function expands headings, blocks and drawers.
+When optional argument TYPE is a list of symbols among `blocks',
+`drawers' and `headings', to only expand one specific type."
+  (dolist (type (or types '(blocks drawers headings)))
+    (org-flag-region (point-min) (point-max) nil
+		     (pcase type
+		       (`blocks 'org-hide-block)
+		       (`drawers 'org-hide-drawer)
+		       (`headings 'outline)
+		       (_ (error "Invalid type: %S" type))))))
 
 ;;;###autoload
 (defun org-cycle (&optional arg)