[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org c3d6672cfd 5/6: ol.el: Avoid links like "[[target][
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org c3d6672cfd 5/6: ol.el: Avoid links like "[[target][file:~/org/test.org::target]]" |
Date: |
Tue, 13 Sep 2022 09:58:03 -0400 (EDT) |
branch: externals/org
commit c3d6672cfdbff8c9dd4c2ec70886ad3f62153d07
Author: Max Nikulin <manikulin@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
ol.el: Avoid links like "[[target][file:~/org/test.org::target]]"
* lisp/ol.el (org-store-link): Do not set description for "<<target>>"
links to avoid case when it is more detailed than link target.
While inserting to the same file, file part of the link target is
stripped, description is inserted without modification. I do not think,
file path adds real value in comparison to "[[target]]" link to some
point in the same file. A side effect is user prompt for description
since link and description are not identical any more.
---
lisp/ol.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lisp/ol.el b/lisp/ol.el
index eacc69deb2..b97af3dbc8 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1663,12 +1663,17 @@ non-nil."
(cond
;; Store a link using the target at point
((org-in-regexp "[^<]<<\\([^<>]+\\)>>[^>]" 1)
- (setq cpltxt
+ (setq link
(concat "file:"
(abbreviate-file-name
(buffer-file-name (buffer-base-buffer)))
"::" (match-string 1))
- link cpltxt
+ ;; Target may be shortened when link is inserted.
+ ;; Avoid [[target][file:~/org/test.org::target]]
+ ;; links. Maybe the case of identical target and
+ ;; description should be handled by `org-insert-link'.
+ cpltxt nil
+ desc nil
;; Do not append #CUSTOM_ID link below.
custom-id nil))
((and (featurep 'org-id)
- [elpa] externals/org updated (0432f4fe6b -> 4fc2c8dd89), ELPA Syncer, 2022/09/13
- [elpa] externals/org 4d8c6fbf7a 1/6: org-up-heading-safe: Consider inlinetasks, ELPA Syncer, 2022/09/13
- [elpa] externals/org 543a23a57d 3/6: Revert "lisp/ol.el: Fix bug when storing links", ELPA Syncer, 2022/09/13
- [elpa] externals/org 4fc2c8dd89 6/6: org-store-link: Default to empty description for target/custom-id links, ELPA Syncer, 2022/09/13
- [elpa] externals/org f7b8510283 4/6: ol.el: Skip #CUSTOM_ID when <<target>> link is stored, ELPA Syncer, 2022/09/13
- [elpa] externals/org c3d6672cfd 5/6: ol.el: Avoid links like "[[target][file:~/org/test.org::target]]",
ELPA Syncer <=
- [elpa] externals/org 2737128aa7 2/6: org-back-to-heading: Use cache, ELPA Syncer, 2022/09/13