Skip to content

Commit

Permalink
fix: warning (org-element) when the source is not org-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nobiot committed Nov 2, 2024
1 parent 2c30e01 commit 13ec632
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions org-remark.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

;; Author: Noboru Ota <[email protected]>
;; Created: 22 December 2020
;; Last modified: 25 October 2024
;; Last modified: 02 November 2024

;; URL: https://github.com/nobiot/org-remark
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp,
Expand Down Expand Up @@ -1036,7 +1036,10 @@ This function assumes
the current buffer is the source buffer.
Utility function to work with a single highlight overlay."
(or (cadr (assoc "TITLE" (org-collect-keywords '("TITLE"))))
(or (and (derived-mode-p 'org-mode)
;; `org-collect' gives an warning if the current buffer is not an
;; org-mode
(cadr (assoc "TITLE" (org-collect-keywords '("TITLE")))))
(let* ((full-name (org-remark-source-find-file-name))
(filename (if (and (string= "" (file-name-nondirectory full-name))
(string-match "[\/]+\\'" full-name))
Expand Down

0 comments on commit 13ec632

Please sign in to comment.