emacs-devel
[Top][All Lists]
Advanced

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

Splitting image-dired.el into smaller files


From: Stefan Kangas
Subject: Splitting image-dired.el into smaller files
Date: Wed, 8 Dec 2021 13:50:09 -0800

Hi emacs-devel (copy to Mathias Dahl),

I'm working on image-dired.el lately, and I have plans for further
improvements that would be pretty far-reaching (if I can get that far).

But it feels at times like treading water, because the organization of
that file is not good.  While it has an okay foundation in terms of the
actual code, it has grown into a small organizational mess internally
over time.

Please consider the section markers I've recently added to that file;
and note that I spent some time thinking about them and where to place
them.  (Hint: good sectioning is currently not doable.)

My current best idea for improving its organization is to split it up in
several files along these lines:

    image/image-dired-bookmarks.el       ;; bookmark.el support
    image/image-dired-compat.el          ;; compatibility layer
    image/image-dired-gallery.el         ;; HTML gallery generation
    image/image-dired-tags.el            ;; home-cooked image tags
    image/image-dired-thumbs.el          ;; thumbnail generation
    image/image-dired.el

The big drawback here is that we will lose the git history.  However, we
lost most of that already in 2007 when the file was renamed.  From my
work and what I've seen so far, I don't think I will miss any history
that won't be massively outweighed by the benefits of better code
organization.

I'd also point out that the alternative to splitting it up into smaller
files would be to move things around in the file, which is also likely
to be pretty bad for git archaeologists.

One important thing to keep in mind when doing this, is to try not to
overdo it.  We don't want a situation where you need to be constantly
grepping to get anything done.  I think this can be avoided if it is
done with care, and considering which parts are orthogonal.  (For
example, the HTML gallery generation really has little to do with
anything else; it is almost entirely its own thing.)

I'd like to raise this here in case people have any feedback on this
plan, or indeed any significant objections.  Thanks in advance.



reply via email to

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