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

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

[elpa] externals/org f28f02bde9 34/44: org-link-make-string: Throw error


From: ELPA Syncer
Subject: [elpa] externals/org f28f02bde9 34/44: org-link-make-string: Throw error when both LINK and DESCRIPTION are empty
Date: Mon, 25 Apr 2022 07:58:01 -0400 (EDT)

branch: externals/org
commit f28f02bde95869597edbd4bbf37273197a2e4a6f
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-link-make-string: Throw error when both LINK and DESCRIPTION are empty
    
    This behaviour is expected according to `test-ol/make-string'.
---
 lisp/ol.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/ol.el b/lisp/ol.el
index 86f55d7cf3..22eaae8fbf 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -999,7 +999,9 @@ LINK is escaped with backslashes for inclusion in buffer."
                (replace-regexp-in-string "]\\'"
                                          (concat "\\&" zero-width-space)
                                          (org-trim description))))))
-    (if (not (org-string-nw-p link)) description
+    (if (not (org-string-nw-p link))
+        (or description
+            (error "Empty link"))
       (format "[[%s]%s]"
              (org-link-escape link)
              (if description (format "[%s]" description) "")))))



reply via email to

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