From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: Re: use-package Date: Wed, 04 May 2016 03:33:45 +0000 Message-ID: References: <874magv15u.fsf@mat.ucm.es> <87d1p38ll6.fsf@mat.ucm.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1462332895 15018 80.91.229.3 (4 May 2016 03:34:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 May 2016 03:34:55 +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 Wed May 04 05:34:50 2016 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 1axnaK-0002du-Az for geh-help-gnu-emacs@m.gmane.org; Wed, 04 May 2016 05:34:48 +0200 Original-Received: from localhost ([::1]:45524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axnaG-0000UP-84 for geh-help-gnu-emacs@m.gmane.org; Tue, 03 May 2016 23:34:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axnZy-0000FD-PZ for help-gnu-emacs@gnu.org; Tue, 03 May 2016 23:34:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axnZm-00014H-DZ for help-gnu-emacs@gnu.org; Tue, 03 May 2016 23:34:21 -0400 Original-Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:36589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axnZl-000116-3u for help-gnu-emacs@gnu.org; Tue, 03 May 2016 23:34:14 -0400 Original-Received: by mail-oi0-x229.google.com with SMTP id x201so50921623oif.3 for ; Tue, 03 May 2016 20:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=wsGiPALJepNenY+tscoYVO6XVTEQ80gjLbqbinfpEOw=; b=yPP781RSpVYJuBJPdTpemyfi6W7Kkp+DzjMRpM3e/sxN7EOb1VywTSBWEvnDZ+vCtI j8Oc7WWJHa6SGGr6fylcNEEO7z2oskyC3bJ9V+DSiVGSUzusS3IIqbOqvmwhlpmF4E63 kVu6E+HF8rhN/KPolbF0HwvdaAKAQfDeba1C/R3sb+c8BSY2vkldBtVQFmyNrULuTCT/ pr4WJLq0S9HY7vJVviWpXXmoB3hOs199a5I1bPAVpmuTGmnDlCldMwn1t2EC1Gpe/Ekd jM43nqkO3FOfmVzIESzaHlLbHwTEo3TAobesAl6493xn+YUDKVG2LT4jEzzcLFD2dPDk UMJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=wsGiPALJepNenY+tscoYVO6XVTEQ80gjLbqbinfpEOw=; b=kGvoaRgNRImUKrd5HEuBeqcBVMOsUzrHaXKPfAXoNyBoTeKE77TpdZKXOM6YYfwi3j MXSStOJOqyKhhBOvOeNX2XWMgZrDDHYI7Bctgy/7hhAYwcu9eLzVOTsUzbhcNzhvyiwP GzSoi8vWOzGWQ5DjBiSw3019x1v/mYMFa/ar2z41j3WlOXD7MJhAbUJEiqHx8CImjdym sitZTV6rPcz6KzVW16M7fyjFwVM6W2i5vSYMQnevo0RZ3d7s9N1GO2rMNWDwLPFq+4cf Urt4egmBun/SUO+plk+ZNyXS4AE3qfy02qnWsaFxv/Lu/CSkjBj2wZuiUOwLxG7EIsEh /Yrw== X-Gm-Message-State: AOPr4FUCNCH1qliIdOmmAvD2B6Iguctd7Uk2s8VD9HpFwitmlxrVu4HeXyp4SrFsdocCCMRI/YjrWTqMg8LQow== X-Received: by 10.202.60.194 with SMTP id j185mr2707016oia.197.1462332835402; Tue, 03 May 2016 20:33:55 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::229 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:109869 Archived-At: > > In my point of view, the job that use-package does is only useful when > the corresponding package is poorly setup to start with. > IOW, if use-package is helpful, usually it indicates a shortcoming in > the package or in the way the package is installed. > That, or the user installing the package is just not completely aware of implications of during (require 'PKG-NAME) for all the installed packages. I can talk of myself that when I began using emacs, I simply did (require 'PKG-NAME) for any new package I installed, because sometimes I got errors like undefined variable blah at emacs startup. And using the require magically solved the problem. For instance, we cannot do (add-to-list 'package-archives '("org" . " http://orgmode.org/elpa/") t) before doing (require 'package). Well, this is a valid case where we need to do require first as package-archives does not autoload package. At one point, it became a "style" to require all the installed packages. I had never head of eval-after-load at that time. Even if I had heard, I would have thought that that's probably for "advanced" emacs user and I as a newbie probably doesn't need to learn or use that. use-package adds a simply syntactic sugar that does that "advanced stuff" under the hood. Another useful function that use-package uses is run-with-idle-timer using which you can lazy load a package which you typically don't care about loading immediately at startup.. like yasnippet; by using the :defer keyword in use-package. I am not qualified enough to judge if yasnippet could have been coded better so that I didn't need to lazy load it. But delaying loading this package made a significant difference to my emacs startup, especially because I save and load desktop with about 50-60 files open. I do not need yasnippet to load the snippets for all the major modes in those 50-60 files immediately at startup. That's right. But that's already the case without doing any config at > all (because org-mode is setup properly to start with), so you shouldn't > need use-package for that. > That's correct. The syntactic sugar for eval-after-load applies here too. (Also, it's easy to simply prevent loading of a package you suspect to be misbehaving by adding :disabled keyword for that package's use-package form. With that you prevent loading that package and also evaluating your config for that package like keybindings, advices, overrides, wrapper defuns, etc). > I see use-package as having 2 benefits: > - work around package shortcomings as described above. > - help the user structure his .emacs configuration. > And also, get a new user acquaint themself to different ways by which a package loading can be delayed using various use-package keywords like :commands, :bind, :defer, :mode. > I'd like to see those two parts separated, FWIW. > I don't understand why that is important. -- -- Kaushal Modi