From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: use-package: load package on key prefix Date: Mon, 09 May 2016 16:26:07 +0200 Message-ID: <87k2j3cnpc.fsf@mbork.pl> References: <20160507140453.2ccfcc44@gauss> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1462804611 2226 80.91.229.3 (9 May 2016 14:36:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 May 2016 14:36:51 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 09 16:36:39 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 1azm8p-0003ao-PF for geh-help-gnu-emacs@m.gmane.org; Mon, 09 May 2016 16:26:35 +0200 Original-Received: from localhost ([::1]:41614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azm8o-0000dr-Rz for geh-help-gnu-emacs@m.gmane.org; Mon, 09 May 2016 10:26:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azm8d-0000ZK-9H for help-gnu-emacs@gnu.org; Mon, 09 May 2016 10:26:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azm8Y-0008CP-VI for help-gnu-emacs@gnu.org; Mon, 09 May 2016 10:26:22 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:37461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azm8Y-0008C9-Ob for help-gnu-emacs@gnu.org; Mon, 09 May 2016 10:26:18 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 6EB43B51625; Mon, 9 May 2016 16:26:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vF9FNTEeCeuo; Mon, 9 May 2016 16:26:10 +0200 (CEST) Original-Received: from localhost (98-171.echostar.pl [213.156.98.171]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 0808BB51623; Mon, 9 May 2016 16:26:07 +0200 (CEST) User-agent: mu4e 0.9.13; emacs 25.1.50.9 In-reply-to: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2a01:5e00:2:52::8 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:109910 Archived-At: On 2016-05-09, at 14:28, Stefan Monnier wrote: >> I use the p4 (perforce) package which uses C-x p as a prefix for its >> bound keys. Can use-package be configured so that it loads the >> package (which presumably assigns the key-bindings) when C-x p is pressed? > > I don't know if use-package supports it, but Emacs can definitely do > that (it's called "autoloaded keymaps"), and if it makes sense for > p4.el, than I'd argue that you should report a bug against p4.el saying > that p4.el should do that (rather than dump that responsability on the user). Interesting, I didn't know about autoloaded keymaps, thanks! > This said, this feature of Emacs is mostly never used: when a package > has a dedicated prefix key, it typically also has a menu-bar (sub)menu > and that one can't be autoloaded (well, technically it can be > autoloaded, but in practice the automatic load will happen much too > early, i.e. the first time you look at any part of the menu). Not necessarily "much too early": I practically _never_ look at _any_ part of the menu;-). > Stefan Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University