[Top][All Lists]

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

Re: [O] org-player and switch to lexical binding in org.el

From: Michael Brand
Subject: Re: [O] org-player and switch to lexical binding in org.el
Date: Thu, 28 Jan 2016 12:37:00 +0100

Hi Nicolas

On Sun, Jan 17, 2016 at 9:40 PM, Nicolas Goaziou <address@hidden> wrote:
> Hello,
> Michael Brand <address@hidden> writes:
>> release_8.3.3-426-g1f49e9f introduces a regression. The link
>>     [[file:/dir/audio.mp3::0:12:34]]
>> results in
>>     Debugger entered--Lisp error: (void-variable search)
>>       (org-player-play-file file search)
>>       [...]
>>       org-open-file("/dir/audio.mp3" nil nil "0:12:34")
>>       [...]
> `search' never was advertised as a dynamically scoped variable in
> `org-file-apps' docstring, so "org-player" is just playing with fire
> here.
> I don't like the current solution either (eval with a LEXICAL argument).
> I think it would be better to use un function with two arguments (file
> and link-string instead). This is not backward compatible, but the
> change is trivial: sexp -> (lambda (file link) sexp).
> In the current case, you need to use match string:
>   (add-to-list 'org-file-apps
>                (cons (concat org-player-file-extensions-regexp
>                              "::\\([0-9]+:[0-9]+\\(:[0-9]+\\)?\\)")
>                      (lambda (file link)
>                        (org-player-play-file file (match-string 1 link)))))

I am still not able to get your suggestion that Paul has implemented
in the meantime in org-player.el 1.0.1 to work. Now I am trying to
understand what I am missing with the lambda.

Has the (eval cmd) in org-open-file to be extended somehow to the
variant (funcall cmd) as lambda evaluates to itself?


reply via email to

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