[PATCH] gnu: emacs-utils: Port to emacs-next.

  • Done
  • quality assurance status badge
Details
3 participants
  • Leo Prikler
  • Pierre Neidhardt
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Leo Prikler
Severity
normal
L
L
Leo Prikler wrote on 31 Jan 2020 21:02
(address . guix-patches@gnu.org)
20200131200222.23792-1-leo.prikler@student.tugraz.at
* 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(-)

Toggle diff (38 lines)
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
P
P
Pierre Neidhardt wrote on 27 Feb 2020 11:38
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39375@debbugs.gnu.org)
87blpk71sp.fsf@ambrevar.xyz
Looks good to me. Anything blocking this?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl5XnCYACgkQm9z0l6S7
zH8VyQf/UvKxIBdHtI+WJ3Ru/FWZrikD4KNsjsDtkuG6hBm68eXa2DzYrfawdjvT
J+FGnOu1C718aajQWan4usOwRjJoyX4GCl4vkdP1uJY5zUA2ddw3UPoTlx1NEpQt
f0k+1JHS+N01L2NzHGdEbvDNwpCXXE0sON/pJa/j6RuMU3kxKHhJBy0fey28dTqT
EQ5crnUrByYSPTPscMKnaXAA+q9PJ+DWNQ1hpvGAi1RNemrC040gkpcB07Qqr0Uh
PXYYCuvKXGChckavsl/MNi3br0olMYJa7dpm23v0s8CobPv65fzpX0OqqAOdS+f/
LpHL5osDMqE4bP4AGiuNk/Ui9/XOjQ==
=N1d9
-----END PGP SIGNATURE-----

L
L
Leo Prikler wrote on 27 Feb 2020 11:54
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 39375@debbugs.gnu.org)
4ed9f5be42ba03d43d411a637d20db6c801ecf6a.camel@student.tugraz.at
Am Donnerstag, den 27.02.2020, 11:38 +0100 schrieb Pierre Neidhardt:
Toggle quote (1 lines)
> Looks good to me. Anything blocking this?
AFAIK the change should be backwards-compatible, so it's just the
rebuilds of all emacs libraries.
P
P
Pierre Neidhardt wrote on 27 Feb 2020 14:20
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39375@debbugs.gnu.org)
8736aw6ub4.fsf@ambrevar.xyz
So push to staging?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl5Xwg8ACgkQm9z0l6S7
zH8+yAf/cqGxOhswB/FkfmJXLKjoBOfd1fc+tjJZSrbcJmzUe8scZpLxMcYCJ8JG
y8WXgDsvjCMHpfVLjJgvyIj6e/CTKmrhrhqh5MojWOekLWCQz4KlDqdM3/dJ2X2O
iuAIwbxemyknI/fql7pOQIsQUyx3WjEqvLeaeBfwCh2VBKhh+Gc77ElX3nO0Z9Wp
doSXRHZ50ODd3xJJavuxJ3OKp8SJ+cU8iwF7fxMAh8jaHKOjKqwKTLWdlUvNcJjI
c0mhBxTf++UW+Wz1i5NCvuStMLy1kDlzof7deWmnZBYwjzAz3acTeqaoCgTo9zZd
5WVfXOFw2U1tQUBWwOdltg2+UJUYEw==
=Ag+A
-----END PGP SIGNATURE-----

L
L
Leo Prikler wrote on 28 Feb 2020 10:55
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 39375@debbugs.gnu.org)
f2a76de733ff9b2e1db48b2401b8b2f97630c2a0.camel@student.tugraz.at
Am Donnerstag, den 27.02.2020, 14:20 +0100 schrieb Pierre Neidhardt:
Toggle quote (1 lines)
> 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
P
P
Pierre Neidhardt wrote on 28 Feb 2020 11:05
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
87v9nr3u36.fsf@ambrevar.xyz
Cc-ing to Maxim:

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

Toggle quote (6 lines)
> 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
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl5Y5e0ACgkQm9z0l6S7
zH+fuQf/S32jm2caUSaAXHbnH8fhmDvQmqEIDJIWT7g7//s2m/lOJ5syqUlpXnij
fgMxzQWNX6WsSYtlCXMw2sX4vxg9UNzUCBX7n4vE8A70d2Pfe0ZFr8VsSnhwdY1t
maCvS97tCREtsukb+IgvA0QtdgoLdbftH3Xe0CYozXRYprJYMkLOlnbpJk2iEEuO
UYmnV/+ivEp12ahHtEXn3vPOUPZ+J3CbYXo0rxRdajoKWxhLw+xGGRJtkxpxYey2
lLKhBdz1XpZcHyhCA9fXz1r2OkbWZg+Sf+XHHr3QVzanovw6B2XaqtSiDFZLdCPv
W56fsvyOw0EqJhcJOFh8usWjzabNDQ==
=eYFt
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 28 Feb 2020 15:50
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39375@debbugs.gnu.org)
874kvan4u6.fsf@gmail.com
Hi Leo,

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

Toggle quote (44 lines)
> * 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
M
M
Maxim Cournoyer wrote on 28 Feb 2020 16:26
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39375@debbugs.gnu.org)
87v9nqlomk.fsf@gmail.com
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

[...]

Toggle quote (4 lines)
> 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
M
M
Maxim Cournoyer wrote on 30 Aug 2021 22:16
Re: bug#39375: [PATCH] gnu: emacs-utils: Port to emacs-next.
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39375@debbugs.gnu.org)
878s0ilmc9.fsf_-_@gmail.com
Hi Leo,

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

Toggle quote (52 lines)
> 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
L
L
Leo Prikler wrote on 30 Aug 2021 23:33
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 39375@debbugs.gnu.org)
ee7d41a9eb436766050d7e21290c53e3662eae05.camel@student.tugraz.at
Hi Maxim,

Am Montag, den 30.08.2021, 16:16 -0400 schrieb Maxim Cournoyer:
Toggle quote (65 lines)
> 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
M
M
Maxim Cournoyer wrote on 31 Aug 2021 04:44
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39375-done@debbugs.gnu.org)
87fsuqjptw.fsf@gmail.com
Hi Leo,

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

Toggle quote (73 lines)
> 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:

Toggle snippet (8 lines)
(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?)))

Which allows requesting dynamic scope.

Closing.

Thank you!

Maxim
Closed
?