[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/4] Autoload dynamic block definitions

From: Kyle Meyer
Subject: [PATCH 3/4] Autoload dynamic block definitions
Date: Tue, 5 May 2020 00:15:21 -0400

* 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 <address@hidden>
 lisp/org-clock.el   | 5 ++++-
 lisp/org-colview.el | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index a95c85437..690ba05b2 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2068,7 +2068,10 @@ (defun org-clock-report (&optional arg)
     (start (goto-char start)))
-(org-dynamic-block-define "clocktable" #'org-clock-report)
+(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."
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index e967154ab..3569b231b 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1550,7 +1550,10 @@ (defun org-columns-insert-dblock ()
-(org-dynamic-block-define "columnview" #'org-columns-insert-dblock)
+(eval-after-load 'org
+  '(progn
+     (org-dynamic-block-define "columnview" #'org-columns-insert-dblock)))
 ;;; Column view in the agenda

reply via email to

[Prev in Thread] Current Thread [Next in Thread]