emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Bernt Hansen <bernt@norang.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: Tangling is broken in git master
Date: Sun, 12 Aug 2012 10:43:46 +0200	[thread overview]
Message-ID: <871ujc33gd.fsf@gnu.org> (raw)
In-Reply-To: <87628oncqa.fsf@norang.ca> (Bernt Hansen's message of "Sat, 11 Aug 2012 21:03:09 -0400")

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

Hi Bernt,

Bernt Hansen <bernt@norang.ca> 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,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-compat.el-New-alias-org-letrec-for-labels.patch --]
[-- Type: text/x-patch, Size: 4048 bytes --]

From 45c517919756b7af78b720e454e8ea8d969f6a43 Mon Sep 17 00:00:00 2001
From: Bastien Guerry <bzg@altern.org>
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)
+
 \f
 ;;;; Emacs/XEmacs compatibility
 
-- 
1.7.10.2


[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

  parent reply	other threads:[~2012-08-12  8:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-12  1:03 Tangling is broken in git master Bernt Hansen
2012-08-12  6:27 ` Achim Gratz
2012-08-13  1:57   ` Bernt Hansen
2012-08-12  8:43 ` Bastien [this message]
2012-08-13  1:55   ` Bernt Hansen
2012-08-13  5:43     ` Bastien
2012-08-13 13:44       ` Eric Schulte
2012-08-13 13:56         ` Bastien
2012-08-13 14:18           ` Eric Schulte
2012-08-13 14:42             ` Bastien
2012-08-13 15:25               ` Nicolas Goaziou
2012-08-13 19:00                 ` Bastien
2012-08-13 14:46             ` Nick Dokos
2012-08-13 14:53               ` Bastien
2012-08-13 15:38                 ` Nick Dokos
2012-08-13 19:00                   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ujc33gd.fsf@gnu.org \
    --to=bzg@gnu.org \
    --cc=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).