unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 29.2: (void-function batch-update-autoloads)
@ 2024-08-25  8:52 Uwe Brauer via Emacs development discussions.
  2024-08-25 11:30 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Brauer via Emacs development discussions. @ 2024-08-25  8:52 UTC (permalink / raw)
  To: emacs-devel

Hi

I am one of the maintainers of matlab-emacs, and after upgrading my
system (and emacs) I realised that  the function batch-update-autoloads
is gone (which we need for our compilation/installation), sigh [1]

I run grep over my local cloned emacs repository but cannot find any
information of how this function can be replaced.

Regards

Uwe Brauer 

Footnotes:
[1]  (I know it has a lot of benefits to change function and variable
     names, but for those who don't participate in such discussion such
     changes cause a bit of inconveniences  to say the least)

-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 





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

* Re: 29.2: (void-function batch-update-autoloads)
  2024-08-25  8:52 29.2: (void-function batch-update-autoloads) Uwe Brauer via Emacs development discussions.
@ 2024-08-25 11:30 ` Eli Zaretskii
  2024-08-25 16:23   ` Uwe Brauer via Emacs development discussions.
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-08-25 11:30 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-devel

> Date: Sun, 25 Aug 2024 10:52:19 +0200
> From:  Uwe Brauer via "Emacs development discussions." <emacs-devel@gnu.org>
> 
> I am one of the maintainers of matlab-emacs, and after upgrading my
> system (and emacs) I realised that  the function batch-update-autoloads
> is gone (which we need for our compilation/installation), sigh [1]

It is not "gone", it was obsoleted.  You can still find autoloads.el
in lisp/obsolete.

> I run grep over my local cloned emacs repository but cannot find any
> information of how this function can be replaced.

You can still use that function, if you want, after loading its
package from lisp/obsolete.  If you want to migrate to the new
facility, the function to use is loaddefs-generate--emacs-batch,
defined in the new file lisp/emacs-lisp/loaddefs-gen.el.  (You could
have found this out yourself by looking at lisp/Makefile in the Emacs
Git repository, where we have the commands to generate loaddefs.el at
Emacs build time.)

> Footnotes:
> [1]  (I know it has a lot of benefits to change function and variable
>      names, but for those who don't participate in such discussion such
>      changes cause a bit of inconveniences  to say the least)

You are being unfair to us.  We never remove stuff entirely before
keeping it deprecated enough years to let everyone adapt.  Knowing
Emacs as much as you do, I'd expect you to trust us not to do anything
foolish or user-unfriendly, but instead assume that the stuff you are
looking for is present somewhere, and you just don't look for it close
enough.



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

* Re: 29.2: (void-function batch-update-autoloads)
  2024-08-25 11:30 ` Eli Zaretskii
@ 2024-08-25 16:23   ` Uwe Brauer via Emacs development discussions.
  2024-08-25 18:24     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Brauer via Emacs development discussions. @ 2024-08-25 16:23 UTC (permalink / raw)
  To: emacs-devel

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

>>> "EZ" == Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Sun, 25 Aug 2024 10:52:19 +0200
>> From:  Uwe Brauer via "Emacs development discussions." <emacs-devel@gnu.org>
>> 
>> I am one of the maintainers of matlab-emacs, and after upgrading my
>> system (and emacs) I realised that  the function batch-update-autoloads
>> is gone (which we need for our compilation/installation), sigh [1]

> It is not "gone", it was obsoleted.  You can still find autoloads.el
> in lisp/obsolete.

>> I run grep over my local cloned emacs repository but cannot find any
>> information of how this function can be replaced.

> You can still use that function, if you want, after loading its
> package from lisp/obsolete.  If you want to migrate to the new
> facility, the function to use is loaddefs-generate--emacs-batch,
> defined in the new file lisp/emacs-lisp/loaddefs-gen.el.  

