From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: org-player and switch to lexical binding in org.el Date: Sun, 17 Jan 2016 22:05:03 +0100 Message-ID: References: <877fj8j5wx.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKuVV-0002Pl-LC for emacs-orgmode@gnu.org; Sun, 17 Jan 2016 16:05:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKuVU-00052u-NA for emacs-orgmode@gnu.org; Sun, 17 Jan 2016 16:05:05 -0500 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:38724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKuVU-00052k-Gy for emacs-orgmode@gnu.org; Sun, 17 Jan 2016 16:05:04 -0500 Received: by mail-wm0-x230.google.com with SMTP id b14so95880442wmb.1 for ; Sun, 17 Jan 2016 13:05:04 -0800 (PST) In-Reply-To: <877fj8j5wx.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: eeeickythump@gmail.com, Org Mode Hi Paul It seems that this is beyond of my knowledge and I would like to ask you as the author of org-player for help. On Sun, Jan 17, 2016 at 9:40 PM, Nicolas Goaziou wrote: > Hello, > > Michael Brand 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))))) > > WDYT? > > > Regards, > > -- > Nicolas Goaziou Michael