emacs-devel
[Top][All Lists]
Advanced

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

project--files-in-directory: code formatting


From: Manuel Uberti
Subject: project--files-in-directory: code formatting
Date: Wed, 4 Nov 2020 14:26:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

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 via email to

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