[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-real d557262 011/160: Switched to before and after
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-real d557262 011/160: Switched to before and after advice for advising `org-insert-link' |
Date: |
Wed, 6 Oct 2021 16:58:05 -0400 (EDT) |
branch: externals/org-real
commit d557262556a34947c09bc860d1cac5f5165b73cc
Author: Tyler Grinn <tylergrinn@gmail.com>
Commit: Tyler Grinn <tylergrinn@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 e6ca418..ce63639 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] externals/org-real 93cb91e 133/160: Linting/elc, (continued)
- [elpa] externals/org-real 93cb91e 133/160: Linting/elc, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real eb796dd 149/160: Regression: primary boxes should be highlighted, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 9ab2ad0 158/160: Merge branch 'next' into 'main', ELPA Syncer, 2021/10/06
- [elpa] externals/org-real d5ca314 146/160: Merge branch 'next' into 'main', ELPA Syncer, 2021/10/06
- [elpa] externals/org-real dab4fc9 154/160: Updated readme, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 497ea6c 152/160: Added license, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 2ee4b19 006/160: More edge cases, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 8b3b5c2 005/160: org-real--merge and org-real-world, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 883497d 009/160: Use .el file instead of .tar in release job, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real e039322 012/160: Add new line after pp text, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real d557262 011/160: Switched to before and after advice for advising `org-insert-link',
ELPA Syncer <=
- [elpa] externals/org-real 1fa4417 015/160: Updated README, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real dfcddef 013/160: Added more documentation, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 9ea4553 018/160: Modified logic to allow multiple children, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real a909323 017/160: Shift other things to the right or below when merging, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 6fcc3b9 031/160: Updated md5 command to see tar files, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real d07bf14 020/160: find-last index returns nil if no match, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real a16fed2 032/160: Linting, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 9608f53 030/160: Satisfying elc compiler, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real dbd7b45 037/160: Check for compiler warnings in CI/CD pipeline, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 463da8b 029/160: Refactoring, ELPA Syncer, 2021/10/06