mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-12 23:39:54 +00:00
org-store-link: Default to empty description for target/custom-id links
* lisp/ol.el (org-store-link): Use empty description by default (ask user).
This commit is contained in:
parent
c3d6672cfd
commit
4fc2c8dd89
13
lisp/ol.el
13
lisp/ol.el
|
@ -1567,10 +1567,8 @@ non-nil."
|
||||||
t))))
|
t))))
|
||||||
(setq link (plist-get org-store-link-plist :link))
|
(setq link (plist-get org-store-link-plist :link))
|
||||||
;; If store function actually set `:description' property, use
|
;; If store function actually set `:description' property, use
|
||||||
;; it, even if it is nil. Otherwise, fallback to link value.
|
;; it, even if it is nil. Otherwise, fallback to nil (ask user).
|
||||||
(setq desc (if (plist-member org-store-link-plist :description)
|
(setq desc (plist-get org-store-link-plist :description)))
|
||||||
(plist-get org-store-link-plist :description)
|
|
||||||
link)))
|
|
||||||
|
|
||||||
;; Store a link from a remote editing buffer.
|
;; Store a link from a remote editing buffer.
|
||||||
((org-src-edit-buffer-p)
|
((org-src-edit-buffer-p)
|
||||||
|
@ -1687,9 +1685,7 @@ non-nil."
|
||||||
;; 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 (or (plist-get org-store-link-plist
|
(setq desc (plist-get org-store-link-plist :description)))
|
||||||
:description)
|
|
||||||
"")))
|
|
||||||
(error
|
(error
|
||||||
;; Probably before first headline, link only to file
|
;; Probably before first headline, link only to file
|
||||||
(concat "file:"
|
(concat "file:"
|
||||||
|
@ -1751,8 +1747,7 @@ non-nil."
|
||||||
|
|
||||||
;; We're done setting link and desc, clean up
|
;; We're done setting link and desc, clean up
|
||||||
(when (consp link) (setq cpltxt (car link) link (cdr link)))
|
(when (consp link) (setq cpltxt (car link) link (cdr link)))
|
||||||
(setq link (or link cpltxt)
|
(setq link (or link cpltxt))
|
||||||
desc (or desc cpltxt))
|
|
||||||
(cond ((not desc))
|
(cond ((not desc))
|
||||||
((equal desc "NONE") (setq desc nil))
|
((equal desc "NONE") (setq desc nil))
|
||||||
(t (setq desc (org-link-display-format desc))))
|
(t (setq desc (org-link-display-format desc))))
|
||||||
|
|
Loading…
Reference in a new issue