(require 'helm-config) in helm sources?

12 views
Skip to first unread message

Titus von der Malsburg

unread,
Jun 9, 2015, 2:40:50 PM6/9/15
to emacs...@googlegroups.com

A user of one of my helm sources recently got error messages because he didn't (require 'helm-config) in his startup file.  The error occurred when my helm source tried to add entries to menus that weren't created yet ("Tools" > "Helm").

My helm sources (helm-bibtex) does:

    (require 'helm)
    (require 'helm-net)
    (require 'helm-plugin)

Question 1: Is it recommended that helm sources also require helm-config or is that the user's task?

Question 2: What's the most reliable way to determine whether helm has been properly initialized?  If it's not initialized, I'd like to create a meaningful error message.

Many thanks for your advice.

  Titus

Thierry Volpiatto

unread,
Jun 11, 2015, 1:20:16 AM6/11/15
to emacs...@googlegroups.com

Sorry for late reply.

Titus von der Malsburg <mals...@posteo.de> writes:

> A user of one of my helm sources recently got error messages because
> he didn't (require 'helm-config) in his startup file.

As mentionned in README, people that want to make a different
installation without following advices in README should know what they
are doing and assume themselves their errors.

> The error occurred when my helm source tried to add entries to menus
> that weren't created yet ("Tools" > "Helm").
>
> My helm sources (helm-bibtex) does:
>
> (require 'helm)
> (require 'helm-net)
> (require 'helm-plugin)
>
> Question 1: Is it recommended that helm sources also require
> helm-config or is that the user's task?

No, you should not do that, let user do this.
But the question never raise as nobody so far tried to modify menu,
probably the definition of menu should be in a separated file, would
that help ?

> Question 2: What's the most reliable way to determine whether helm has
> been properly initialized? If it's not initialized, I'd like to
> create a meaningful error message.

Well you can take any var from helm-config, e.g
`helm-command-prefix-key' and check if it is bound (boundp var).

But you should not care of this, let users assume their errors if they
not follow instructions of README.

--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997

Thierry Volpiatto

unread,
Jun 11, 2015, 2:44:46 AM6/11/15
to emacs...@googlegroups.com

Thierry Volpiatto <thierry....@gmail.com> writes:

> No, you should not do that, let user do this.
> But the question never raise as nobody so far tried to modify menu,
> probably the definition of menu should be in a separated file, would
> that help ?

So from now you can (require 'helm-easymenu) in your source files.

Titus von der Malsburg

unread,
Jun 11, 2015, 12:02:02 PM6/11/15
to emacs...@googlegroups.com

On 2015-06-10 Wed 23:44, Thierry Volpiatto wrote:
> Thierry Volpiatto <thierry....@gmail.com> writes:
>
>> No, you should not do that, let user do this.
>> But the question never raise as nobody so far tried to modify menu,
>> probably the definition of menu should be in a separated file, would
>> that help ?
>
> So from now you can (require 'helm-easymenu) in your source files.

Thank you Thierry!! Very helpful!

Titus

signature.asc
Reply all
Reply to author
Forward
0 new messages