emacs-devel
[Top][All Lists]
Advanced

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

Re: 2a73673 Change how thread-first/thread-last indent the first argumen


From: Adam Porter
Subject: Re: 2a73673 Change how thread-first/thread-last indent the first argument
Date: Tue, 05 Oct 2021 01:58:33 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi Lars, et al,

In this commit, you changed the thread-last macro's indentation from
(indent 1) to (indent 0).  Could this be reverted, please?  This change
has two drawbacks:

1.  The threaded form is no longer indented differently from the other
forms, so it no longer stands out.  In some code, this makes it harder
to read.  For example, in deffy.el (an example application in the
taxy.el repo), this form is now much harder to read:

(thread-last
  (make-fn
   :name "Deffy"
   :description
   (format "Definitions in %s:"
           (if files
               (string-join (mapcar #'file-relative-name files) ", ")
             (file-name-nondirectory
              (directory-file-name (project-root project)))))
   :take (taxy-make-take-function keys deffy-keys))
  (taxy-fill forms)
  (taxy-sort* #'string< #'taxy-name)
  (taxy-sort #'string< #'def-name))

Whereas before, it looked like this:

(thread-last
    (make-fn
     :name "Deffy"
     :description
     (format "Definitions in %s:"
             (if files
                 (string-join (mapcar #'file-relative-name files) ", ")
               (file-name-nondirectory
                (directory-file-name (project-root project)))))
     :take (taxy-make-take-function keys deffy-keys))
  (taxy-fill forms)
  (taxy-sort* #'string< #'taxy-name)
  (taxy-sort #'string< #'def-name))

Without the extra indentation for the first form, it's hard to see where
the threaded form ends and the threaded-into forms begin.

2.  The change in indentation results in "indentation churn" in every
downstream package that uses thread-last or thread-first.  For example,
I use aggressive-indent-mode when editing Elisp packages, to ensure that
they're always indented properly, and now all of these forms get
reindented, and it makes extra diffs to scrutinize when committing other
changes in Magit.

Thanks for your consideration.

Adam




reply via email to

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