From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Eval keymapp in a macros Date: Thu, 05 Aug 2021 01:56:08 +0200 Message-ID: <871r78ydbb.fsf@web.de> References: <87bl6fy4cf.fsf@web.de> <87r1faf4fy.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="8342"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Arthur Miller Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 05 01:56:37 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 1mBQkX-0001yn-Ix for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 05 Aug 2021 01:56:37 +0200 Original-Received: from localhost ([::1]:41228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBQkV-00077p-Vr for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 04 Aug 2021 19:56:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBQkB-00077e-9T for help-gnu-emacs@gnu.org; Wed, 04 Aug 2021 19:56:15 -0400 Original-Received: from mout.web.de ([212.227.15.3]:35459) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBQk9-0008K5-ID for help-gnu-emacs@gnu.org; Wed, 04 Aug 2021 19:56:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1628121369; bh=ZlXXelxvgR7dkT4yotnCVTCfh271W34uW4eZfClUrT4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=iYIzEFaA2AgqFpiH5XHgdRczhvbSTD+nHZhDYC954Ha0EaCsHise0nM/2v+E9Hdcf 8x23q5jxnrUxSQR+j82jJCYUtmK0F/6DKXH0lCO3NMI5ztvAfZbqXf4h5VoZCdejEe pcfF3ZhvA+6tPzl+cS4kghwLR0IqhYT+AnpEZ5Q4= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Le4js-1mwqNp1k0C-00psY0; Thu, 05 Aug 2021 01:56:09 +0200 In-Reply-To: (Arthur Miller's message of "Wed, 04 Aug 2021 12:52:09 +0200") X-Provags-ID: V03:K1:gPetJxg4nN1ISlYAHaD1377nF8M2wMR3X66CJX0K+ZKtXghcjhY 6BkXVkRelEa74V1z/odW87HJjodcGF0FE8TOzvZmQUG42iQT0zXp3wv9UYP2Nh/wq7H4cXO 3sOOvfsX6gT+uybO8ff0EKFWbNLwvdCj+XVtpmK4vkCqYaEVnJCo3+FED5mN0oG+XwFYw2T AZGYmYn7AI3X3Ne/AdHZQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:MLcQwZFOrso=:lubPLknrFH9AzzFV9mmc5k 43jLFTab+fuz0vpteVdjEpJCjGJKvPknQhoS0f+1EXpkmBKCOhYcSoMxtB+LuBklEfAjt1M7f 5tD+dxl8FscEn2mwjWGoYSDGnPua30uBUgeC+oRdkKgrCLHzT94IqhfikLaPAPM73F8tpOwhY tVz24DGQ1RQzUn8VM7BC/p4XPOfmMN/kJtbJBXbM9p+n+vTz1qkHnXM5xCZ1t3LEJSIZ2mGpZ FRMfEpSNv+KdFprGDzRCR3KnLDUdpVsMMEbX0ceFDfGap/VfkFziUfwvdNUkqGAualcKqcQi5 6u83bBM1Dcu8hY0QrfZ/FOyvzGzb8YQn08Xc0ppoufM+/Aj4N7PN9xyAasnFf0jZYhcJJPCi1 wbJZEHbmNfxVoXur2MOC4XYKC9htky7mV0npSvEFw6CddlLFKJo/vhmKvH/1n0P6Y7EROOaB7 3ZYDIDUL3YXbGMfvJYaZ0bU5bjyaO8XGdIplmQSsnv0bteD0/9UaRGYHhdnaY9Yzr9AAkPMaG ANBlumdzPcyo6RRDfJM8MzNW9Rlwd4ONYM0Yy4lfrfF2x5paiW7ZbVQYgw/2XYhh9ahle3RGS OZSwgR4zcMZbj7WjAC7d74wKzgkSagsvpV8X1z2LpQBZhITZs6ySG9jcdWviIe8Blk0+ymFqn Q7lrx1sGkj2RasPwYBNsjhCySbCbKVlmwX2o9cKFkeDrUrLn83/OHtAWwrMXU//kfz5HdsXLu YlYW23lhSYeIJBT624BbhN5E9X5DPXZhRJAfNT492jl9mYh7ij9P/k2R3o3Q11ABfDyzlG59 Received-SPF: pass client-ip=212.227.15.3; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:132364 Archived-At: Arthur Miller writes: > > Your `keymapp' fix is an emergency solution but it's not perfect: > > that test happens at compile time. If the keymap is not defined at > > compile time your compiled code will be inappropriate. I see now that I was wrong here - the test is performed at run-time. > I agree, but do I wish to pass name of undefined keymap to define-key? Not at run-time: when the `define-key' call is evaluated, the symbol must be bound, else you would get an error. But some way or the other something has to decide how to interpret a symbol. If you want to use the same notation for the cases, you need to use some kind of heuristic: in theory a symbol might name a function and might be bound to a keymap at the same time. And instead of `eval' better use `bound-and-true-p' - you know that you look at a symbol. You could also check whether the `symbol-name' ends with "...-map". Michael.