From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Splitting image-dired.el into smaller files Date: Wed, 8 Dec 2021 13:50:09 -0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21858"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mathias Dahl To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 08 22:51:29 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mv4qX-0005WM-8g for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Dec 2021 22:51:29 +0100 Original-Received: from localhost ([::1]:56002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mv4qW-00045u-5m for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Dec 2021 16:51:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv4pJ-00033U-NL for emacs-devel@gnu.org; Wed, 08 Dec 2021 16:50:13 -0500 Original-Received: from mail-pl1-f171.google.com ([209.85.214.171]:33399) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mv4pH-0008QF-CX for emacs-devel@gnu.org; Wed, 08 Dec 2021 16:50:13 -0500 Original-Received: by mail-pl1-f171.google.com with SMTP id y7so2487453plp.0 for ; Wed, 08 Dec 2021 13:50:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to:cc; bh=kn4h9j8LjRu5C9ZKxl2Nw4nCeBuASiESXTgh2WNDzSc=; b=lcp0/ouNmnpKB52ya9efq0F/TRcURGMHj9i3/aj602Gw1dORDHVoemWZkkcdKzEcqd J3OTCxIOj+hPc/OYnWF8yljsIsN0TyIVS10zk2whjWTxR/v4OeRdsnCG9EPpKCmSOJP7 MuuW3HV/5rPoFcx4hCbTynb+sjQ3efhk7/EBIBVMq4KJzLcNrZ18b6ytMZIeGpdPP6gY F54wDdm0yuGnp5Z+Oafh/LcJYS7evbvUgCLrlv7kgou5rgzrrxyzlxXlYdAyIUp00S90 7U3Zxt8BLs7EPEebB+dUo2xGGLnOAHo8cq87TqfnpxmNBzDQ7B95VQtGdLVvysiPUq9P MAcA== X-Gm-Message-State: AOAM533ErHooYyIS+oGjM54s5pK+YfnyoZK+jpgvzJ/W17q+Z88QlwZx rcgBh4i3inDoOE0REnHpfxnT+PTY3X9NtCKB7DnrGFa0 X-Google-Smtp-Source: ABdhPJwrKmPAto0H0XDqzQSs5foHbMUA0TtDC6O8soCYursUZV0+oVsn1rjTmpWuCokAHcJhx836M+V1P+d8Rt5xE1g= X-Received: by 2002:a17:90a:be10:: with SMTP id a16mr10304825pjs.133.1639000209859; Wed, 08 Dec 2021 13:50:09 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 8 Dec 2021 13:50:09 -0800 Received-SPF: pass client-ip=209.85.214.171; envelope-from=stefankangas@gmail.com; helo=mail-pl1-f171.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281398 Archived-At: 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.