Skip to content

Commit

Permalink
* elisp-demos.el: Drop when-let for 24.4.
Browse files Browse the repository at this point in the history
when-let is from 25.1.
  • Loading branch information
xuchunyang committed Jan 16, 2024
1 parent 0899c19 commit e42f069
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions elisp-demos.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"))))

Expand Down

0 comments on commit e42f069

Please sign in to comment.