GNU bug report logs - #62101
[PATCH] home: services: Add xmodmap.

Previous Next

Package: guix-patches;

Reported by: conses <contact <at> conses.eu>

Date: Fri, 10 Mar 2023 19:59:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: conses <contact <at> conses.eu>
Cc: 62101 <at> debbugs.gnu.org
Subject: [bug#62101] [PATCH] home: services: Add xmodmap.
Date: Thu, 16 Mar 2023 22:43:52 +0100
Hi,

conses <contact <at> conses.eu> skribis:

> * gnu/home/services/desktop.scm (home-xmodmap-service-type)
> (home-xmodmap-configuration): New variables;
> (xmodmap-shepherd-service)
> (get-xmodmap-configuration)
> (get-xmodmap-file)
> (add-xmodmap-config-file)
> (add-xmodmap-package): New procedures;
> * doc/guix.texi (Desktop Services): Document it.

Overall LGTM, with minor issues:

> +The syntax for the expression grammar is quite straightforward.  You can
> +either provide a list of cons cells and strings like this:

I’d suggest avoiding the first sentence, because what looks
straightforward to someone might be intimidating to another.  We also
avoid jargon like “cons cell” in the manual.

What about something like this:

  The @code{key-map} field takes a list of objects, each of which is
  either a @dfn{statement} (a string) or an @dfn{assignment} (a pair of
  strings).  As an example, the snippet below configures the @kbd{mod4}
  key (???) such that it does XYZ, FIXME: finish sentence :-)

… where ‘key-map’ is IMO a better name for ‘config’.

> +Alternatively, there is a more Lisp-like configuration syntax via Scheme
> +symbols, lists, and vectors, that you can use like this:
> +
> +@lisp
> +(service home-xmodmap-service-type
> +         (home-xmodmap-configuration
> +          (config '((#(add mod4) . Print)
> +                    (clear lock)

I don’t find it very useful; I’d rather support only one syntax, but
clearly explained.  So my suggestion would be to drop this.

> +@item @code{config} (default: @code{config}) (type: list)

So this would be renamed to @code{key-map} maybe.

> +(define (get-xmodmap-configuration field-name val)

As a rule of thumb, you can drop ‘get-’ from procedure names; procedures
like this one are rarely called ‘get-SOMETHING’.

> +     (service-extension home-profile-service-type
> +                        add-xmodmap-package)

I believe this extension is unnecessary.

Could you send an updated patch?

Thank you!

Ludo’.




This bug report was last modified 2 years and 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.