From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Having trouble packaging DefaultEncrypt for Emacs Date: Mon, 10 Apr 2017 13:10:41 +0300 Message-ID: <87h91wwp26.fsf@gmail.com> References: <87k26uph0r.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxWHY-0000K0-Sk for guix-devel@gnu.org; Mon, 10 Apr 2017 06:10:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxWHV-00058N-LC for guix-devel@gnu.org; Mon, 10 Apr 2017 06:10:48 -0400 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:34587) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cxWHV-00056k-Cp for guix-devel@gnu.org; Mon, 10 Apr 2017 06:10:45 -0400 Received: by mail-lf0-x229.google.com with SMTP id z15so67948713lfd.1 for ; Mon, 10 Apr 2017 03:10:42 -0700 (PDT) In-Reply-To: <87k26uph0r.fsf@gmail.com> (Chris Marusich's message of "Sat, 08 Apr 2017 17:21:40 -0700") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Chris Marusich Cc: guix-devel@gnu.org 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 =E2=80=98/home/= marusich/.emacs=E2=80=99: > > 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: . 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-encr= ypt4.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+))) --=20 Alex