Thanks, but it still does not work, the relevant line of the Makefile now reads
,----
| 
| EMACS=/usr/local/bin/emacs
| EMACSFLAGS=-batch --no-site-file --eval '(setq debug-on-error t)'
| 
| autoloads: 
| 	$(EMACS) $(EMACSFLAGS) $(addprefix -L ,$(LOADPATH)) --eval '(setq generated-autoload-file "$(abspath $(LOADDEFS))")' -f loaddefs-generate--emacs-batch $(abspath $(LOADDIRS))
`----



Using 29.2, but I receive still, 
(void-function loaddefs-generate--emacs-batch)

> (You could have found this out yourself by looking at lisp/Makefile in
> the Emacs Git repository, where we have the commands to generate
> loaddefs.el at Emacs build time.)

Right, but see above.

>> Footnotes:
>> [1]  (I know it has a lot of benefits to change function and variable
>> names, but for those who don't participate in such discussion such
>> changes cause a bit of inconveniences  to say the least)

> You are being unfair to us.  We never remove stuff entirely before
> keeping it deprecated enough years to let everyone adapt. 

I have to admit, and that might be a very personal defect of mine, I do
not pay much attention to the question of a function/variable being
deprecated, since it just works, and I am sure I am not alone with this attitude.

> Knowing Emacs as much as you do, I'd expect you to trust us not to do
> anything foolish or user-unfriendly, but instead assume that the stuff
> you are looking for is present somewhere, and you just don't look for
> it close enough.

Of course, I highly appreciate the work especially you do, and I enjoy
using Emacs.

That being said I just wished, that there would be a more centralised
file or directory, where obsolete functions and variables were listed.




-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5684 bytes --]

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

* Re: 29.2: (void-function batch-update-autoloads)
  2024-08-25 16:23   ` Uwe Brauer via Emacs development discussions.
@ 2024-08-25 18:24     ` Eli Zaretskii
  2024-08-26 12:35       ` Uwe Brauer
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-08-25 18:24 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-devel

> Date: Sun, 25 Aug 2024 18:23:50 +0200
> From:  Uwe Brauer via "Emacs development discussions." <emacs-devel@gnu.org>
> 
> > You can still use that function, if you want, after loading its
> > package from lisp/obsolete.  If you want to migrate to the new
> > facility, the function to use is loaddefs-generate--emacs-batch,
> > defined in the new file lisp/emacs-lisp/loaddefs-gen.el.  
> 
> Thanks, but it still does not work, the relevant line of the Makefile now reads
> ,----
> | 
> | EMACS=/usr/local/bin/emacs
> | EMACSFLAGS=-batch --no-site-file --eval '(setq debug-on-error t)'
> | 
> | autoloads: 
> | 	$(EMACS) $(EMACSFLAGS) $(addprefix -L ,$(LOADPATH)) --eval '(setq generated-autoload-file "$(abspath $(LOADDEFS))")' -f loaddefs-generate--emacs-batch $(abspath $(LOADDIRS))
> `----

I don't know where did you take this from.  In Emacs 29.2,
lisp/Makefile says something very different:

  autoloads: $(lisp)/emacs-lisp/loaddefs-gen.elc gen-lisp
	  $(AM_V_GEN)$(emacs) \
	      -l $(lisp)/emacs-lisp/loaddefs-gen.elc \
	      -f loaddefs-generate--emacs-batch ${SUBDIRS_ALMOST}

> Using 29.2, but I receive still, 
> (void-function loaddefs-generate--emacs-batch)

And what is the textbook solution in Emacs for void-function errors?

> >> [1]  (I know it has a lot of benefits to change function and variable
> >> names, but for those who don't participate in such discussion such
> >> changes cause a bit of inconveniences  to say the least)
> 
> > You are being unfair to us.  We never remove stuff entirely before
> > keeping it deprecated enough years to let everyone adapt. 
> 
> I have to admit, and that might be a very personal defect of mine, I do
> not pay much attention to the question of a function/variable being
> deprecated, since it just works, and I am sure I am not alone with this attitude.

That's not what I meant.  What I meant was that you are not expected
to assume that a function that "disappeared" was summarily removed
from Emacs without any consideration for those who might still need
it.  That function is still available, it was only moved to
lisp/obsolete/, that's all.

> That being said I just wished, that there would be a more centralised
> file or directory, where obsolete functions and variables were listed.

The lisp/obsolete/ directory is home for all such functions and
variables.



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

* Re: 29.2: (void-function batch-update-autoloads)
  2024-08-25 18:24     ` Eli Zaretskii
