From 873e99c9ee03594e45dd3e82d880c4b8a90d2192 Mon Sep 17 00:00:00 2001 From: Michael Brand Date: Sat, 6 Feb 2016 09:03:17 +0100 Subject: [PATCH] `org-file-apps' add migration hint for function signature * lisp/org.el (org-open-file): Add an error for when the function signature does not match. --- lisp/org.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index cce4f3a..cacae0f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11325,15 +11325,21 @@ If the file does not exist, an error is thrown." ((functionp cmd) (save-match-data (set-match-data link-match-data) - (funcall cmd file link))) + (condition-case err + (funcall cmd file link) + ;; FIXME: Remove this check when most default installations + ;; of Emacs have at least Org 9.0. + ((wrong-number-of-arguments wrong-type-argument invalid-function) + (user-error "Please see Org News for version 9.0 about \ +`org-file-apps'--Lisp error: The function %S leads to %S" cmd err))))) ((consp cmd) ;; FIXME: Remove this check when most default installations of ;; Emacs have at least Org 9.0. ;; Heads-up instead of silently fall back to ;; `org-link-frame-setup' for an old usage of `org-file-apps' ;; with sexp instead of a function for `cmd'. - (user-error - "Please see Org News for version 9.0 about `org-file-apps'")) + (user-error "Please see Org News for version 9.0 about \ +`org-file-apps'--error: Deprecated usage of %S" cmd)) (t (funcall (cdr (assq 'file org-link-frame-setup)) file))) (and (derived-mode-p 'org-mode) (eq old-mode 'org-mode) -- 2.4.9 (Apple Git-60)