emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/org-auto-tangle 5b6071c564 1/2: Error while building the N


From: ELPA Syncer
Subject: [nongnu] elpa/org-auto-tangle 5b6071c564 1/2: Error while building the NonGNU ELPA tarball of org-auto-tangle
Date: Sat, 2 Jul 2022 05:58:50 -0400 (EDT)

branch: elpa/org-auto-tangle
commit 5b6071c5649ed648c97cd2deebf74fe633f7f0d0
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: yilkalargaw <yilkalargawworkneh@gmail.com>

    Error while building the NonGNU ELPA tarball of org-auto-tangle
    
    Hi,
    
    As the `Subject:` suggests, elpa.nongnu.org encountered an error while
    building the tarball, because `org-auto-tangle.el` fails to include
    a valid email address to send notifications.
    
    The patch below fixes that; it also comes with an unrelated and untested
    patch for `org-auto-tangle-async` which makes it use closures rather than
    quoted lambdas (prompted by a parenthesis error in the previous code,
    and then I got carried away :-).
    
            Stefan
---
 org-auto-tangle.el | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/org-auto-tangle.el b/org-auto-tangle.el
index 1e004edf59..bf4389e8f3 100644
--- a/org-auto-tangle.el
+++ b/org-auto-tangle.el
@@ -1,6 +1,6 @@
 ;;; org-auto-tangle.el --- Automatically and Asynchronously tangles org files 
on save -*- lexical-binding: t; -*-
 
-;; Author: Yilkal Argaw
+;; Author: Yilkal Argaw <yilkalargawworkneh@gmail.com>
 ;; URL: https://github.com/yilkalargaw/org-auto-tangle
 ;; Version: 0.4.2
 ;; Keywords: outlines
@@ -47,6 +47,7 @@
 ;;; Code:
 
 (require 'async)
+(require 'cl-lib)
 (require 'org)
 
 (defvar org-auto-tangle-default nil
@@ -77,20 +78,23 @@ for a specific file, add its full path to this list.")
   "Invoke `org-babel-tangle-file' asynchronously on FILE."
   (message "Tangling %s..." (buffer-file-name))
   (async-start
-   (let ((args (list file)))
-     `(lambda ()
-        (require 'org)
-        (let ((start-time (current-time))
-              (non-essential t)
-              (org-confirm-babel-evaluate (not (member ,file 
',org-auto-tangle-babel-safelist)))
-              (org-src-preserve-indentation ,org-src-preserve-indentation)
-              (org-babel-pre-tangle-hook ,org-babel-pre-tangle-hook)
-              (org-babel-post-tangle-hook ,org-babel-post-tangle-hook)))
-          (apply #'org-babel-tangle-file ',args)
-          (format "%.2f" (float-time (time-since start-time))))))
+   (let ((preserved (mapcar (lambda (v)
+                              (cons v (symbol-value v)))
+                            '(org-src-preserve-indentation
+                              org-babel-pre-tangle-hook
+                              org-babel-post-tangle-hook)))
+         (evaluate (not (member file org-auto-tangle-babel-safelist))))
+     (lambda ()
+       (require 'org)
+       (let ((start-time (current-time))
+             (non-essential t)
+             (org-confirm-babel-evaluate evaluate))
+         (cl-progv (mapcar #'car preserved) (mapcar #'cdr preserved)
+           (org-babel-tangle-file file))
+         (format "%.2f" (float-time (time-since start-time))))))
    (let ((message-string (format "Tangling %S completed after" file)))
-     `(lambda (tangle-time)
-        (message "%s %s seconds",message-string tangle-time)))))
+     (lambda (tangle-time)
+       (message "%s %s seconds" message-string tangle-time)))))
 
 (defun org-auto-tangle-tangle-if-needed ()
   "Call org-auto-tangle-async if needed.



reply via email to

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