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

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

[elpa] externals/org ad304faea1 1/2: org-attach-attach: Avoid linking to


From: ELPA Syncer
Subject: [elpa] externals/org ad304faea1 1/2: org-attach-attach: Avoid linking to path starting with ~
Date: Mon, 4 Jul 2022 09:57:54 -0400 (EDT)

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

    org-attach-attach: Avoid linking to path starting with ~
    
    * lisp/org-attach.el (org-attach-attach): Auto-expand ~ in the file
    patch when using symlink (`lns') attach method.
    
    Fixes 
https://orgmode.org/list/CAN_Dec_LyTKgSN_kiftee9GULM7FPER5frQFant3n_2C3cwM-g@mail.gmail.com
---
 lisp/org-attach.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 6a061b2b3c..b646ca76dc 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -525,7 +525,8 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default 
taken from
        ((eq method 'mv) (rename-file file attach-file))
        ((eq method 'cp) (copy-file file attach-file))
        ((eq method 'ln) (add-name-to-file file attach-file))
-       ((eq method 'lns) (make-symbolic-link file attach-file))
+       ;; We pass integer third argument to auto-expand "~" in FILE.
+       ((eq method 'lns) (make-symbolic-link file attach-file 1))
        ((eq method 'url) (url-copy-file file attach-file)))
       (run-hook-with-args 'org-attach-after-change-hook attach-dir)
       (org-attach-tag)



reply via email to

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