[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-real 60b0eb8822 011/188: Switched to before and aft
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-real 60b0eb8822 011/188: Switched to before and after advice for advising `org-insert-link' |
Date: |
Sun, 5 May 2024 22:55:48 -0400 (EDT) |
branch: externals/org-real
commit 60b0eb88228f8c961bb7bdb90cc0681ac529ef06
Author: Amy Grinn <grinn.amy@gmail.com>
Commit: Amy Grinn <grinn.amy@gmail.com>
Switched to before and after advice for advising `org-insert-link'
---
org-real.el | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/org-real.el b/org-real.el
index e6ca418f31..ce63639cc5 100644
--- a/org-real.el
+++ b/org-real.el
@@ -421,27 +421,29 @@ matching the one returned from `completing-read'."
existing-containers
`((:name ,result)))))
-(defun org-real--read-string-advice (orig prompt link)
+(defun org-real--read-string-advice (orig prompt link &rest args)
"Advise `read-string' during `org-insert-link' to use custom completion.
ORIG is `read-string', PROMPT and LINK are the arguments passed
to it."
(if (string= "real" (ignore-errors (url-type (url-generic-parse-url link))))
(org-real-complete link)
- (funcall orig prompt link)))
+ (apply orig prompt link args)))
-(defun org-real--insert-link-advice (orig &rest args)
+(defun org-real--insert-link-before (&rest args)
"Advise `org-insert-link' to advise `read-string' during editing of a link.
-ORIG is `org-insert-link' and ARGS are the arguments passed to
-it."
- (advice-add 'read-string :around #'org-real--read-string-advice)
- (if (called-interactively-p 'any)
- (call-interactively orig)
- (apply orig args))
+ARGS are the arguments passed to `org-insert-link'."
+ (advice-add 'read-string :around #'org-real--read-string-advice))
+
+(defun org-real--insert-link-after (&rest args)
+ "Advise `org-insert-link' to advise `read-string' during editing of a link.
+
+ARGS are the arguments passed to `org-insert-link'."
(advice-remove 'read-string #'org-real--read-string-advice))
-(advice-add 'org-insert-link :around #'org-real--insert-link-advice)
+(advice-add 'org-insert-link :before #'org-real--insert-link-before)
+(advice-add 'org-insert-link :after #'org-real--insert-link-after)
;;;; Pretty printing
- [elpa] branch externals/org-real created (now 50bae7669a), ELPA Syncer, 2024/05/05
- [elpa] externals/org-real af65462071 002/188: Removed unused box slot, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 02fc94713a 012/188: Add new line after pp text, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 86f74a610c 009/188: Use .el file instead of .tar in release job, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real b5f3faca0f 004/188: Added alias "on" for "in", ELPA Syncer, 2024/05/05
- [elpa] externals/org-real db6efe2c05 016/188: Updated readme, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 60b0eb8822 011/188: Switched to before and after advice for advising `org-insert-link',
ELPA Syncer <=
- [elpa] externals/org-real 4a2c309502 008/188: Removed server stage from ci/cd, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 6c292d87f5 023/188: Make changes to satisfy elc compiler, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 4212ff77d7 024/188: Check compilation during ci/cd pipeline, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real c3a60a0b1c 017/188: Shift other things to the right or below when merging, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 10759079fd 033/188: Updated README, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 13d23426e8 020/188: find-last index returns nil if no match, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real c365085bf3 043/188: Patch for using cl-defmethod rather than defun, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real a683c9ef76 048/188: Using stored values for computing top left width and height, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 26ffd84525 039/188: Merge branch 'next' into 'main', ELPA Syncer, 2024/05/05
- [elpa] externals/org-real ecb1ba179e 050/188: Added 'on top of' preposition; update customization vars, ELPA Syncer, 2024/05/05