[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: package.el strings
From: |
Noam Postavsky |
Subject: |
Re: package.el strings |
Date: |
Sat, 28 Apr 2018 18:11:30 -0400 |
>> I meant just the outer (format "%s%s%s%s" ...) vs (concat ...). Is that
>> also needed to make strings localizable? If yes, I think adding a
>> comment would be helpful, because it looks a bit unnatural to me.
>
> Oh, you mean (format "%s%s%s%s" ...) vs an eventual (concat "%s%s%s%s" ...) ?
Sorry, I was trying to elide the the less relevant parts, but I see it's
making things less understandable. Let me just spell it out in full:
Instead of this:
(format "%s%s%s%s"
(if (not delete) ""
(format "Packages to delete: %s. " (package-menu--list-to-prompt
delete)))
(if (not install) ""
(format "Packages to install: %s. " (package-menu--list-to-prompt
install)))
(if (not upgrade) ""
(format "Packages to upgrade: %s. " (package-menu--list-to-prompt
upgrade)))
"Proceed? ")
I think this would be a bit clearer:
(concat
(when delete
(format "Packages to delete: %s. " (package-menu--list-to-prompt delete)))
(when install
(format "Packages to install: %s. " (package-menu--list-to-prompt
install)))
(when upgrade
(format "Packages to upgrade: %s. " (package-menu--list-to-prompt
upgrade)))
"Proceed? ")
> It there a length limit in emacs code ?
Um, I thought there was a convention of generally trying to keep things
within 80 columns, but now I can't find anything saying that. I may
have just been thinking of other non-Emacs projects.
Re: package.el strings, Jean-Christophe Helary, 2018/04/26