From e42f069208ecb6b566ec8430ec3596a256f5d3ef Mon Sep 17 00:00:00 2001 From: Xu Chunyang Date: Tue, 16 Jan 2024 23:55:12 +0800 Subject: [PATCH] * elisp-demos.el: Drop when-let for 24.4. when-let is from 25.1. --- elisp-demos.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/elisp-demos.el b/elisp-demos.el index e21e063..f7486c2 100644 --- a/elisp-demos.el +++ b/elisp-demos.el @@ -51,17 +51,18 @@ If set, new notes are added to the first file in this list." (with-temp-buffer (insert-file-contents file) (delay-mode-hooks (org-mode)) - (when-let ((pos (org-find-exact-headline-in-buffer (symbol-name symbol)))) - (goto-char pos) - (org-end-of-meta-data) - (push (propertize - (string-trim - (buffer-substring-no-properties - (point) - (org-end-of-subtree))) - 'file file - 'pos (marker-position pos)) - results))))) + (let ((pos (org-find-exact-headline-in-buffer (symbol-name symbol)))) + (when pos + (goto-char pos) + (org-end-of-meta-data) + (push (propertize + (string-trim + (buffer-substring-no-properties + (point) + (org-end-of-subtree))) + 'file file + 'pos (marker-position pos)) + results)))))) (when results (string-join (nreverse results) "\n\n"))))