emacs-devel
[Top][All Lists]
Advanced

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

Re: Splitting image-dired.el into smaller files


From: Stefan Monnier
Subject: Re: Splitting image-dired.el into smaller files
Date: Sun, 21 Aug 2022 13:02:52 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> Do you mean naming the files like this?
>> 
>>     image-dired/compat.el
>>     image-dired/dired.el
>>     image-dired/external.el
>>     image-dired/gallery.el
>>     image-dired/tags.el
>>     image-dired/util.el
>>     image-dired/image-dired.el
>
> Yes.

image-dired.el is not terribly large, so maybe keeping it as a single
file is not a bad option either.  I think the main goal in splitting
files is when that lets us load only some of them in common use cases.

>> How would I then require them, is it like this?
>>
>>     (require 'image-dired/compat)
>>
>> If that works, it does sound a bit neater.
>
> It does work: we use it in cedet/ subdirectories.

Indeed.  It does suffer from various issues, tho (e.g. `load-history`
doesn't remember that we used `image-dired/tags` to load the file so
(eval-after-load "tags" ...) may run unexpectedly).  It might be good to
use it more widely to force us to face the problems and fix them,
of course.

>> > And maybe leave the -util.el part inside the main file?
>> That's not very easy to do without introducing circular dependencies,
>> unfortunately.

I think most multi-file projects ends up using either ugly/broken hacks
(e.g. ediff and viper), or a package-specific autoloads file for that
(e.g. `mh-autoloads`, `cl-autoloads`, `tramp-autoloads`, ...).

Lars's new autoloads code supports those autoloads file much better than
the old one.


        Stefan




reply via email to

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