Subject: bug#26802: [PATCH 4/4] build: emacs: Fix `store-file->elisp-source-file'.

From: Alex Kost <[email-masked]>
Date: Sun, 21 May 2017 11:33:45 +0300

Arun Isaac (2017-05-17 22:22 +0530) wrote:

> This prevents a ".el.el" extension for source files with no version number in
> their file name.
>
> * guix/build/emacs-build-system.scm (store-file->elisp-source-file): Remove
>   ".el" extension from file name before splitting to name and version.
> ---
>  guix/build/emacs-build-system.scm | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm
> index 44e8b0d31..25a3beaa2 100644
> --- a/guix/build/emacs-build-system.scm
> +++ b/guix/build/emacs-build-system.scm
> @@ -47,10 +47,13 @@
>  (define (store-file->elisp-source-file file)
>    "Convert FILE, a store file name for an Emacs Lisp source file, into a file
>  name that has been stripped of the hash and version number."
> -  (let-values (((name version)
> -                (package-name->name+version
> -                 (strip-store-file-name file))))
> -    (string-append name ".el")))
> +  (let ((extension ".el"))
> +    (let-values (((name version)
> +                  (package-name->name+version
> +                   (strip-store-file-name
> +                    (string-drop-right
> +                     file (string-length extension))))))
> +      (string-append name extension))))
>  
>  (define* (unpack #:key source #:allow-other-keys)
>    "Unpack SOURCE into the build directory.  SOURCE may be a compressed

Wow, I don't know if removing ".el" from a file name can be written in a
more simple way, but the point of the patch is great!  I didn't realize
this problem could be fixed so easily.  It looks good to me, thanks!

-- 
Alex