emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote e4fcef956b 2/2: Make denote-org-extras.el comman


From: ELPA Syncer
Subject: [elpa] externals/denote e4fcef956b 2/2: Make denote-org-extras.el commands only work in Org mode
Date: Tue, 23 Jan 2024 00:57:41 -0500 (EST)

branch: externals/denote
commit e4fcef956baba90909cc50171538a76230620718
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Make denote-org-extras.el commands only work in Org mode
    
    Thanks to Jean-Philippe Gagné Guay for pointing this out in issue 224:
    <https://github.com/protesilaos/denote/issues/224>.
---
 denote-org-extras.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/denote-org-extras.el b/denote-org-extras.el
index b3b7147540..9ff9f909b8 100644
--- a/denote-org-extras.el
+++ b/denote-org-extras.el
@@ -114,6 +114,8 @@ independent of it.
 To only link to a file, use the `denote-link' command."
   (declare (interactive-only t))
   (interactive)
+  (unless (derived-mode-p 'org-mode)
+    (user-error "Links to headings only work between Org files"))
   (when-let ((file (denote-file-prompt ".*\\.org"))
              (heading (denote-org-extras--outline-prompt file))
              (line (string-to-number (car (split-string heading "\t"))))
@@ -156,6 +158,8 @@ present, the former is used.
 Make the new note an Org file regardless of the value of
 `denote-file-type'."
   (interactive)
+  (unless (derived-mode-p 'org-mode)
+    (user-error "Headings can only be extracted from Org files"))
   (if-let ((text (org-get-entry))
            (heading (denote-link-ol-get-heading)))
       (let ((tags (org-get-tags))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]