@ 2024-08-26 12:35       ` Uwe Brauer
  2024-08-26 12:47         ` Eli Zaretskii
  2024-08-26 13:19         ` Arash Esbati
  0 siblings, 2 replies; 8+ messages in thread
From: Uwe Brauer @ 2024-08-26 12:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Uwe Brauer, emacs-devel

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

>>> "EZ" == Eli Zaretskii <eliz@gnu.org> writes:

>> ,----
>> | 
>> | EMACS=/usr/local/bin/emacs
>> | EMACSFLAGS=-batch --no-site-file --eval '(setq debug-on-error t)'
>> | 
>> | autoloads: 
>> | 	$(EMACS) $(EMACSFLAGS) $(addprefix -L ,$(LOADPATH)) --eval
>> | '(setq generated-autoload-file "$(abspath $(LOADDEFS))")' -f
>> | loaddefs-generate--emacs-batch $(abspath $(LOADDIRS))
>> `----

> I don't know where did you take this from.  In Emacs 29.2,
> lisp/Makefile says something very different:

This is from our Makefile. I am not 100% sure who wrote this. Git
(mercurial) seems to indicate that it was Eric Ludlam.



>   autoloads: $(lisp)/emacs-lisp/loaddefs-gen.elc gen-lisp
> 	  $(AM_V_GEN)$(emacs) \
> 	      -l $(lisp)/emacs-lisp/loaddefs-gen.elc \
> 	      -f loaddefs-generate--emacs-batch ${SUBDIRS_ALMOST}

>> Using 29.2, but I receive still, 
>> (void-function loaddefs-generate--emacs-batch)

> And what is the textbook solution in Emacs for void-function errors?

Asking in the list 😉? ok seriously now, loading the file that defines
that function, which the above code seems to do, if I take a closer look.

But now I am deeply confused.

I thought in a Makefile, that, among other things, byte compile lisp files,
one should best set

EMACSFLAGS=-batch --no-site-file 

or something similar and the generation of autoloads would use
functionalities of emacs core.

As you can see in our case the generation of autoloads was done with 

--8<---------------cut here---------------start------------->8---
autoloads: 
	$(EMACS) $(EMACSFLAGS) $(addprefix -L ,$(LOADPATH)) --eval '(setq generated-autoload-file "$(abspath $(LOADDEFS))")' -f batch-update-autoloads $(abspath $(LOADDIRS))
--8<---------------cut here---------------end--------------->8---

While in your example a lisp file is needed to be loaded.

Now the problem is that we want to cater for users with different Emacs
versions 30,29,28, 27 and maybe even 26.

In the case of lisp file, I know how to deal with such a situation, but
for a Makefile? Shall we add a .configure file now to find out which
emacs version is used and then distinguish in the Makefile whether it is
<29 or >=29?



>> That being said I just wished, that there would be a more centralised
>> file or directory, where obsolete functions and variables were listed.

> The lisp/obsolete/ directory is home for all such functions and
> variables.


Ok I should have a close look then.


-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5684 bytes --]

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

