From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#41438: [PATCH] Allow windmove keys to be bound without prefix or modifiers Date: Tue, 25 May 2021 14:39:05 +0000 Message-ID: <87bl8ysws6.fsf@icterid> References: <87imgpw7k3.fsf@warpmail.net> <87mu36enhl.fsf@posteo.net> <8735uru1py.fsf@gnus.org> <871r9yjyv5.fsf@posteo.net> <87h7irqtvf.fsf@gnus.org> <87im37p2b4.fsf@icterid> <87v977ghtr.fsf@icterid> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34350"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41438@debbugs.gnu.org, Lars Ingebrigtsen , Juri Linkov To: Arthur Miller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 25 16:40:12 2021 Return-path: Envelope-to: geb-bug-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 1llYE8-0008lD-GE for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 May 2021 16:40:12 +0200 Original-Received: from localhost ([::1]:39914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llYE7-0001B2-JI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 May 2021 10:40:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llYDy-0001Ao-L0 for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 10:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llYDy-0006d2-Do for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 10:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1llYDy-0000Km-AN for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 10:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 May 2021 14:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41438 X-GNU-PR-Package: emacs Original-Received: via spool by 41438-submit@debbugs.gnu.org id=B41438.16219535581223 (code B ref 41438); Tue, 25 May 2021 14:40:02 +0000 Original-Received: (at 41438) by debbugs.gnu.org; 25 May 2021 14:39:18 +0000 Original-Received: from localhost ([127.0.0.1]:46528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llYDF-0000Jf-PD for submit@debbugs.gnu.org; Tue, 25 May 2021 10:39:18 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:45657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llYDB-0000JN-TM for 41438@debbugs.gnu.org; Tue, 25 May 2021 10:39:16 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 8F5AF240026 for <41438@debbugs.gnu.org>; Tue, 25 May 2021 16:39:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1621953547; bh=D6hjP1rJTSDglMrQTHL9RUiLorEV6+pTI16Ev0rE9So=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=dhzTgrcGsYgGwPmJ60pNbNv/vB0Gyfdhv6IgY0CqirRBRpxhWvY+jBhHj5Ib4kNIp UEI3aISf2InhnQ9MrhBKM/h7BRtGIbGNwIQp3At/ON7x+pACHKCtoT1uKtj9x3qVpQ Teo7Tatk8uM8+EEIZvflvDIEdglGhrk1b+lm28a77Om8/fPdeSsAcLS6Qjq1NttrdN 112csq+w+pD6C5DN3ZVy1IfjUJOq3OYTt7ENJ/cI9U78CnjmRxmFH9lIZ7BN8N0n9Z 8j9hJs4KTU7G0ad+CUMxTj05ObaStSqxRftYMzAgNPa5/cF/WhJVreNCxkOp3sDFRw 9waPJKomPsuAw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FqGtL0X1xz6tmB; Tue, 25 May 2021 16:39:06 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=mutual; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: (Arthur Miller's message of "Tue, 25 May 2021 15:31:43 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207219 Archived-At: Arthur Miller writes: > Philip Kaludercic writes: > >> Arthur Miller writes: >> >>> Philip Kaludercic writes: >>>> +(defvar windmove-default-map (make-sparse-keymap) >>>> + "Map used by `windmove-install-defaults'.") >>> >>> Sorry if I ask, but wouldn't ordinary windmove-mode-map do here? >> >> You are probably right -- my thought was that the minor mode exists for >> the sake of the map. > > Yeah, exactly in this case. I am not sure if I understand correctly, you > mean people will set new map for the mode to change bindings? No, that is why the minor mode is active by default. The only reason the minor mode is defined is to modify minor-mode-map-alist. >> That's the question: should windmove-default-map be accessed by default >> or only via the -default-keybindings functions? Either way something > > I think you are thinking about default keybindings reather than default > map. If I assume correctly. If I understand corectly you would like to > preserve some default bindings, the map is just a mean to accomplish it. I am not sure what you are referring to, the map is manipulated by windmove-install-defaults, which in turn is used by * windmove-default-keybindings * windmove-display-default-keybindings * windmove-delete-default-keybindings * windmove-swap-states-default-keybindings So it is not just about preserving some default bindings, but ensuring that the explicitly requested bindings are installed correctly. >> should be changed, if windmove-default-map it should be renamed to >> windmove--default-map to explicitly mark it as an internal >> map. Otherwise it shsould be renamed to windmove-mode-map as you suggest. > > Either use default map stored some "default var", and add a function > that restores mode map, or just add a function that resets keybindings > into mode map directly, which might be sufficient. I don't know matter > of taste? A default mode map in a variable is cleaner but more costly? > > Emacs provides windows, so I think there should also be a default way of > moving cursor between them, manipulate them and so on. Thus I think > windmove operations should be on by default, I don't think C-x 1/2/3/o > are satisfying when we have more then 2 widows. > > A minor mode is probably a good balance between altering Emacs defaults, > so not break someones config, and to give people an option to easily > turn on some useful feature/configuration. I'm sorry, either I am missing something or we are talking besides one another. -- Philip K.