unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
@ 2020-01-31 20:02 Leo Prikler
  2020-02-27 10:38 ` Pierre Neidhardt
  2020-02-28 14:50 ` Maxim Cournoyer
  0 siblings, 2 replies; 11+ messages in thread
From: Leo Prikler @ 2020-01-31 20:02 UTC (permalink / raw)
  To: 39375

* 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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
  2020-01-31 20:02 [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next Leo Prikler
@ 2020-02-27 10:38 ` Pierre Neidhardt
  2020-02-27 10:54   ` Leo Prikler
  2020-02-28 14:50 ` Maxim Cournoyer
  1 sibling, 1 reply; 11+ messages in thread
From: Pierre Neidhardt @ 2020-02-27 10:38 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39375

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

Looks good to me.  Anything blocking this?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
  2020-02-27 10:38 ` Pierre Neidhardt
@ 2020-02-27 10:54   ` Leo Prikler
  2020-02-27 13:20     ` Pierre Neidhardt
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Prikler @ 2020-02-27 10:54 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 39375

Am Donnerstag, den 27.02.2020, 11:38 +0100 schrieb Pierre Neidhardt:
> Looks good to me.  Anything blocking this?
AFAIK the change should be backwards-compatible, so it's just the
rebuilds of all emacs libraries.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
  2020-02-27 10:54   ` Leo Prikler
@ 2020-02-27 13:20     ` Pierre Neidhardt
  2020-02-28  9:55       ` Leo Prikler
  0 siblings, 1 reply; 11+ messages in thread
From: Pierre Neidhardt @ 2020-02-27 13:20 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39375

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

So push to staging?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
  2020-02-27 13:20     ` Pierre Neidhardt
@ 2020-02-28  9:55       ` Leo Prikler
  2020-02-28 10:05         ` Pierre Neidhardt
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Prikler @ 2020-02-28  9:55 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 39375

Am Donnerstag, den 27.02.2020, 14:20 +0100 schrieb Pierre Neidhardt:
> So push to staging?
Staging should be safe, but previous updates to emacs-build-system have
been pushed to master before with the reasoning, that the rebuilds are
all very small.  I'm not sure who has the authority over this.

Regards,
Leo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
  2020-02-28  9:55       ` Leo Prikler
@ 2020-02-28 10:05         ` Pierre Neidhardt
  0 siblings, 0 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2020-02-28 10:05 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39375, Maxim Cournoyer

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

Cc-ing to Maxim:

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

> Am Donnerstag, den 27.02.2020, 14:20 +0100 schrieb Pierre Neidhardt:
>> So push to staging?
> Staging should be safe, but previous updates to emacs-build-system have
> been pushed to master before with the reasoning, that the rebuilds are
> all very small.  I'm not sure who has the authority over this.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
  2020-01-31 20:02 [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next Leo Prikler
  2020-02-27 10:38 ` Pierre Neidhardt
@ 2020-02-28 14:50 ` Maxim Cournoyer
  2020-02-28 15:26   ` Maxim Cournoyer
  2021-08-30 20:16   ` Maxim Cournoyer
  1 sibling, 2 replies; 11+ messages in thread
From: Maxim Cournoyer @ 2020-02-28 14:50 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39375

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.

Thanks,

Maxim

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
  2020-02-28 14:50 ` Maxim Cournoyer
@ 2020-02-28 15:26   ` Maxim Cournoyer
  2021-08-30 20:16   ` Maxim Cournoyer
  1 sibling, 0 replies; 11+ messages in thread
From: Maxim Cournoyer @ 2020-02-28 15:26 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39375

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

[...]

> 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.

For the record, I've opened an issue with Emacs here: <https://bugs.gnu.org/39823>.

Maxim

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
  2020-02-28 14:50 ` Maxim Cournoyer
  2020-02-28 15:26   ` Maxim Cournoyer
@ 2021-08-30 20:16   ` Maxim Cournoyer
  2021-08-30 21:33     ` Leo Prikler
  1 sibling, 1 reply; 11+ messages in thread
From: Maxim Cournoyer @ 2021-08-30 20:16 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39375

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!

Thanks,

Maxim




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next.
  2021-08-30 20:16   ` Maxim Cournoyer
@ 2021-08-30 21:33     ` Leo Prikler
  2021-08-31  2:44       ` bug#39375: " Maxim Cournoyer
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Prikler @ 2021-08-30 21:33 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 39375

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.

Thanks





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39375: [PATCH] gnu: emacs-utils: Port to emacs-next.
  2021-08-30 21:33     ` Leo Prikler
@ 2021-08-31  2:44       ` Maxim Cournoyer
  0 siblings, 0 replies; 11+ messages in thread
From: Maxim Cournoyer @ 2021-08-31  2:44 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 39375-done

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




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-08-31  2:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-31 20:02 [bug#39375] [PATCH] gnu: emacs-utils: Port to emacs-next Leo Prikler
2020-02-27 10:38 ` Pierre Neidhardt
2020-02-27 10:54   ` Leo Prikler
2020-02-27 13:20     ` Pierre Neidhardt
2020-02-28  9:55       ` Leo Prikler
2020-02-28 10:05         ` Pierre Neidhardt
2020-02-28 14:50 ` Maxim Cournoyer
2020-02-28 15:26   ` Maxim Cournoyer
2021-08-30 20:16   ` Maxim Cournoyer
2021-08-30 21:33     ` Leo Prikler
2021-08-31  2:44       ` bug#39375: " Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.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).