[Top][All Lists]

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

Re: Having trouble packaging DefaultEncrypt for Emacs

From: Chris Marusich
Subject: Re: Having trouble packaging DefaultEncrypt for Emacs
Date: Tue, 11 Apr 2017 00:40:09 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Alex Kost <address@hidden> writes:

> Chris Marusich (2017-04-08 17:21 -0700) wrote:
>> Hi,
>> I'm trying to package 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"))

I did not know this!  Thank you for sharing your knowledge.  I chose to
use the "unless" form so I would know if it ever failed to load.

> 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".

That's good to know.  I guess this module didn't do the "autoload magic"
that some modules, like magit, do?

>> 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).

Aha!  Yes, that fixed it.  I was so close!  Thank you for taking the
time to help me finish this up.  I am now happily using jl-encrypt.
It's automatically signing my email and protecting me from sending email
in cleartext when I should be encrypting it otherwise!  Great stuff.

Patch incoming!  :-)


Attachment: signature.asc
Description: PGP signature

reply via email to

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