瀏覽代碼

Autoload dynamic block definitions

* lisp/org-clock.el:
* lisp/org-colview.el: Autoload call to org-dynamic-block-define.

The dynamic block dispatcher added in 34b71a0ca (Add a dispatcher
command for inserting dynamic blocks, 2018-12-23) offers an entry for
"clocktable" and "columnview" only after the corresponding library is
loaded.  However, before that commit, the autoloaded org-clock-report
and org-columns-insert-dblock commands were accessible via plain key
bindings.  Restore the ability to access these commands before the
associated library is loaded.

Reported-by: Axel Kielhorn <org-mode@axelkielhorn.de>
<3CE37EF0-6C7A-4CC0-AFEE-2B82296D63E1@axelkielhorn.de>
Kyle Meyer 5 年之前
父節點
當前提交
8368c38e01
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 4 1
      lisp/org-clock.el
  2. 4 1
      lisp/org-colview.el

+ 4 - 1
lisp/org-clock.el

@@ -2068,7 +2068,10 @@ in the buffer and update it."
     (start (goto-char start)))
   (org-update-dblock))
 
-(org-dynamic-block-define "clocktable" #'org-clock-report)
+;;;###autoload
+(eval-after-load 'org
+  '(progn
+     (org-dynamic-block-define "clocktable" #'org-clock-report)))
 
 (defun org-day-of-week (day month year)
   "Return the day of the week as an integer."

+ 4 - 1
lisp/org-colview.el

@@ -1550,7 +1550,10 @@ PARAMS is a property list of parameters:
 		     (id)))))
   (org-update-dblock))
 
-(org-dynamic-block-define "columnview" #'org-columns-insert-dblock)
+;;;###autoload
+(eval-after-load 'org
+  '(progn
+     (org-dynamic-block-define "columnview" #'org-columns-insert-dblock)))
 
 
 ;;; Column view in the agenda