From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: using use-package Date: Tue, 28 Jun 2016 18:05:37 -0400 Message-ID: References: <20150805055619.13567.17B26335@ahiker.mooo.com> <17131863-cbb8-4a85-8470-490fe9a0c0d4@googlegroups.com> <66dceb24-5fef-4316-8c8b-e9a3e62b0fb8@googlegroups.com> <3594e2c6-bd02-412f-98df-9dd0f145277a@googlegroups.com> <01b4d996-aad3-44ff-a580-7950b25b7dc8@googlegroups.com> <87r3nbh3n3.fsf@russet.org.uk> <0566e644-b87b-46f9-91a5-b9c38befd55e@googlegroups.com> <18cc3e7d62270dbe3e40bb2b73087b60.squirrel@cloud103.planethippo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467151591 22693 80.91.229.3 (28 Jun 2016 22:06:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jun 2016 22:06:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 29 00:06:23 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 1bI19C-0005zP-Eu for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Jun 2016 00:06:22 +0200 Original-Received: from localhost ([::1]:40147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bI19B-0004x1-Pf for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Jun 2016 18:06:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bI18m-0004wv-E5 for help-gnu-emacs@gnu.org; Tue, 28 Jun 2016 18:05:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bI18i-0006BG-5Y for help-gnu-emacs@gnu.org; Tue, 28 Jun 2016 18:05:55 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:41369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bI18h-0006BB-U9 for help-gnu-emacs@gnu.org; Tue, 28 Jun 2016 18:05:52 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bI18d-0005c6-GA for help-gnu-emacs@gnu.org; Wed, 29 Jun 2016 00:05:47 +0200 Original-Received: from dyn.144-85-234-142.dsl.vtx.ch ([144.85.234.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jun 2016 00:05:47 +0200 Original-Received: from monnier by dyn.144-85-234-142.dsl.vtx.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jun 2016 00:05:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dyn.144-85-234-142.dsl.vtx.ch User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:US0ibeNJPBLwc6Sy3m9BI58Efv8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:110646 Archived-At: >> Well I would have thought that needing eval-after-load and relatives >> is evidence of a badly written (in Stefan's sense) package I do think it's a problem, but admittedly, the way keymaps are normally setup there's no standard&easy way for the package to "do the right thing". IOW it's a failure of the general infrastructure offered by Emacs to define and modify keymaps. I'd encourage anyone to try and come up with a good solution to this problem (it'll probably require changing "all" packages to use a new way to declare keymaps, but I think it's a price worth paying). >> For myself (as you seem to say) if use-package reduces all that >> imperative gunk I guess I'll use it As for me, I don't think (global-set-key (kbd "C-x C-b") 'electric-buffer-list) (with-eval-after-load 'buff-menu (define-key electric-buffer-menu-mode-map (kbd "X") 'save-buffers-kill-emacs)) is really worse than (use-package ebuff-menu :bind (("C-x C-b" . electric-buffer-list) :map electric-buffer-menu-mode-map ("X" . save-buffers-kill-emacs))) especially if you consider that the former uses functions and syntax which is used throughout Emacs, whereas the latter uses a syntax that's defined in an ad-hoc manner for use-package and isn't used elsewhere. It's also unclear how/why one of the bindings is available immediately while the other is only activated later (i.e. there's a bit too much ad-hoc magic for my taste). If the "X" binding could be auto-activated when the electric-buffer-menu-mode-map keymap is defined it would be much better but that would require getting away from using eval-after-load internally. Stefan