[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 33686b9955 1/4: org.el: Pass link match data to `or
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 33686b9955 1/4: org.el: Pass link match data to `org-file-apps' functions |
Date: |
Fri, 9 Sep 2022 07:58:00 -0400 (EDT) |
branch: externals/org
commit 33686b9955c011486a72ec548475651dcadb0339
Author: Max Nikulin <manikulin@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org.el: Pass link match data to `org-file-apps' functions
* lisp/org.el (org--file-apps-entry-dlink-p): Fix it to pass match data
to handler functions from `org-open-file' alist when pattern field of
`org-file-apps' contains regexp subgroups.
Update `org--file-apps-entry-dlink-p' to use current convention for action
field of `org-file-apps' structure. Currently it may be a function while
earlier s-expression was allowed. Obsolete test wrongly separated actions
able to handle regexp subgroups matched in the link. An example when
match data were not passed to the handler function:
(add-to-list
'org-file-apps
'("\\.pdf\\(?:\\.gz\\|\\.bz2\\|\\.xz\\)?\\(?:::.*\\)?\\'"
. my-open-pdf-locator))
Notice that lambda functions passed `consp' test, so namely
`defun' is required to reproduce the issue.
This change was missed in the commit:
c8a3ab1e4 2016-02-03 18:30:17 +0100
Nicolas Goaziou: `org-file-apps' accept functions instead of sexp
For discussion of the issue with evaluation of arbitrary expression see
https://list.orgmode.org/CALn3zoh+ACSU09eRurfwKjmCnw7i-_0KX7tA2jWqtu=vvQepLQ@mail.gmail.com/T/#u
Michael Brand. org-player and switch to lexical binding in org.el.
Sun, 17 Jan 2016 19:58:38 +0100
---
lisp/org.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/org.el b/lisp/org.el
index 34560c83ff..3d2fbd2cbc 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8002,7 +8002,7 @@ a parameter."
(> (regexp-opt-depth selector) 0)
(or (and (stringp action)
(string-match "%[0-9]" action))
- (consp action))))
+ (functionp action))))
(_ nil)))
(defun org--file-apps-regexp-alist (list &optional add-auto-mode)