emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-pdfview-open doesn't work anymore


From: Michael Brand
Subject: Re: [O] org-pdfview-open doesn't work anymore
Date: Sat, 6 Feb 2016 09:08:37 +0100

Hi Nicolas

On Fri, Feb 5, 2016 at 11:43 PM, Nicolas Goaziou <address@hidden> wrote:

> Michael Brand <address@hidden> writes:

>> +     ;; FIXME: Remove this check when most default installations of
>> +     ;; Emacs have at least Org 9.0.
>> +     ((wrong-number-of-arguments invalid-function)
>> +      (user-error
>> +       (concat
>> +        "Please see Org News for version 9.0 about `org-file-apps', "
>> +        "error: "
>> +        (prin1-to-string err))))))
>
> (user-error
>  "Please see Org News for version 9.0 about `org-file-apps', error: %S"
>  (nth 1 err))

The above does not provide (nth 0 err) which is the important error
type and (nth 2 err) which I find also helpful. See following zerop
examples.

What am I missing that it should not be

    ((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" err))

to get

    Please see Org News for version 9.0 about \
    `org-file-apps'--Lisp error: (wrong-number-of-arguments zerop 2)

    Please see Org News for version 9.0 about \
    `org-file-apps'--Lisp error: (wrong-type-argument numberp nil)

from

    (condition-case err (zerop nil nil) ...)

    (condition-case err (zerop nil) ...)

to mimic

    Debugger entered--Lisp error: (wrong-number-of-arguments zerop 2)

    Debugger entered--Lisp error: (wrong-type-argument numberp nil)

from

    (zerop nil nil)

    (zerop nil)

as far as possible?

I just notice that in our case at least in case of wrong-type-argument the
`cmd' is missing, so I suggest

    ((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))

for the attached intermediate patch version. For the above example of
(zerop nil) it would not only report "wrong-type-argument" and
"numberp" together with "nil" but also "zerop" which in our case is
the registered application, the source of the problem where the user
needs to look.

Michael

Attachment: 0001-org-file-apps-add-migration-hint-for-function-signat.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]