From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Richard Subject: Re: simple way to call `C-c a v' or a way to bind it to a key? Date: Mon, 17 Feb 2014 10:43:48 +0100 Message-ID: <87eh32axbf.fsf@yahoo.fr> References: <87k3cw1osk.wl@dns1.atmark-techno.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFKkB-00055X-VG for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 04:44:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFKk5-0004uN-Pn for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 04:44:07 -0500 Received: from mxin.ulb.ac.be ([164.15.128.112]:64650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFKk5-0004u7-K1 for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 04:44:01 -0500 In-Reply-To: (Marc Ihm's message of "Sun, 16 Feb 2014 22:20:42 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Marc Ihm Cc: emacs-orgmode@gnu.org Marc Ihm writes: > (global-set-key (kbd "") (lambda () (interactive) (execute-kbd-macro (kbd "C-c a v")))) (global-set-key (kbd "") (kbd "C-c a v")) might be a little easier to read and type. Explanation is : global-set-key can take any "command" as argument, and the definition of what a "command" is includes keyboard macros. That is vaguely explained at (info "(elisp) What Is a Function") -- 2nd paragraph after the term "command". > P.s.: In my opinion, the name "execute-kbd-macro" of this builtin function is somewhat misleading; > "replay-keys" describes this usage closer ... I think I wouldn't look for replay-keys if I did not know about the function. My own problem is that I usually look for "call-kbd-macro", which doesn't exist, instead of "execute-...". I guess everyone can't be pleased ! -- Nico.