branch: externals/denote commit 2d1d543f3d1ba56c262f5f39cd7e8481fc35c559 Author: Elias Storms <elias.sto...@gmail.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
org-denote-dblock: Add :reverse for denote-links block Add ':reverse' as a possible argument for the denote-links Dynamic block. Via this argument the value of denote-link-add-links-sort can be set for the block. --- denote-org-dblock.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/denote-org-dblock.el b/denote-org-dblock.el index 6b97087f7d..d61c1d44f1 100644 --- a/denote-org-dblock.el +++ b/denote-org-dblock.el @@ -64,11 +64,12 @@ ;; the list, or directly by calling 'denote-org-dblock-insert-links'. ;; ;; -;; Org Dynamic blocks of the denote-links type can have three -;; arguments: +;; Org Dynamic blocks of the denote-links type can have the follwoing +;; arguments (in any order): ;; 1. :regexp "string" -- the search input (required) ;; 2. :missing-only t -- to only include missing links -;; 3. :block-name "n" -- to include a name for later processing +;; 3. :reverse t -- reverse sort order (or don't, when nil) +;; 4. :block-name "n" -- to include a name for later processing ;; ;; By default ':missing-only t' is included as a parameter in the ;; block's header, so that only "missing links" are included (i.e., @@ -76,6 +77,10 @@ ;; Remove this parameter or set to 'nil' to include all matching ;; notes. ;; +;; With ':reverse' the value of 'denote-link-add-links-sort' can be +;; let-bound specifically for this list of links. For more +;; information, see the documentation of this variable. +;; ;; With ':block-name "string"' include a '#+NAME: string' line in the ;; Dynamic block. This allows use of the Dynamic block output as input ;; for further computation, e.g. in Org source blocks. @@ -102,6 +107,7 @@ Used by `org-dblock-update' with PARAMS provided by the dynamic block." (let ((regexp (plist-get params :regexp)) (missing-only (plist-get params :missing-only)) (block-name (plist-get params :block-name)) + (denote-link-add-links-sort (plist-get params :reverse)) (current-file (buffer-file-name))) (when block-name (insert "#+name: " block-name "\n"))