Skip to content

Commit 33686b9

Browse files
maxnikulinyantar92
authored andcommitted
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: c8a3ab1 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
1 parent eb5ef0a commit 33686b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lisp/org.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8002,7 +8002,7 @@ a parameter."
80028002
(> (regexp-opt-depth selector) 0)
80038003
(or (and (stringp action)
80048004
(string-match "%[0-9]" action))
8005-
(consp action))))
8005+
(functionp action))))
80068006
(_ nil)))
80078007

80088008
(defun org--file-apps-regexp-alist (list &optional add-auto-mode)

0 commit comments

Comments
 (0)