Hi Nicolas

On Sat, Feb 6, 2016 at 5:41 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

> IMO, notifying user that there's something rotten in the state of
> `org-file-apps' is enough. There's no need to go into the gory details
> of the problem.

I agree and finally found what I was missing: Add `debug' to the
handler of `condition-case' to finally not disable support of further
investigation with `toggle-debug-on-error'. It obsoletes my trials to
provide enough context about the Lisp error in the handler itself.
Remixed patch for review attached.

Michael
From 96aa89840c15c71c534faa0ce265530d5ff88c0a Mon Sep 17 00:00:00 2001
From: Michael Brand <michael.br...@alumni.ethz.ch>
Date: Sun, 7 Feb 2016 11:07:56 +0100
Subject: [PATCH] `org-file-apps' add migration hint for function signature

* lisp/org.el (org-open-file): Add a user error for when the function
signature does not match.
---
 lisp/org.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index cce4f3a..e77fd4a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11325,15 +11325,22 @@ 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 nil
+	    (funcall cmd file link)
+	  ;; FIXME: Remove this check when most default installations
+	  ;; of Emacs have at least Org 9.0.
+	  ((debug 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: %S" cmd)))))
      ((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)

Reply via email to