From a0d7df2f69be6d23d1996c4476be7356c66d66c9 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Wed, 3 Jul 2024 15:57:22 +0200 Subject: [PATCH] tidy: Use and instead of when Likewise use and-let* instead of when-let. This is preferable when the value of the form matters, as it communicates the fact that that is the case. --- org-transclusion.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org-transclusion.el b/org-transclusion.el index 74eea80..4b4c667 100644 --- a/org-transclusion.el +++ b/org-transclusion.el @@ -389,8 +389,9 @@ transclusion keyword." (not org-transclusion-mode)))) (let* ((contents-beg (org-element-property :contents-begin context)) (contents-end (org-element-property :contents-end context)) - (contents (when contents-beg - (buffer-substring-no-properties contents-beg contents-end))) + (contents (and contents-beg + (buffer-substring-no-properties contents-beg + contents-end))) (link (org-element-link-interpreter context contents))) (save-excursion (org-transclusion-search-or-add-next-empty-line) @@ -1574,12 +1575,12 @@ original buffer. This is required especially when transclusion is for a paragraph, which can be right next to another paragraph without a blank space; thus, subsumed by the surrounding paragraph." - (let* ((beg (or (when-let ((m (get-char-property (point) + (let* ((beg (or (and-let* ((m (get-char-property (point) 'org-transclusion-beg-mkr))) (marker-position m)) (overlay-start (get-char-property (point) 'org-transclusion-pair)))) - (end (or (when-let ((m (get-char-property (point) + (end (or (and-let* ((m (get-char-property (point) 'org-transclusion-end-mkr))) (marker-position m)) (overlay-end (get-char-property (point)