From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Bind two commands to one key to toggle between them for the same local keymap. Date: Tue, 26 Oct 2021 09:44:48 +0800 Message-ID: References: <87y26lporl.fsf@zoho.eu> <87pmrxpky4.fsf@zoho.eu> <87lf2lpig4.fsf@zoho.eu> <87h7d9pg14.fsf@zoho.eu> <871r4dpesl.fsf@zoho.eu> <87sfwtnwwj.fsf@zoho.eu> <87a6izzkln.fsf@zoho.eu> <87mtmyre09.fsf@web.de> <87o87dnnra.fsf@web.de> <87lf2hat85.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21799"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 26 03:46:08 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 1mfBXU-0005PM-5v for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 26 Oct 2021 03:46:08 +0200 Original-Received: from localhost ([::1]:55344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfBXS-0000lg-7O for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 25 Oct 2021 21:46:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfBWS-0000lY-Sy for help-gnu-emacs@gnu.org; Mon, 25 Oct 2021 21:45:04 -0400 Original-Received: from mail-ua1-x92f.google.com ([2607:f8b0:4864:20::92f]:37657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfBWR-0002P0-33 for help-gnu-emacs@gnu.org; Mon, 25 Oct 2021 21:45:04 -0400 Original-Received: by mail-ua1-x92f.google.com with SMTP id f4so26041429uad.4 for ; Mon, 25 Oct 2021 18:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=L2kIq7uufVmOOIHkuSPul03la3bolEGSnHYzF59ioao=; b=gEGO+MTWv2AwBnsC79ECwdEFYWkleXkF0Z0Dp6NDa+neaZuN7BnLtz7J/KzAS8j9DI 7baDqNNj6khsiFI0W0MBxqnzwoElQhYB2FXOSjr2a9+gvVHDxwaMVXpje+eMF9T9RYEE J/M67LFo42FiyGM9Z9Ap6snF0g6hX6tW//mwgwbA4JJKHHuk9IF2b157OheFEUln6mNs 0GbPYqbQe8BdE4duG4s+qRYzPAIsxt2h9asRrM3PUV4OLL2D3U8YF4A+sHndaxzjEjxV l+sCRgeQovQ5Z+JbOEGRBS+mybY7boeod4dv15i7aih2v+iLhyYVjHZaKJoqLndk0Oou jh+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=L2kIq7uufVmOOIHkuSPul03la3bolEGSnHYzF59ioao=; b=3JzMYQgA/ciUj1REKr4piBJ3CUcZE9fLKrSQ7K+/IOg5JbuJGsGy2PAoJzrQF1Wjd7 WM2NePaxbVpMyA+Ck03V7e15o+Js2HYqKiQN8k3WYr+oUmBFiZYrd1ourZmXNDzP3pPi 3+eLNDcmYzu+6MGa6KCPJXXlksae7OrHyAIveonQuW7ZZkQoMgEausKk2emAOo9Xg2yO PpIMCq4yZ8m5S+EeW5rzkbfSWtENTG1V7A8y/T1dFcB9dcqZSueh5D8vP3EWIl3JIiY9 uPSRvyhCACS6vX6Sa3+sQFltBpT7F72KTh26BWDOGRJm77fgEDr/wdG1lys/VwhDAqPp ZV3g== X-Gm-Message-State: AOAM531H3Ycjuh+QbBiq4jCvGe6P9uczvdbUQYCusE0JoJHrFKNqEM0D EeLEgdesgLu1ooq4P1GrQ5T0LSlXvb42z61n8pA= X-Google-Smtp-Source: ABdhPJxABNsvw9fYJ/l3SO/Cz3Py5Bjqh6UMpK6Bhrtng7loR+cBWuYFAK0wYh/veNffaoDR2CK6ld6napfqScVqJVs= X-Received: by 2002:a67:edd7:: with SMTP id e23mr19518178vsp.14.1635212701880; Mon, 25 Oct 2021 18:45:01 -0700 (PDT) In-Reply-To: <87lf2hat85.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::92f; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x92f.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:134167 Archived-At: On Tue, Oct 26, 2021 at 1:57 AM Emanuel Berg via Users list for the GNU Emacs text editor wrote: > > Michael Heerdegen wrote: > > > And it does what you want? > > > > If you are done you can factor out the two identical > > interactive lambdas as a named function (using `defun'). > > And put (company-search-abort) on its own line ... (defun hz-company-search-toggle () (interactive) (if company-search-mode (company-search-abort) (company-search-candidates))) HZ