unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Pierre Neidhardt <mail@ambrevar.xyz>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Add helper for .desktop file creation?
Date: Sat, 25 May 2019 15:33:22 +0200	[thread overview]
Message-ID: <87r28m64m5.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87r28mofxd.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Sat, 25 May 2019 14:51:42 +0200")

Pierre Neidhardt <mail@ambrevar.xyz> writes:

> You are absolutely right, my initial implementation is not ready for
> merge, but it's already useful as a proof of concept.

Certainly. Also, it is a step in the right direction.

> Would you happen to know where this is implemented in Nix?

<https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/make-desktopitem/default.nix>

It is very straightforward, actually. There is not much to borrow.

> Or... I'm thinking we could do even better: use #:allow-other-keys then
> generate the entry from the key symbol (e.g. #:categories would generate
> "Categories").  This way the function would not have to hard-code the
> keys.

Making typos would be easier, then. I'd rather have a more limited, yet
more robust, function. I.e., I think it is better to stick to standard
keys. Otherwise, it adds little over current solution.

> Regarding your point on the string vs. list values, I suggest we accept
> both for all arguments and we string-join the lists.

If we go the "limited" route, we should also pay attention to expected
value types, i.e., only accept list of strings for entries with
"string(s)" values. Semicolons would need to be escaped when a list of
strings is allowed, too. 

In a nutshell, my suggestion would be:

- string, boolean, numeric : string, possibly with a check for boolean
  (throw an error if not "true" or "false"),

- string(s) : string, or list of strings, semicolons are escaped
  automatically,

- localestring : alist with "lang" as keys and strings as values, with
  a default key (possibly #f), or a plain string if there is only the
  default key.

This is more work than on the #:allow-other-keys options, but I think it
would make for a better tool.

WDYT?

  reply	other threads:[~2019-05-25 13:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24  7:53 Add helper for .desktop file creation? Pierre Neidhardt
2019-05-25 12:06 ` Nicolas Goaziou
2019-05-25 12:21   ` Nicolas Goaziou
2019-05-25 12:51     ` Pierre Neidhardt
2019-05-25 13:33       ` Nicolas Goaziou [this message]
2019-05-25 13:45         ` Nicolas Goaziou
2019-05-25 14:20         ` Pierre Neidhardt
2019-05-25 18:37           ` Pierre Neidhardt
2019-05-27  7:13             ` Pierre Neidhardt
2019-05-27 16:15               ` Nicolas Goaziou
2019-05-27 16:45                 ` Pierre Neidhardt
2019-05-27 17:39                   ` Nicolas Goaziou
2019-05-27 17:58                     ` Pierre Neidhardt
2019-05-27 19:19                       ` Nicolas Goaziou
2019-05-30  8:24                         ` Pierre Neidhardt
2019-05-27 19:54               ` Marius Bakke
2019-05-27 21:02                 ` Pierre Neidhardt
2019-05-25 13:38       ` Amin Bandali
2019-05-25 14:30   ` Danny Milosavljevic

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87r28m64m5.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=guix-devel@gnu.org \
    --cc=mail@ambrevar.xyz \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).