Skip to content

Commit

Permalink
tidy: Use and instead of when
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tarsius committed Sep 19, 2024
1 parent a177b4f commit a0d7df2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions org-transclusion.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a0d7df2

Please sign in to comment.