#+begin_src diff
modified    lisp/org-attach.el
@@ -629,7 +629,6 @@ (defun org-attach-attach (file &optional visit-dir method)
             (url-copy-file file attach-file)
           (error "The remote resource %S is considered unsafe, and will not be 
downloaded"
                  file))))
-      (run-hook-with-args 'org-attach-after-change-hook attach-dir)
       (org-attach-tag)
       (cond ((eq org-attach-store-link-p 'attached)
              (setq link (concat "attachment:" (file-name-nondirectory 
attach-file))
@@ -647,6 +646,7 @@ (defun org-attach-attach (file &optional visit-dir method)
              ;; Do not save link, just return.
              (setq link (concat "attachment:" (file-name-nondirectory 
attach-file))
                    description (file-name-nondirectory attach-file))))
+      (run-hook-with-args 'org-attach-after-change-hook attach-dir)
       (if visit-dir
           (dired attach-dir)
         (message "File %S is now an attachment" basename))
#+end_src

I think the org-attach-after-change-hook should run at the end of other code 
include the link store code.

Because it only have one-line change, I think it's not necessary let me
to submit patch. Hope Ihor can modify it directly if accept this modification.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

Attachment: signature.asc
Description: PGP signature

Reply via email to