[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: use-package: load package on key prefix
From: |
Phillip Lord |
Subject: |
Re: use-package: load package on key prefix |
Date: |
Tue, 10 May 2016 11:26:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) |
Joe Riel <joer@san.rr.com> writes:
> 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?
You could bind C-x p to a command that loads p4 when pressed, and then
unbinds itself.
Something like this (untested!)...
(use-package p4
:defer t
:ensure t
:bind ("C-x p" . my-p4-load))
(defun my-p4-load()
(require 'p4)
(unbind-keys "C-x p"))