[Top][All Lists]

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

Re: using use-package

From: Phillip Lord
Subject: Re: using use-package
Date: Fri, 14 Aug 2015 10:29:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hmmm. Yet `company-yasnippet' is autoloaded. So, you shouldn't need the
require. In this case, you do actually, because company-yasnippet does
not `(require 'yasnippet)', even though it uses several yasnippet
functions that are not autoloaded.

So, why does company-yasnippet not require yasnippet? Not sure. I guess
because they do not want to make company "Package-Require: yasnippet",
so they have used instead:

(declare-function yas-expand-snippet "yasnippet")

Perhaps, company needs to do

(unless (require 'yasnippet nil t)
  (declare-function yas-expand-snippet "yasnippet"))

which should obviate the need for your dependency and yet still shut the
byte compiler up if yasnippet were not installed.


Edward Knyshov <address@hidden> writes:

> Nicolay, here is example from my config.
> (req-package company
>   :require yasnippet
>   :config (progn (global-company-mode 1)
>                  (setq company-idle-delay 0.1)
>                  (setq company-show-numbers t)
>                  (setq company-minimum-prefix-length 2)
>                  (setq company-dabbrev-downcase nil)
>                  (setq company-dabbrev-other-buffers t)
> (setq company-auto-complete nil)
>                  (setq company-dabbrev-code-other-buffers 'all)
>                  (setq company-dabbrev-code-everywhere t)
>                  (setq company-dabbrev-code-ignore-case t)
>                  (global-set-key (kbd "C-<tab>") 'company-dabbrev)
>                  (global-set-key (kbd "M-<tab>") 'company-complete)
>                  (global-set-key (kbd "C-c C-y") 'company-yasnippet)))
> (req-package company-quickhelp
>   :require company
>   :config (company-quickhelp-mode 1))
> (req-package company-restclient
>   :require company
>   :config (add-to-list 'company-backends 'company-restclient))
> So cider initialization would look like this
> (req-package cider
>   :require company
>   :config ({init-cier-for-company-mode}))
> It might solve your problem.
> On Fri, Aug 14, 2015 at 8:12 AM Nikolay Kudryavtsev <
> address@hidden> wrote:
>> Cider does not really require company, nor company requires cider. But
>> when we have both we need to configure them to work together. I've
>> noticed that those "intersection" configuration relationships are more
>> common than real requirement relationships. Putting intersection like
>> this into use-package declarations for either package does not seem like
>> a correct way of doing it. Instead I wish there was a separate macro for
>> cases like this.
>> --
>> Best Regards,
>> Nikolay Kudryavtsev

Phillip Lord,                           Phone: +44 (0) 191 208 7827
Lecturer in Bioinformatics,             Email: address@hidden
School of Computing Science,   
Room 914 Claremont Tower,               skype: russet_apples
Newcastle University,                   twitter: phillord
NE1 7RU                                 

reply via email to

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