emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#39375: closed ([PATCH] gnu: emacs-utils: Port to emacs-next.)


From: GNU bug Tracking System
Subject: bug#39375: closed ([PATCH] gnu: emacs-utils: Port to emacs-next.)
Date: Tue, 31 Aug 2021 02:45:02 +0000

Your message dated Mon, 30 Aug 2021 22:44:11 -0400
with message-id <87fsuqjptw.fsf@gmail.com>
and subject line Re: bug#39375: [PATCH] gnu: emacs-utils: Port to emacs-next.
has caused the debbugs.gnu.org bug report #39375,
regarding [PATCH] gnu: emacs-utils: Port to emacs-next.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
39375: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39375
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] gnu: emacs-utils: Port to emacs-next. Date: Fri, 31 Jan 2020 21:02:23 +0100
* guix/build/emacs-utils.scm (emacs-batch-eval*): New variable.
(emacs-generate-autoloads): Redefine in terms of emacs-batch-eval*.
Require autoload (needed with emacs-next).
---
 guix/build/emacs-utils.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index 885fd0a217..1462f9d0af 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -23,6 +23,7 @@
   #:use-module (guix build utils)
   #:export (%emacs
             emacs-batch-eval
+            emacs-batch-eval*
             emacs-batch-edit-file
             emacs-batch-disable-compilation
             emacs-generate-autoloads
@@ -46,6 +47,14 @@
   (invoke (%emacs) "--quick" "--batch"
           (format #f "--eval=~S" expr)))
 
+(define (emacs-batch-eval* . exprs)
+  "Run Emacs in batch mode, and execute all of the elisp expressions EXPRS."
+  (apply invoke (%emacs) "--quick" "--batch"
+         (map
+          (lambda (expr)
+            (format #f "--eval=~S" expr))
+          exprs)))
+
 (define (emacs-batch-edit-file file expr)
   "Load FILE in Emacs using batch mode, and execute the elisp code EXPR."
   (invoke (%emacs) "--quick" "--batch"
@@ -64,7 +73,7 @@
          (expr `(let ((backup-inhibited t)
                       (generated-autoload-file ,file))
                   (update-directory-autoloads ,directory))))
-    (emacs-batch-eval expr)))
+    (emacs-batch-eval* '(require 'autoload) expr)))
 
 (define* (emacs-byte-compile-directory dir)
   "Byte compile all files in DIR and its sub-directories."
-- 
2.25.0




--- End Message ---
--- Begin Message --- Subject: Re: bug#39375: [PATCH] gnu: emacs-utils: Port to emacs-next. Date: Mon, 30 Aug 2021 22:44:11 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Hi Leo,

Leo Prikler <leo.prikler@student.tugraz.at> writes:

> Hi Maxim,
>
> Am Montag, den 30.08.2021, 16:16 -0400 schrieb Maxim Cournoyer:
>> Hi Leo,
>> 
>> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>> 
>> > Hi Leo,
>> > 
>> > Leo Prikler <leo.prikler@student.tugraz.at> writes:
>> > 
>> > > * guix/build/emacs-utils.scm (emacs-batch-eval*): New variable.
>> > > (emacs-generate-autoloads): Redefine in terms of emacs-batch-
>> > > eval*.
>> > > Require autoload (needed with emacs-next).
>> > > ---
>> > >  guix/build/emacs-utils.scm | 11 ++++++++++-
>> > >  1 file changed, 10 insertions(+), 1 deletion(-)
>> > > 
>> > > diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-
>> > > utils.scm
>> > > index 885fd0a217..1462f9d0af 100644
>> > > --- a/guix/build/emacs-utils.scm
>> > > +++ b/guix/build/emacs-utils.scm
>> > > @@ -23,6 +23,7 @@
>> > >    #:use-module (guix build utils)
>> > >    #:export (%emacs
>> > >              emacs-batch-eval
>> > > +            emacs-batch-eval*
>> > >              emacs-batch-edit-file
>> > >              emacs-batch-disable-compilation
>> > >              emacs-generate-autoloads
>> > > @@ -46,6 +47,14 @@
>> > >    (invoke (%emacs) "--quick" "--batch"
>> > >            (format #f "--eval=~S" expr)))
>> > >  
>> > > +(define (emacs-batch-eval* . exprs)
>> > > +  "Run Emacs in batch mode, and execute all of the elisp
>> > > expressions EXPRS."
>> > > +  (apply invoke (%emacs) "--quick" "--batch"
>> > > +         (map
>> > > +          (lambda (expr)
>> > > +            (format #f "--eval=~S" expr))
>> > > +          exprs)))
>> > > +
>> > >  (define (emacs-batch-edit-file file expr)
>> > >    "Load FILE in Emacs using batch mode, and execute the elisp
>> > > code EXPR."
>> > >    (invoke (%emacs) "--quick" "--batch"
>> > > @@ -64,7 +73,7 @@
>> > >           (expr `(let ((backup-inhibited t)
>> > >                        (generated-autoload-file ,file))
>> > >                    (update-directory-autoloads ,directory))))
>> > > -    (emacs-batch-eval expr)))
>> > > +    (emacs-batch-eval* '(require 'autoload) expr)))
>> > >  
>> > >  (define* (emacs-byte-compile-directory dir)
>> > >    "Byte compile all files in DIR and its sub-directories."
>> > 
>> > As I wrote here <https://bugs.gnu.org/39804>;, I think we have
>> > something
>> > fundamentally flawed in our Emacs 27 build, which I'd like to have
>> > addressed at its core.
>> 
>> Correct me if I'm wrong, but I think we ended up addressing the issue
>> differently at the time, right?  If you confirm that this is no
>> longer
>> needed, let's close it!
> On the top of my head I can't think of any use for multiple --eval
> lines when you can switch between lexical and dynamic scoping at will. 
> Perhaps in the future we might find one, but if you want to close this
> bug in the meantime, go ahead.

Yeah, the main value this patch was bringing was fixing an error on
Emacs 27 that was caused by going to lexical scope even when using
--eval (your fix was to require autoload in (emacs-batch-eval* '(require
'autoload) expr)).  The fixed that ended up being pushed was this:

--8<---------------cut here---------------start------------->8---
(define* (emacs-batch-eval expr #:key dynamic?)
  "Run Emacs in batch mode, and execute the Elisp code EXPR.  If DYNAMIC? is
true, evaluate using dynamic scoping."
  (invoke (%emacs) "--quick" "--batch"
          (format #f "--eval=(eval '~a ~:[t~;nil~])"
                  (expr->string expr) dynamic?)))
--8<---------------cut here---------------end--------------->8---

Which allows requesting dynamic scope.

Closing.

Thank you!

Maxim


--- End Message ---

reply via email to

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