From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Eval keymapp in a macros Date: Thu, 05 Aug 2021 12:34:43 -0400 Message-ID: References: <87bl6fy4cf.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11538"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Monnier via Users list for the GNU Emacs text editor To: Arthur Miller Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 05 18:35:29 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBgLB-0002jh-7K for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 05 Aug 2021 18:35:29 +0200 Original-Received: from localhost ([::1]:59286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBgL9-00057r-BV for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 05 Aug 2021 12:35:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBgKa-00057i-IR for help-gnu-emacs@gnu.org; Thu, 05 Aug 2021 12:34:52 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3202) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBgKY-0007pr-HH for help-gnu-emacs@gnu.org; Thu, 05 Aug 2021 12:34:51 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3094B440F1E; Thu, 5 Aug 2021 12:34:45 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E835C440CB6; Thu, 5 Aug 2021 12:34:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1628181283; bh=At0gbkmCqdu/rpvLh8RvKyrTWN8ofeqztUcvmrkU+T8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=CqzPx8N8CtB+RkhT0KqAtZVmX2nag1lb4oagePPc8uaYysmVqTrMeKTF3Fh4C0vgv TFWY+2FbuR0zbrASfEL6J3uRwE1kLrxlwvuvalBXWvKtYvp1WK58p7FM5dWuDzRx/W X2cJnfizq5pp73OzpsH12viZvvmIUjDcbjlbwKUrKkpS6grrzll7kIOd3Nzy3Z74iz /8PN5xbQYMlIDt+P2iiTJCnkHZNVeplyrYX/9AFItkEEDfCFZ7Pa1LU0N4hZDGIYax ozfQhJGkIio/h5+/LbDn79cPwVr9+o01GrnMY8Mn38amBfmVZJ4zTP6ucu7mOD6eKJ Zv+QauKuX3WIg== Original-Received: from alfajor (unknown [216.154.29.138]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B2A89120396; Thu, 5 Aug 2021 12:34:43 -0400 (EDT) In-Reply-To: (Arthur Miller's message of "Thu, 05 Aug 2021 18:04:30 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132371 Archived-At: > (setq pkg-ops-map > (let ((map (make-sparse-keymap "Packages"))) > (with-key-map map > ("h" . '("describe" . describe-package)) > ("a" . '("autoremove" . package-autoremove)) > ("d" . '("delete" . package-delete)) > ("i" . '("install" . package-install)) > ("s" . '("selected" . package-install-selected-packages)) > ("r" . '("refresh" . package-refresh-contents)) > ("l" . '("list" . list-packages))) > map)) > > (with-key-map global-map ("C-c p" . pkg-ops-map)) > > The last line will eval, but at runtime gives error: Wrong type > argument: commandp, pkg-ops-map. You can circumvent the problem with (defalias 'pkg-ops-map pkg-ops-map) -- Stefan