From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Eval keymapp in a macros Date: Wed, 4 Aug 2021 11:54:02 +0700 Message-ID: References: <87bl6fy4cf.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11146"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Heerdegen , help-gnu-emacs To: Arthur Miller Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 04 06:54:40 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 1mB8vP-0002ks-A4 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 04 Aug 2021 06:54:39 +0200 Original-Received: from localhost ([::1]:41982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mB8vN-0007Wp-Sz for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 04 Aug 2021 00:54:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mB8v3-0007Wf-IP for help-gnu-emacs@gnu.org; Wed, 04 Aug 2021 00:54:17 -0400 Original-Received: from mail-vk1-xa30.google.com ([2607:f8b0:4864:20::a30]:42613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mB8v1-0006te-5V for help-gnu-emacs@gnu.org; Wed, 04 Aug 2021 00:54:17 -0400 Original-Received: by mail-vk1-xa30.google.com with SMTP id w15so206050vkm.9 for ; Tue, 03 Aug 2021 21:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VO01WuNwoF+lBaFoARl86h0KHPlWYEi7LE6bdjUNnug=; b=IT9kIx/bGFGs5BLCbXcauMwki41hptITVKzw7T+lg4Ih8Ma/al0hUf65WmXFF83SQG idiQgeId5RIh6dbmJDji5OwWOlDljvZh4hnH0MGtR4PrC9J+3ZbHY0pzQSMQosFiZ/c+ dqXMNX04zeVE3/psR2PkHQny07xPdC6pcdGXXfzg35qWpilFywsZwkl+qNkFuCtmwzv+ 1E5zWyHft//K7AGl+GPmJR5OzhPPu9Z1QufpRDf6DL6GtcmtxXHjOwGIkOgzgfbyTGvJ 5jFaR9BNz8auEPKJXfKqWgQ1Zl7BEtLs+cgzdBH8zLf0kX5xkvbZO+MNMm4RKCyDVLY6 rv+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=VO01WuNwoF+lBaFoARl86h0KHPlWYEi7LE6bdjUNnug=; b=MtBQw9PILNIkwNY5gS9duA4fMEsqv/l09/d2dAjaNd35P2zOD251Jc5/D39km86rqf WClPRewHQQi1C9mD/y/59GGr++ptQuZbhXvJI1cEyIeO5McY3r1E7urGoX72CTIcfmMU i2rGN1yO9SHR7ADooFT6XGVTv405TA8ZuoAMvXqA0J1+x7rXCAwFAaXZ6Xk0LBSCsXZA iiJFLqnD/sox4Ho+V1pbDDtMaWiq+a2dqQSZMO6Dh+AM/HNAtYcphfWcVhegR72OII3e G04Jp3Zj7KBc8/uFruSNG2cTaTyBShnX3KuhGEggeKZHkRYvVJVo1BXVKqFDniE7zrAT TJzQ== X-Gm-Message-State: AOAM533NtAj01/5NgmNax2Mb3ilA2ORWrC1N/AIgWPEIBNn7w8UCt1he FJbFaypzGSZQEK8ud0EOU4CDif0B/ECcwlTX47U= X-Google-Smtp-Source: ABdhPJxpayojr+h3tMxQ1FB8Q418QuZLgdyUMs7IKFCYZH5VhAkAmNnGIOPtHxVgF6++xpaNYVD1DGEzqijqoXynr4E= X-Received: by 2002:a1f:1cd7:: with SMTP id c206mr15457420vkc.22.1628052853400; Tue, 03 Aug 2021 21:54:13 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::a30; envelope-from=yurivkhan@gmail.com; helo=mail-vk1-xa30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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:132356 Archived-At: On Wed, 4 Aug 2021 at 04:20, Arthur Miller wrote: > Here is example from my init file (with conses): > > (with-key-map global > ;; Window-buffer operations > ("C-" . term-toggle) > ("" . term-toggle-eshell) > ([f9] . ispell-word) > ([S-f10] . next-buffer) > ([f10] . previous-buffer) > ([f12] . kill-buffer-but-not-some) > ([M-f12] . kill-buffer-other-window) > ([C-M-f12] . only-current-buffer)) Two observations from the side: * =E2=80=9Cwith-*=E2=80=9D naming is usually used for context manager macro= s. That is, a macro initializes some resource or performs some temporary changes, then executes the body, then does any necessary cleanup. You don=E2=80=99t have any of that here. * If you sacrifice a quote and a pair of braces, you can have your typing saving as a simple function: (my-define-keys global-map '(("C-" . term-toggle) ("" . term-toggle-eshell) =E2=80=A6))