forked from mirrors/org-mode
org-insert-link: Do not expand path arg when `org-link-file-path-type' is a function
* lisp/ol.el (org-insert-link): Drop `expand-file-name'. (org-link-file-path-type): Update docstring. * etc/ORG-NEWS (When ~org-link-file-path-type~ is a function, its argument is now a filename as it in the link; not an absolute path): Announce the change. Link: https://orgmode.org/list/871qahl0un.fsf@localhost
This commit is contained in:
parent
c9fc4c03e8
commit
388ba5b5c4
|
@ -13,6 +13,12 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
|
|||
|
||||
* Version 9.7 (not released yet)
|
||||
** Important announcements and breaking changes
|
||||
*** When ~org-link-file-path-type~ is a function, its argument is now a filename as it is read by ~org-insert-link~; not an absolute path
|
||||
|
||||
Previously, when ~org-link-file-path-type~ is set to a function, the
|
||||
function argument was the filename from the link expanded via
|
||||
~expand-file-name~. Now, a bare filename is passed to the function.
|
||||
|
||||
*** Org export backends can now disable citation processors
|
||||
|
||||
A new global export option ~:with-cite-processors~, when set to nil,
|
||||
|
|
|
@ -246,7 +246,7 @@ adaptive Use relative path for files in the current directory and sub-
|
|||
directories of it. For other files, use an absolute path.
|
||||
|
||||
Alternatively, users may supply a custom function that takes the
|
||||
full filename as an argument and returns the path."
|
||||
filename in the link as an argument and returns the path."
|
||||
:group 'org-link
|
||||
:type '(choice
|
||||
(const relative)
|
||||
|
@ -1979,8 +1979,7 @@ non-interactively, don't allow to edit the default description."
|
|||
((eq org-link-file-path-type 'relative)
|
||||
(setq path (file-relative-name path)))
|
||||
((functionp org-link-file-path-type)
|
||||
(setq path (funcall org-link-file-path-type
|
||||
(expand-file-name path))))
|
||||
(setq path (funcall org-link-file-path-type path)))
|
||||
(t
|
||||
(save-match-data
|
||||
(if (string-match (concat "^" (regexp-quote
|
||||
|
|
Loading…
Reference in New Issue