Skip to content

Commit

Permalink
Fix: (burly--org-mode-buffer-url) Unnarrowed buffers
Browse files Browse the repository at this point in the history
Fixes #38.  Thanks to @tpeacock19 for reporting.
  • Loading branch information
alphapapa committed Jul 9, 2021
1 parent c6d6aae commit 9b5b480
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions burly.el
Original file line number Diff line number Diff line change
Expand Up @@ -435,14 +435,15 @@ URLOBJ should be a URL object as returned by
(indirect (buffer-base-buffer buffer))
(top-olp
;; For narrowing purposes, start with the heading at the top of the buffer.
(save-excursion
(goto-char (point-min))
;; `org-get-outline-path' replaces links in headings with their
;; descriptions, which prevents using them in regexp searches.
(when (org-heading-components)
(org-with-wide-buffer
(nreverse (cl-loop collect (substring-no-properties (nth 4 (org-heading-components)))
while (org-up-heading-safe)))))))
(when (buffer-narrowed-p)
(save-excursion
(goto-char (point-min))
;; `org-get-outline-path' replaces links in headings with their
;; descriptions, which prevents using them in regexp searches.
(when (org-heading-components)
(org-with-wide-buffer
(nreverse (cl-loop collect (substring-no-properties (nth 4 (org-heading-components)))
while (org-up-heading-safe))))))))
(point-olp
(when (ignore-errors (org-heading-components))
(org-with-wide-buffer
Expand Down

0 comments on commit 9b5b480

Please sign in to comment.