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: use-package: load package on key prefix Date: Mon, 09 May 2016 08:28:41 -0400 Message-ID: References: <20160507140453.2ccfcc44@gauss> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1462798442 27493 80.91.229.3 (9 May 2016 12:54:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 May 2016 12:54:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 09 14:53:54 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 1azkZs-0007eH-DZ for geh-help-gnu-emacs@m.gmane.org; Mon, 09 May 2016 14:46:24 +0200 Original-Received: from localhost ([::1]:41115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azkZr-0002KJ-Qj for geh-help-gnu-emacs@m.gmane.org; Mon, 09 May 2016 08:46:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azkZY-0002Fh-2m for help-gnu-emacs@gnu.org; Mon, 09 May 2016 08:46:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azkZU-0004Bh-KK for help-gnu-emacs@gnu.org; Mon, 09 May 2016 08:46:03 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:56295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azkZU-0004BV-AC for help-gnu-emacs@gnu.org; Mon, 09 May 2016 08:46:00 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1azkOf-0003Rc-RN for help-gnu-emacs@gnu.org; Mon, 09 May 2016 14:34:49 +0200 Original-Received: from 192-171-43-150.cpe.pppoe.ca ([192.171.43.150]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 May 2016 14:34:49 +0200 Original-Received: from monnier by 192-171-43-150.cpe.pppoe.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 May 2016 14:34:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 17 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 192-171-43-150.cpe.pppoe.ca User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:mK9dwAVWPvadAx1YaaMpcpXxuGI= 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:109908 Archived-At: > 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). 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). Stefan