all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: Chris Marusich <cmmarusich@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: Having trouble packaging DefaultEncrypt for Emacs
Date: Mon, 10 Apr 2017 13:10:41 +0300	[thread overview]
Message-ID: <87h91wwp26.fsf@gmail.com> (raw)
In-Reply-To: <87k26uph0r.fsf@gmail.com> (Chris Marusich's message of "Sat, 08 Apr 2017 17:21:40 -0700")

Chris Marusich (2017-04-08 17:21 -0700) wrote:

> Hi,
>
> I'm trying to package DefaultEncrypt:
>
> https://www.emacswiki.org/emacs/DefaultEncrypt
>
> I've made a package definition (see attached patch), and it builds
> without error.  I've installed it into my user profile.  Per the
> documentation, I've added the following to my ~/.emacs:
>
>   (require 'jl-encrypt)

I recommend to never do this "hard" requirement.  As you can see, it
may break your .emacs.  Better do it like this:

  (require 'jl-encrypt nil t)

or if you want some warning message:

  (unless (require 'jl-encrypt nil t)
    (message "Something is not good: jl-encrypt was not loaded"))

Note, however, that in most cases (not in this case) using "require" is
not needed at all!  Usually it is enough to have the generated
autoloads.  For example, if you install 'magit', you don't need to (and
shouldn't!) put "(require 'magit)" in your emacs config.  You can use
"M-x magit-status" right away as 'magit-status' command is "autoloaded".

> However, when I start Emacs, I get the following warning:
>
> Warning (initialization): An error occurred while loading ‘/home/marusich/.emacs’:
>
> File error: Cannot open load file, No such file or directory, jl-encrypt
>
>
> Why is this happening?  How can I fix it?  I'm still a bit of an Emacs
> newbie, so maybe there's an obvious solution I'm unaware of.
>
> I've also noticed that the elisp file gets installed with the name
> "jl-encrypt.el.el", which seems weird, but I don't know if that's
> related to the preceding issue:

This weird file name is the root of the problem: a single-package file
should have the following file name: <name-version.el>.  So try to add
'file-name' to the origin (see below).

[...]
> +(define-public emacs-default-encrypt
> +  (package
> +    (name "emacs-default-encrypt")
> +    (version "4.3")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             ;; A versioned, signed copy of this package is avialable on the
> +             ;; home page, but 'guix download' fails to download it.
> +             "https://github.com/emacsmirror/emacswiki.org/raw/master/jl-encrypt.el"))

Why do you use this third-party unversioned file instead of the original
source from the upstream? (it even has a GnuPG signature!):

  https://www.informationelle-selbstbestimmung-im-internet.de/emacs/jl-encrypt4.1/jl-encrypt.el

I found it on the home-page.

Add the following line here to fix ".el.el" problem:

          (file-name (string-append "jl-encrypt-" version ".el"))

> +       (sha256
> +        (base32
> +         "16i3rlfp3jxlqvndn8idylhmczync3gwmy8a019v29vyr48rnnr0"))))
> +    (build-system emacs-build-system)
> +    (home-page "https://www.informationelle-selbstbestimmung-im-internet.de/Emacs.html")
> +    (synopsis "Automatically encrypt and sign Gnus messages")
> +    (description
> +     "DefaultEncrypt is designed to be used with Gnus.  It automatically
> +encrypts messages that you send (e.g., email) when public keys for all
> +recipients are available, and it protects you from accidentally sending
> +un-encrypted messages.  It can also be configured to automatically sign
> +messages that you send.  For details and instructions on how to use
> +DefaultEncrypt, please refer to the home page or read the comments in the
> +source file, @file{jl-encrypt.el}.")
> +    (license license:gpl3+)))

-- 
Alex

  reply	other threads:[~2017-04-10 10:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-09  0:21 Having trouble packaging DefaultEncrypt for Emacs Chris Marusich
2017-04-10 10:10 ` Alex Kost [this message]
2017-04-10 10:31   ` Alex Kost
2017-04-11  8:22     ` Chris Marusich
2017-04-11  7:40   ` Chris Marusich
2017-04-11 20:04     ` Alex Kost
2017-04-12  7:59       ` Alex Kost
2017-04-13  7:38         ` Chris Marusich

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h91wwp26.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=cmmarusich@gmail.com \
    --cc=guix-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.