all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Manuel Uberti <manuel.uberti@inventati.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: project--files-in-directory: code formatting
Date: Wed, 4 Nov 2020 14:26:21 +0100	[thread overview]
Message-ID: <0751c421-d860-2d79-74ee-52806d46fc13@inventati.org> (raw)

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



             reply	other threads:[~2020-11-04 13:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04 13:26 Manuel Uberti [this message]
2020-11-04 14:30 ` project--files-in-directory: code formatting 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0751c421-d860-2d79-74ee-52806d46fc13@inventati.org \
    --to=manuel.uberti@inventati.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.