all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: 2a73673 Change how thread-first/thread-last indent the first argument
@ 2021-10-05  6:58 Adam Porter
  2021-10-05  7:35 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Porter @ 2021-10-05  6:58 UTC (permalink / raw)
  To: emacs-devel

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




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

end of thread, other threads:[~2021-10-06 11:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-05  6:58 2a73673 Change how thread-first/thread-last indent the first argument Adam Porter
2021-10-05  7:35 ` Lars Ingebrigtsen
2021-10-05  8:41   ` Adam Porter
2021-10-05 14:50     ` Basil L. Contovounesios
2021-10-06  9:08     ` Lars Ingebrigtsen
2021-10-06 10:27       ` Stefan Kangas
2021-10-06 11:32         ` Adam Porter
2021-10-06 10:49       ` Adam Porter

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.