From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: [elpa] externals/switchy-window 682bcec0a6: Release 1.2: no code changes but don't suggest adding lambdas to hooks Date: Tue, 11 Apr 2023 19:57:04 +0200 Message-ID: <87bkjui9if.fsf@gnu.org> References: <168122524652.26571.12717876454918406453@vcs2.savannah.gnu.org> <20230411150046.C8002C13916@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31874"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.11.0; emacs 30.0.50 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 11 20:01:34 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pmIJC-00085D-6m for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Apr 2023 20:01:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmIIj-0005YH-6W; Tue, 11 Apr 2023 14:01:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmIIh-0005X6-Hb for emacs-devel@gnu.org; Tue, 11 Apr 2023 14:01:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmIIg-0000r9-Te; Tue, 11 Apr 2023 14:01:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=8xshF/4XDHZVgceWagU93gv2MCrNZXhmB5XpfR/Mj2c=; b=NnWwXqDWAcCtDN 2DeFrcNqQmpHoxG1mBiwuDVJRYptXT3TYdsGpg7QNRISJomUrB7eFUd1Ldi7s+GU9hDVxjtcW0+NX AV+UnMnwFyajl4NVp4fCY1KhykR59o1WMVbP1zq+tEBgJCW8tFcDy758DYeGs/vmIkHXbz+wJdd+/ d+ljSAOPeMIMo2Afj0rDrE+Q3EgxA65Mnw1iYpo0uIMQXZ7Nm4A1T5nwByBYdSJJwnTxsNsXB9H17 rqSgskOL1N0osun8K/7XqWfo0MH4Y6roUtpJokjFFRi6S/FNtw5z73dXrblfqQ4baqs0YzgLHW0pW 3opEBzCh5xRgkADUCzpg==; Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pmIIg-0006iH-Fu; Tue, 11 Apr 2023 14:01:02 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 4046827C005A; Tue, 11 Apr 2023 14:01:00 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 11 Apr 2023 14:01:00 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekgedguddvudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvfevufffjgfkgggtsehttdertddtredtnecuhfhrohhmpefvrghs shhilhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnh epudejtdehuddvleffjeekteegvdehleehvdeufefhueekkeekhedvgfeggeffvefgnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnh domhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeeh vdelkedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Apr 2023 14:00:59 -0400 (EDT) In-reply-to: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305243 Archived-At: Stefan Monnier writes: Hi Stefan, >> ;; Or as a substitute for `other-window'. >> +(defun my-switchy-window-set-or-unset-key () >> + (if switchy-window-minor-mode >> + (keymap-global-set " " >> + #'switchy-window) >> + (keymap-global-unset " "))) >> + >> (add-hook 'switchy-window-minor-mode-hook >> - (lambda () >> - (if switchy-window-minor-mode >> - (keymap-global-set " " >> - #'switchy-window) >> - (keymap-global-unset " ")))) >> + #'my-switchy-window-set-or-unset-key) >> ``` > > Why not just > > (keymap-set switchy-window-minor-mode-map > " " #'switchy-window) > > ? That's what I've tried first but it didn't work, i.e., C-x o was still other-window. I've now tried it again, this time successfully. I guess I fooled myself during testing, e.g., I've renamed the mode and map from switchy-window-mode(-map) to switchy-window-minor-mode(-map) at some point and probably tried remapping with the old name or something like that. I'll fix the snippets. Thanks a lot, Tassilo