guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] emacs: Add a name/version/synopsis heading in package-info b


From: Alex Kost
Subject: Re: [PATCH] emacs: Add a name/version/synopsis heading in package-info buffers
Date: Thu, 30 Oct 2014 01:13:58 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Ludovic Courtès (2014-10-29 19:25 +0300) wrote:

> Hello,
>
> What would think of a patch like this:

[...]

>  (defun guix-info-insert-entry (entry entry-type &optional indent-level)
>    "Insert ENTRY of ENTRY-TYPE into the current info buffer.
>  If INDENT-LEVEL is non-nil, indent displayed information by this
>  number of `guix-info-indent' spaces."
>    (let ((region-beg (point)))
> +    (guix-info-insert-heading entry)
>      (mapc (lambda (param)
> -            (guix-info-insert-param param entry entry-type))
> +            ;; The name, version, and synopsis are already displayed.
> +            (unless (memq param '(name version synopsis))
> +              (guix-info-insert-param param entry entry-type)))
>            (guix-info-get-displayed-params entry-type))
>      (when indent-level
>        (indent-rigidly region-beg (point)

‘guix-info-insert-entry’ is used to insert any type of information, not
only packages, so you can see artifacts (empty lines and "–") in other
"views".

[...]

> It changes the rendering of package-info buffers such that, instead of
> displaying something like:
>
>   Name        : coreutils
>   Version     : 8.23
>   Synopsis    : Core GNU utilities (file, text, shell)
>   ...
>
> it first displays the important info in a visible heading, and then goes
> on with the other fields unchanged:
>
>   coreutils 8.23
>   Core GNU utilities (file, text, shell)
>
>   Outputs:
>     out       Delete
>   ...
>
> On X11, the package name and version are displayed in a large
> variable-width font, and the synopsis is displayed in a slightly smaller
> font.

I think it's a great idea!

I'm attaching the modified version of your patch.  I added there several
variables that allow a user to specify functions for displaying info
(perhaps there will be several variants of displaying info in the
future).  So if someone would like to return to the previous variant of
displaying a package, he could do it with:

  (setq guix-info-insert-package-function nil)

Thanks again, I really like your suggestion, I just prefer to keep
previous possibilities instead of replacing them with the new ones.

Are you going to make a commit or should I do it?  (of course if you
don't have comments on my patch)

Attachment: tmp.diff
Description: Text Data


reply via email to

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