From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Tangling is broken in git master Date: Sun, 12 Aug 2012 10:43:46 +0200 Message-ID: <871ujc33gd.fsf@gnu.org> References: <87628oncqa.fsf@norang.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0TlZ-0000yc-9l for emacs-orgmode@gnu.org; Sun, 12 Aug 2012 04:43:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0TlX-00030x-W0 for emacs-orgmode@gnu.org; Sun, 12 Aug 2012 04:43:21 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:44555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0TlX-00030t-MV for emacs-orgmode@gnu.org; Sun, 12 Aug 2012 04:43:19 -0400 Received: by wgbez12 with SMTP id ez12so2003733wgb.30 for ; Sun, 12 Aug 2012 01:43:18 -0700 (PDT) In-Reply-To: <87628oncqa.fsf@norang.ca> (Bernt Hansen's message of "Sat, 11 Aug 2012 21:03:09 -0400") 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: Bernt Hansen Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi Bernt, Bernt Hansen writes: > Tangling doesn't work for me in git master anymore. Git bisect > identifies the following commit as introducing the problem Please try the attached patch and let us know if it works. Thanks, --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-compat.el-New-alias-org-letrec-for-labels.patch >From 45c517919756b7af78b720e454e8ea8d969f6a43 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sun, 12 Aug 2012 10:41:28 +0200 Subject: [PATCH] org-compat.el: New alias 'org-letrec for 'labels * org-compat.el: New alias 'org-letrec for 'labels. * org-bibtex.el (org-compat): Require. (org-bibtex-headline): Use the `org-letrec' alias. * ob.el (org-compat): Require. (org-babel-noweb-p): Use the `org-letrec' alias. --- lisp/ob.el | 12 +++++++----- lisp/org-bibtex.el | 42 ++++++++++++++++++++++-------------------- lisp/org-compat.el | 2 ++ 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index a6d1359..79f12f7 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -27,6 +27,7 @@ (require 'cl)) (require 'ob-eval) (require 'org-macs) +(require 'org-compat) (defconst org-babel-exeext (if (memq system-type '(windows-nt cygwin)) @@ -2223,11 +2224,12 @@ header argument from buffer or subtree wide properties.") (defun org-babel-noweb-p (params context) "Check if PARAMS require expansion in CONTEXT. CONTEXT may be one of :tangle, :export or :eval." - (letrec ((intersect (lambda (as bs) - (when as - (if (member (car as) bs) - (car as) - (funcall intersect (cdr as) bs)))))) + (org-letrec + ((intersect (lambda (as bs) + (when as + (if (member (car as) bs) + (car as) + (funcall intersect (cdr as) bs)))))) (funcall intersect (case context (:tangle '("yes" "tangle" "no-export" "strip-export")) (:eval '("yes" "no-export" "strip-export" "eval")) diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el index 43b3c41..f857459 100644 --- a/lisp/org-bibtex.el +++ b/lisp/org-bibtex.el @@ -111,6 +111,7 @@ (require 'bibtex) (eval-when-compile (require 'cl)) +(require 'org-compat) (defvar org-bibtex-description nil) ; dynamically scoped from org.el (defvar org-id-locations) @@ -309,26 +310,27 @@ This variable is relevant only if `org-bibtex-export-tags-as-keywords` is t." (defun org-bibtex-headline () "Return a bibtex entry of the given headline as a string." - (letrec ((val (lambda (key lst) (cdr (assoc key lst)))) - (to (lambda (string) (intern (concat ":" string)))) - (from (lambda (key) (substring (symbol-name key) 1))) - (flatten (lambda (&rest lsts) - (apply #'append (mapcar - (lambda (e) - (if (listp e) (apply flatten e) (list e))) - lsts)))) - (notes (buffer-string)) - (id (org-bibtex-get org-bibtex-key-property)) - (type (org-bibtex-get org-bibtex-type-property-name)) - (tags (when org-bibtex-tags-are-keywords - (delq nil - (mapcar - (lambda (tag) - (unless (member tag - (append org-bibtex-tags - org-bibtex-no-export-tags)) - tag)) - (org-get-local-tags-at)))))) + (org-letrec + ((val (lambda (key lst) (cdr (assoc key lst)))) + (to (lambda (string) (intern (concat ":" string)))) + (from (lambda (key) (substring (symbol-name key) 1))) + (flatten (lambda (&rest lsts) + (apply #'append (mapcar + (lambda (e) + (if (listp e) (apply flatten e) (list e))) + lsts)))) + (notes (buffer-string)) + (id (org-bibtex-get org-bibtex-key-property)) + (type (org-bibtex-get org-bibtex-type-property-name)) + (tags (when org-bibtex-tags-are-keywords + (delq nil + (mapcar + (lambda (tag) + (unless (member tag + (append org-bibtex-tags + org-bibtex-no-export-tags)) + tag)) + (org-get-local-tags-at)))))) (when type (let ((entry (format "@%s{%s,\n%s\n}\n" type id diff --git a/lisp/org-compat.el b/lisp/org-compat.el index b049ecc..5f410bd 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -110,6 +110,8 @@ any other entries, and any resulting duplicates will be removed entirely." t)) t))) +(defalias 'org-letrec (if (>= emacs-major-version 24) 'letrec 'labels) + ;;;; Emacs/XEmacs compatibility -- 1.7.10.2 --=-=-= Content-Type: text/plain -- Bastien --=-=-=--