all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Is there a command to auto-purge old eln-cache files?
@ 2022-06-24 20:33 Kaushal Modi
  2022-06-25  5:28 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Kaushal Modi @ 2022-06-24 20:33 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

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

Hello,

I routinely update my emacs build from git and over time, and so I
collect hundreds of MBs of eln-cache files. Just looking at the
eln-cache dir names, it's not very evident which one is the latest one
(especially, from a tool call ncdu, I cannot tell which directories
should be safe to delete).

You can find the screenshot of what I see in ncdu attached.

So that made me wonder if there's already an emacs-lisp function to
purge old eln caches, and I am not aware?

What's the recommended way to keep the eln-cache the lightest and
containing only the directory corresponding to the last emacs build?

Thanks!



--
Kaushal Modi

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 27215 bytes --]

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

* Re: Is there a command to auto-purge old eln-cache files?
  2022-06-24 20:33 Is there a command to auto-purge old eln-cache files? Kaushal Modi
@ 2022-06-25  5:28 ` Eli Zaretskii
  2022-06-25 16:37   ` Kaushal Modi
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2022-06-25  5:28 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Fri, 24 Jun 2022 16:33:58 -0400
> 
> I routinely update my emacs build from git and over time, and so I
> collect hundreds of MBs of eln-cache files. Just looking at the
> eln-cache dir names, it's not very evident which one is the latest one
> (especially, from a tool call ncdu, I cannot tell which directories
> should be safe to delete).

If you keep only one Emacs executable for all those builds, and either
delete the old ones or don't care whether they remain usable, then you
can identify the only subdirectory under the eln-cache directory you
need to keep by one of the following methods:

 . sort the directories under ~/.emacs.d/eln-cache by date, and leave
   only the one whose time stamp is the latest
 . ask Emacs: "M-: comp-native-version-dir RET" -- you can delete all
   the subdirectory of eln-cache except the one whose name that
   produces

> So that made me wonder if there's already an emacs-lisp function to
> purge old eln caches, and I am not aware?

Define "old" for this purpose.

E.g., I keep many old Emacs executables (it makes it easier to bisect
bugs), so for me "old" means "belonging to an Emacs executable I
removed".



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

* Re: Is there a command to auto-purge old eln-cache files?
  2022-06-25  5:28 ` Eli Zaretskii
@ 2022-06-25 16:37   ` Kaushal Modi
  0 siblings, 0 replies; 3+ messages in thread
From: Kaushal Modi @ 2022-06-25 16:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Help Gnu Emacs mailing list

On Sat, Jun 25, 2022, 1:30 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Kaushal Modi <kaushal.modi@gmail.com>
> > Date: Fri, 24 Jun 2022 16:33:58 -0400
> >
> > I routinely update my emacs build from git and over time, and so I
> > collect hundreds of MBs of eln-cache files. Just looking at the
> > eln-cache dir names, it's not very evident which one is the latest one
> > (especially, from a tool call ncdu, I cannot tell which directories
> > should be safe to delete).
>
> If you keep only one Emacs executable for all those builds, and either
> delete the old ones or don't care whether they remain usable, then you
> can identify the only subdirectory under the eln-cache directory you
> need to keep by one of the following methods:
>

Thanks. I think I'll just add an rm -rf of the entire eln-cache directory
after each successful build of Emacs.

Define "old" for this purpose.
>
> E.g., I keep many old Emacs executables (it makes it easier to bisect
> bugs), so for me "old" means "belonging to an Emacs executable I
> removed".
>

For my use case, any emacs built before the last build is old. I'll have to
rethink that rm -rf strategy if I decide to maintain multiple major
versions of Emacs.

To add, it would be helpful to have an `eln-cache-purge` emacs command that
would delete the eln-cache directories only for the major.minor version of
the Emacs session from where that command is called.

Thanks.

>


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

end of thread, other threads:[~2022-06-25 16:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-24 20:33 Is there a command to auto-purge old eln-cache files? Kaushal Modi
2022-06-25  5:28 ` Eli Zaretskii
2022-06-25 16:37   ` Kaushal Modi

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.