From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.help Subject: Re: using use-package Date: Fri, 14 Aug 2015 10:29:57 +0100 Message-ID: <87614idxpm.fsf@newcastle.ac.uk> References: <87d1yufwjk.fsf@robertthorpeconsulting.com> <87k2t1o8iz.fsf@russet.org.uk> <55CD78A9.1050309@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1439544622 21581 80.91.229.3 (14 Aug 2015 09:30:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Aug 2015 09:30:22 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Edward Knyshov Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 14 11:30:16 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZQBJV-0006xl-P3 for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Aug 2015 11:30:13 +0200 Original-Received: from localhost ([::1]:45348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQBJU-0004OU-Sc for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Aug 2015 05:30:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQBJK-0004Mt-Mg for help-gnu-emacs@gnu.org; Fri, 14 Aug 2015 05:30:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQBJG-0002z9-Ma for help-gnu-emacs@gnu.org; Fri, 14 Aug 2015 05:30:02 -0400 Original-Received: from cheviot12.ncl.ac.uk ([128.240.234.12]:58556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQBJG-0002z1-DY for help-gnu-emacs@gnu.org; Fri, 14 Aug 2015 05:29:58 -0400 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot12.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1ZQBJF-0000j8-BQ; Fri, 14 Aug 2015 10:29:57 +0100 Original-Received: from jangai.ncl.ac.uk ([10.66.67.223] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1ZQBJF-0000dv-Eu; Fri, 14 Aug 2015 10:29:57 +0100 In-Reply-To: (Edward Knyshov's message of "Fri, 14 Aug 2015 05:23:58 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106577 Archived-At: 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. Phil Edward Knyshov 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-") 'company-dabbrev) > (global-set-key (kbd "M-") '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 < > nikolay.kudryavtsev@gmail.com> 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: phillip.lord@newcastle.ac.uk School of Computing Science, http://homepages.cs.ncl.ac.uk/phillip.lord Room 914 Claremont Tower, skype: russet_apples Newcastle University, twitter: phillord NE1 7RU