Explorar o código

Merge branch 'maint'

Bastien Guerry %!s(int64=12) %!d(string=hai) anos
pai
achega
cec03f07b9
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      lisp/org.el

+ 5 - 4
lisp/org.el

@@ -9620,8 +9620,9 @@ active region."
 	   ;; Store a link using the ID at point
 	   ;; Store a link using the ID at point
 	   (setq link (condition-case nil
 	   (setq link (condition-case nil
 			  (prog1 (org-id-store-link)
 			  (prog1 (org-id-store-link)
-			    (setq desc (plist-get org-store-link-plist
-						  :description)))
+			    (setq desc (or (plist-get org-store-link-plist
+						      :description)
+					   "")))
 			(error
 			(error
 			 ;; Probably before first headline, link only to file
 			 ;; Probably before first headline, link only to file
 			 (concat "file:"
 			 (concat "file:"
@@ -9682,9 +9683,9 @@ active region."
        ;; We're done setting link and desc, clean up
        ;; We're done setting link and desc, clean up
        (if (consp link) (setq cpltxt (car link) link (cdr link)))
        (if (consp link) (setq cpltxt (car link) link (cdr link)))
        (setq link (or link cpltxt)
        (setq link (or link cpltxt)
-	     desc (or desc cpltxt ""))
+	     desc (or desc cpltxt))
        (cond ((equal desc "NONE") (setq desc nil))
        (cond ((equal desc "NONE") (setq desc nil))
-	     ((string-match org-bracket-link-analytic-regexp desc)
+	     ((and desc (string-match org-bracket-link-analytic-regexp desc))
 	      (let ((d0 (match-string 3 desc))
 	      (let ((d0 (match-string 3 desc))
 		    (p0 (match-string 5 desc)))
 		    (p0 (match-string 5 desc)))
 		(setq desc
 		(setq desc