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: Mon, 27 May 2019 19:39:32 +0200	[thread overview]
Message-ID: <874l5f6bl7.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87blznlubm.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Mon, 27 May 2019 18:45:49 +0200")

Pierre Neidhardt <mail@ambrevar.xyz> writes:

> Nope, the current function only forces "Type" (the only mandatory
> field), everything else is omitted unless the key is explicitly set by
> the user.  This is because I looped over ALL-ARGS (the #:rest argument)
> and I force-added #:type to it.

Oh, true. I stand corrected.

> I did not implement the full specs simply because I decided to draw an
> arbitrary line between short code, convenience and completeness.  This
> is debatable of course and maybe a simple type-checking would not cost
> much.

I was thinking about a match against key before (match value ...), which
would then match value against a chosen predicate, and return an error
if it doesn't match.

- If key is either :no-display, :hidden, :d-bus-activatable, :terminal,
  or :startup-notify, predicate should be `boolean?'.

- If it is :type, :version, :try-exec, :exec, :path, :startup-wm-class,
  or :url, it should be `string?`.

- If it
  is :only-show-in, :not-show-in, :actions, :mime-type, :categories, :implements,
  it should be a string or a list of strings only.

- If it is :name, :generic-name, :comment, :icon, :keywords, it should
  be a a string or an alist.

- If key is anything else, it should be an error, because it is a typo.

I realize that we don't need numbers actually.

> Supporting the full specs would require a significant amount of work
> however.

Possibly, but we do not need more than this simple value type checking.

>> The docstring may explain that, e.g., compound :mime-type key becomes
>> MimeType.
>
> Hmm, OK but why?  The procedure produces the expected behaviour with
> #:mime-type, is there anything else to clarify?

As a packager, I need to know what key is going to produce
StartupWMClass (note that :startup-wm-class produces, StartupWmClass, if
that matters), or DBusActivatable. Unless I'm missing something, it is
not obvious from the docstring.

WDYT?

  reply	other threads:[~2019-05-27 17:39 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
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 [this message]
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=874l5f6bl7.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).