unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Pierre Neidhardt <mail@ambrevar.xyz>
To: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
Cc: 33598@debbugs.gnu.org
Subject: [bug#33598] Optimizations for emacs-clang-format and emacs-clang-rename
Date: Sun, 06 Jan 2019 20:00:19 +0100	[thread overview]
Message-ID: <87wonhipbw.fsf@ambrevar.xyz> (raw)
In-Reply-To: <14de0933-fddc-94d0-d75a-cdf4b49fce1a@yahoo.de>

[-- Attachment #1: Type: text/plain, Size: 3042 bytes --]

Hi Tim,

I just reviewed your patch. Looks pretty good overall, thanks!

A few things:

> +(export package-elisp-from-package)

This should be placed at the beginning of the file in the (define-module...
See bootstrap.scm.

> +;;; Returns a package definition that packages an emacs-lisp file from the
> +;;; SRCPKG source. The package has the name PKGNAME and packages the file
> +;;; SRC-FILE from the source in its root directory as TARGET-FILE or the
> +;;; basename of SRC-FILE where INPUTS NATIVE-INPUTS and PROPAGATED-INPUTS are
> +;;; added as package inputs and SUBSTITUTIONS substitutions will be performed
> +;;; on the elisp file and SYNOPSIS and DESCRIPTION as the package synopsis and
> +;;; description.
> +(define* (package-elisp-from-package

Move the ";;;" comment to a docstring, e.g.

--8<---------------cut here---------------start------------->8---
(define* (package-elisp-from-package
          ...)
  "Return ..."
--8<---------------cut here---------------end--------------->8---

> +;;; Returns a package definition that packages an emacs-lisp file from the

"Return", not "Returns".

> +;;; SRCPKG source. The package has the name PKGNAME and packages the file

Separate sentences with two spaces.

> +          srcpkg pkgname src-file

Prefer complete words over abbreviations.  Here I'd suggest

  source-package
  name
  source-file

> +      (synopsis (if synopsis
> +                    synopsis
> +                    (package-synopsis srcpkg)))
> +      (description (if description
> +                       description
> +                       (package-description srcpkg))))))

A more Lispy way:

--8<---------------cut here---------------start------------->8---
 +      (synopsis (or synopsis
 +                    (package-synopsis srcpkg)))
 +      (description (or description
 +                       (package-description srcpkg))))))
--8<---------------cut here---------------end--------------->8---

Regarding the function parameters, I would turn SOURCE-FILE into SOURCE-FILES to
make it more generic.  Indeed, the Emacs library could very well be split over
multiple files.

One thing I'm not too sure about is the replication of the structure fields as
keys.
I think it's easier to ignore those and let the user define them as follows:

--8<---------------cut here---------------start------------->8---
(define-public emacs-clang-rename
  (package
    (inherit (package-elisp-from-package
             clang
             "emacs-clang-rename"
             "tools/clang-rename/clang-rename.el"))
    (arguments ...)))
--8<---------------cut here---------------end--------------->8---

Makes sense?  This would also be more robust in case the package structure
changes someday.

Finally, rebase your changes so that you directly use the last function, no
need for the clang-specific function to appear in the history of commits.

Thank you again for the good work!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2019-01-06 19:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 13:47 [bug#33598] Optimizations for emacs-clang-format and emacs-clang-rename Tim Gesthuizen
2018-12-13 22:49 ` Ludovic Courtès
2018-12-14  9:23   ` Pierre Neidhardt
2018-12-14 10:06     ` Tim Gesthuizen
2018-12-14 10:31       ` Pierre Neidhardt
2018-12-14 11:00         ` Tim Gesthuizen
2018-12-14 12:09           ` Pierre Neidhardt
2018-12-14 12:12             ` Tim Gesthuizen
2018-12-19 17:47             ` Tim Gesthuizen
2018-12-19 17:50               ` Pierre Neidhardt
2019-01-04 22:00                 ` Tim Gesthuizen
2019-01-06 19:00                   ` Pierre Neidhardt [this message]
2019-01-06 21:29                     ` Tim Gesthuizen
2019-01-07 13:47                       ` Pierre Neidhardt
2019-01-07 14:00                         ` Pierre Neidhardt
2019-01-07 14:08                           ` Pierre Neidhardt
2019-01-07 22:10                             ` Ludovic Courtès
2019-01-07 22:14                               ` Pierre Neidhardt
2019-01-08  8:39                                 ` Ludovic Courtès
2019-01-08  8:48                                   ` Pierre Neidhardt
2019-01-08  9:53                                     ` Ludovic Courtès
2019-01-08 10:05                                       ` Pierre Neidhardt
2019-01-08 15:35                                         ` Tim Gesthuizen
2019-01-10 18:28                                         ` Tim Gesthuizen
2019-01-10 18:40                                           ` Pierre Neidhardt
2019-01-10 18:47                                             ` Tim Gesthuizen
2019-01-10 18:50                                               ` Pierre Neidhardt
2019-01-07 15:37                         ` Tim Gesthuizen

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=87wonhipbw.fsf@ambrevar.xyz \
    --to=mail@ambrevar.xyz \
    --cc=33598@debbugs.gnu.org \
    --cc=tim.gesthuizen@yahoo.de \
    /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).