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: Fri, 29 Jan 2016 21:39:04 +0100 Message-ID: References: <877fj8j5wx.fsf@nicolasgoaziou.fr> <87oac4a4v2.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]:40057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPFox-0008Hu-I9 for emacs-orgmode@gnu.org; Fri, 29 Jan 2016 15:39:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPFow-0002cT-48 for emacs-orgmode@gnu.org; Fri, 29 Jan 2016 15:39:07 -0500 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:33434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPFov-0002bV-Sy for emacs-orgmode@gnu.org; Fri, 29 Jan 2016 15:39:06 -0500 Received: by mail-wm0-x233.google.com with SMTP id l66so82369165wml.0 for ; Fri, 29 Jan 2016 12:39:05 -0800 (PST) In-Reply-To: <87oac4a4v2.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: Org Mode Cc: Paul Sexton Hi Nicolas On Fri, Jan 29, 2016 at 2:32 PM, Nicolas Goaziou wrote: > My suggestion was hypothetical, and not yet implemented. No wonder it > doesn't work. > > If you think this change sounds reasonable, I can implement it, tho. > However, there is some backward incompatibility involved. > > The current solution, i.e., using `eval' only provides `file' symbol. Only slowly I begin to get it partially. My observation is that if the current `org-open-file' would be changed to (eval cmd ;; LEXICAL argument. `((file . ,(convert-standard-filename file)) (link . ,dlink))) to provide also the `link' symbol then a (add-to-list 'org-file-apps (cons (concat org-player-file-extensions-regexp "::\\([0-9]+:[0-9]+\\(:[0-9]+\\)?\\)") '(org-player-play-file file (match-string 1 link)))) which is simple enough for me to understand in org-player.el works. This situation looks favorable to me at least for a first step because it would mean a version of org-player.el that remains compatible with "any" Org before lexical binding in org.el (release_8.3.3-426-g1f49e9f) but would also become compatible again starting with one of the next commits in Org master. Do I understand correct that this would not break any backward compatibility with all other existing and correct use of `org-file-apps'? On Sun, Jan 17, 2016 at 9:40 PM, Nicolas Goaziou wrote: > 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). I am concerned about backward compatibility and don't understand the lambda part enough: Would backward compatibility be broken only for org-player.el or also for other existing and correct use of `org-file-apps'? Or can `org-open-file' support both for some time like this?: (if (eq (car cmd) 'lambda) ;; Function. (funcall cmd (convert-standard-filename file) dlink) ;; Sexp, deprecated. (eval cmd `((file . ,(convert-standard-filename file)) (link . ,dlink)))) Michael