all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* project--files-in-directory: code formatting
@ 2020-11-04 13:26 Manuel Uberti
  2020-11-04 14:30 ` Stefan Monnier
  2020-11-04 18:19 ` Dmitry Gutov
  0 siblings, 2 replies; 10+ messages in thread
From: Manuel Uberti @ 2020-11-04 13:26 UTC (permalink / raw)
  To: emacs-devel

Hello,

I noticed this piece of code in project.el (line 292 on master):

(command (format "%s %s %s -type f %s -print0"
                 find-program
                 localdir
                 (xref--find-ignores-arguments ignores localdir)
                 (if files
                     (concat (shell-quote-argument "(")
                             " " find-name-arg " "
                             (mapconcat
                              #'shell-quote-argument
                              (split-string files)
                              (concat " -o " find-name-arg " "))
                             " "
                             (shell-quote-argument ")"))"")
                 ))

Woudln't it be cleaner formatted this way?

(command (format "%s %s %s -type f %s -print0"
                 find-program
                 localdir
                 (xref--find-ignores-arguments ignores localdir)
                 (if files
                     (concat (shell-quote-argument "(")
                             " " find-name-arg " "
                             (mapconcat
                              #'shell-quote-argument
                              (split-string files)
                              (concat " -o " find-name-arg " "))
                             " "
                             (shell-quote-argument ")"))
                   "")))

Basically, the "else" of "if files..." on a new line, with the remaining
parenthesis on the same line as this "else".

What do you think?


Since this is not really a bug I didn't open one for it, but I can do it if you
prefer so. Also, I understand this is mostly a matter of personal preferences,
so feel free to ignore this email.


All te best

-- 
Manuel Uberti
www.manueluberti.eu



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

end of thread, other threads:[~2020-11-07 15:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-04 13:26 project--files-in-directory: code formatting Manuel Uberti
2020-11-04 14:30 ` Stefan Monnier
2020-11-04 14:45   ` Manuel Uberti
2020-11-04 15:44     ` Stefan Monnier
2020-11-07 10:47       ` Andrii Kolomoiets
2020-11-07 15:16         ` Stefan Monnier
2020-11-04 19:40   ` Dmitry Gutov
2020-11-04 21:20     ` Stefan Monnier
2020-11-05  2:25       ` Dmitry Gutov
2020-11-04 18:19 ` Dmitry Gutov

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.