From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Edward Knyshov Newsgroups: gmane.emacs.help Subject: Re: req-package Date: Thu, 13 Aug 2015 15:10:49 +0300 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1439467888 21655 80.91.229.3 (13 Aug 2015 12:11:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Aug 2015 12:11:28 +0000 (UTC) To: Stefan Monnier , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 13 14:11:27 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 1ZPrLx-0003a3-OI for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Aug 2015 14:11:25 +0200 Original-Received: from localhost ([::1]:42204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPrLw-00073j-II for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Aug 2015 08:11:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPrLk-00073T-4E for help-gnu-emacs@gnu.org; Thu, 13 Aug 2015 08:11:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPrLi-0006Vj-Ni for help-gnu-emacs@gnu.org; Thu, 13 Aug 2015 08:11:12 -0400 Original-Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:35559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPrLi-0006VQ-9x for help-gnu-emacs@gnu.org; Thu, 13 Aug 2015 08:11:10 -0400 Original-Received: by lahi9 with SMTP id i9so24782630lah.2 for ; Thu, 13 Aug 2015 05:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=gcJJBZCcRwmQ8hnn6BrXVrm1WQ5A8w39Msy4fhXaq1s=; b=mbvQymdFJ3uDuHDr/Bt/bo/TuZ2oZu8O5pDLeeSmOHraeU7eQS1jhfouSND8VXkZ0u V1Nyx7eo4PqMpaBG17iwRxHY00H67fCDTbhz0WaqRWgOGTCRQWh3ffbzZEWmi0uZO1KZ ca9PN5lEWug/pf6mQvcLMBYD7VJpEVzV8xyWZgxAxOz//uTC4RSqj3S2wB7BgZ9+6lDI /XNHyZ8Pxf/4Ja/67U1YJ3S9delcIoCyq+byT9hlkHMkRDNJd936Ogzt6OTXczjUZmHF G7MxvEBZ3MYDfnM9TBK0VWTYqwVe6fPwv9YZhlql6Y5ndU7I43/mDe/E0WEiJ+u8hE24 W6Dg== X-Received: by 10.152.29.200 with SMTP id m8mr31138533lah.44.1439467868674; Thu, 13 Aug 2015 05:11:08 -0700 (PDT) Original-Received: by 10.25.196.144 with HTTP; Thu, 13 Aug 2015 05:10:49 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::235 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:106529 Archived-At: Yes, sure. Sorry for late answer. Here is example. I configure clojure development environment with req-package(use-package) (req-package eldoc =E2=80=8B=E2=80=8B ;; this form call will download eldoc package from elpa = or el-get as needed :commands eldoc =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B -mode =E2=80=8B=E2=80=8B ;; this parameter delays loading of eldoc until eldo-mod= e function is called :init (prog =E2=80=8B=E2=80=8B n (add-h =E2=80=8B=E2=80=8B ook 'emacs-lisp-mode-hook (lambda () (eldoc-mode 1))) =E2=80=8B =E2=80=8B;; add eldoc to emacs lisp mode =E2=80=8B =E2=80=8B (add-hook 'lisp-interaction-mode-hook (lambda () (eldoc-mode 1))))) =E2=80=8B=E2=80=8B ;; add eldoc to =E2=80=8Blisp based interaction modes modes =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8B (req-package clojure-mode =E2=80=8B=E2=80=8B ;; this form call will download =E2=80=8Bclojure-mode package from elpa or el-get as needed :mode (("clj\\'" . clojure-mo =E2=80=8B=E2=80=8B de) =E2=80=8B ;; this parameter delays loading of clojure-mode until =E2=80=8B =E2=80=8B =E2=80=8B ("cljs\\'" . clojure-mode))) =E2=80=8B ;; file with any of these extensions is loaded=E2=80=8B (req-package cider =E2=80=8B=E2=80=8B ;; this form call will download =E2=80=8Bcider package from elpa or el-get as needed :require (clojure-m =E2=80=8B=E2=80=8B ode eldoc) =E2=80=8B ;; this parameters makes sure that this req-package form is evalu= ated after all of these packages are loaded=E2=80=8B :commands cider-mode =E2=80=8B ;; delay loading until cider-mode function is called=E2=80=8B :init (progn (add-hook 'clojure-mode-h =E2=80=8B=E2=80=8B ook #'cider-mode) =E2=80=8B ;; start cider in clojure mode=E2=80=8B =E2=80=8B =E2=80=8B (add-hook 'cider-mode-hook #'eldoc-mode) =E2=80=8B ;; start eldoc after cider setups some of its internal things and= calls its hook=E2=80=8B =E2=80=8B =E2=80=8B (setq nrepl-log-messages t))) =E2=80=8B ;; some logging stuff (req-package-finish)=E2=80=8B ;; start loading =E2=80=8B=E2=80=8B This =E2=80=8B example may bit a bit hard to understand in concrete, but you may= get an idea.=E2=80=8B On Tue, Aug 11, 2015 at 6:30 PM Stefan Monnier wrote: > > Remember, how often you tackled into problem, when you need to require > one > > package, do some configuration, then the same with second and so on. > > Indeed, one of the problems I have here is to remember the last time > I had a problem like the one you describe. > > Obviously, we're not using the same set of packages or the same kind > of configuration. Can you give some examples you've bumped into? > > > Stefan > > >