* Re: 29.2: (void-function batch-update-autoloads)
  2024-08-26 12:35       ` Uwe Brauer
@ 2024-08-26 12:47         ` Eli Zaretskii
  2024-08-26 13:19         ` Arash Esbati
  1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2024-08-26 12:47 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-devel

> From: Uwe Brauer <oub@mat.ucm.es>
> Cc: Uwe Brauer <oub@mat.ucm.es>, emacs-devel@gnu.org
> Date: Mon, 26 Aug 2024 14:35:54 +0200
> 
> I thought in a Makefile, that, among other things, byte compile lisp files,
> one should best set
> 
> EMACSFLAGS=-batch --no-site-file 
> 
> or something similar and the generation of autoloads would use
> functionalities of emacs core.
> 
> As you can see in our case the generation of autoloads was done with 
> 
> --8<---------------cut here---------------start------------->8---
> autoloads: 
> 	$(EMACS) $(EMACSFLAGS) $(addprefix -L ,$(LOADPATH)) --eval '(setq generated-autoload-file "$(abspath $(LOADDEFS))")' -f batch-update-autoloads $(abspath $(LOADDIRS))
> --8<---------------cut here---------------end--------------->8---
> 
> While in your example a lisp file is needed to be loaded.
> 
> Now the problem is that we want to cater for users with different Emacs
> versions 30,29,28, 27 and maybe even 26.
> 
> In the case of lisp file, I know how to deal with such a situation, but
> for a Makefile? Shall we add a .configure file now to find out which
> emacs version is used and then distinguish in the Makefile whether it is
> <29 or >=29?

It's not rocket science.  One idea is to add a Lisp file that would
invoke either the old batch-update-autoloads or the new
loaddefs-generate--emacs-batch (after loading loaddefs-gen), depending
on the value of emacs-version.



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

* Re: 29.2: (void-function batch-update-autoloads)
  2024-08-26 12:35       ` Uwe Brauer
  2024-08-26 12:47         ` Eli Zaretskii
@ 2024-08-26 13:19         ` Arash Esbati
  2024-08-26 13:21           ` Uwe Brauer
  1 sibling, 1 reply; 8+ messages in thread
From: Arash Esbati @ 2024-08-26 13:19 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: Eli Zaretskii, emacs-devel

Uwe Brauer <oub@mat.ucm.es> writes:

> Now the problem is that we want to cater for users with different Emacs
> versions 30,29,28, 27 and maybe even 26.
>
> In the case of lisp file, I know how to deal with such a situation, but
> for a Makefile?

This is what AUCTeX does in a Makefile to deal with this:

--8<---------------cut here---------------start------------->8---
AUTOLOAD=--eval '\
(let* ((autoload-file (expand-file-name "$@")) \
       (autoload-file-dir (file-name-directory autoload-file))) \
  (if (fboundp (quote loaddefs-generate)) \
      (loaddefs-generate autoload-file-dir autoload-file) \
    (setq generated-autoload-file autoload-file) \
    (update-directory-autoloads autoload-file-dir)) \
  (save-buffers-kill-emacs t)'

auctex-autoloads.el:
        $(EMACS) $(AUTOLOAD)
--8<---------------cut here---------------end--------------->8---

HTH.  Best, Arash



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

* Re: 29.2: (void-function batch-update-autoloads)
  2024-08-26 13:19         ` Arash Esbati
@ 2024-08-26 13:21           ` Uwe Brauer
  0 siblings, 0 replies; 8+ messages in thread
From: Uwe Brauer @ 2024-08-26 13:21 UTC (permalink / raw)
  To: Arash Esbati; +Cc: Uwe Brauer, Eli Zaretskii, emacs-devel

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

>>> "AE" == Arash Esbati <arash@gnu.org> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:
>> Now the problem is that we want to cater for users with different Emacs
>> versions 30,29,28, 27 and maybe even 26.
>> 
>> In the case of lisp file, I know how to deal with such a situation, but
>> for a Makefile?

> This is what AUCTeX does in a Makefile to deal with this:

> AUTOLOAD=--eval '\
> (let* ((autoload-file (expand-file-name "$@")) \
>        (autoload-file-dir (file-name-directory autoload-file))) \
>   (if (fboundp (quote loaddefs-generate)) \
>       (loaddefs-generate autoload-file-dir autoload-file) \
>     (setq generated-autoload-file autoload-file) \
>     (update-directory-autoloads autoload-file-dir)) \
>   (save-buffers-kill-emacs t)'

> auctex-autoloads.el:
>         $(EMACS) $(AUTOLOAD)

> HTH.  Best, Arash

Ah thanks so much that is indeed helpful!

-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5684 bytes --]

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

end of thread, other threads:[~2024-08-26 13:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-25  8:52 29.2: (void-function batch-update-autoloads) Uwe Brauer via Emacs development discussions.
2024-08-25 11:30 ` Eli Zaretskii
2024-08-25 16:23   ` Uwe Brauer via Emacs development discussions.
2024-08-25 18:24     ` Eli Zaretskii
2024-08-26 12:35       ` Uwe Brauer
2024-08-26 12:47         ` Eli Zaretskii
2024-08-26 13:19         ` Arash Esbati
2024-08-26 13:21           ` Uwe Brauer

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

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