all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] put `org-attach-after-change-hook` at the end of org-attach
@ 2024-08-29  3:36 Christopher M. Miles
  2024-09-22 16:27 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher M. Miles @ 2024-08-29  3:36 UTC (permalink / raw)
  To: Org mode mailing list


[-- Attachment #1.1: Type: text/plain, Size: 147 bytes --]


lisp/org-attach.el (org-attach-attach): Put org-attach-after-change-hook
at the end to make sure user can access attach link in org-store-links.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-org-attach.el-put-org-attach-after-change-hook-at-th.patch --]
[-- Type: text/x-patch, Size: 1584 bytes --]

From f21ef819ab6670f1ed64a731d5d7b5fb29119f33 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Thu, 29 Aug 2024 11:31:53 +0800
Subject: [PATCH] org-attach.el: put org-attach-after-change-hook at the end

lisp/org-attach.el (org-attach-attach): Put org-attach-after-change-hook
at the end to make sure user can access attach link in org-store-links.
---
 lisp/org-attach.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 7a03d170e..d43cbc74c 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -615,8 +615,6 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default taken from
             (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)
 	     (push (list (concat "attachment:" (file-name-nondirectory attach-file))
 			 (file-name-nondirectory attach-file))
@@ -629,6 +627,8 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default taken from
 	     (push (list (concat "file:" attach-file)
 			 (file-name-nondirectory attach-file))
 		   org-stored-links)))
+      (run-hook-with-args 'org-attach-after-change-hook attach-dir)
+      (org-attach-tag)
       (if visit-dir
           (dired attach-dir)
         (message "File %S is now an attachment" basename)))))
-- 
2.39.3 (Apple Git-146)


[-- Attachment #1.3: Type: text/plain, Size: 267 bytes --]


-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-22 16:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29  3:36 [PATCH] put `org-attach-after-change-hook` at the end of org-attach Christopher M. Miles
2024-09-22 16:27 ` Ihor Radchenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.