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.bugs Subject: bug#19267: 25.0.50; Enhance cycle-spacing with a state where only whitespace after point is deleted Date: Sat, 14 May 2022 08:54:33 +0200 Message-ID: <87fslcfutv.fsf@gnu.org> References: <87lev4df7e.fsf@gnus.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="30986"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.20; emacs 29.0.50 Cc: Robert Pluim , 19267@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 14 09:17:32 2022 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 1npm1r-0007oZ-6e for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 May 2022 09:17:31 +0200 Original-Received: from localhost ([::1]:36284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npm1q-00008b-2Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 May 2022 03:17:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npm1O-0008Tj-6R for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 03:17:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51750) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npm1N-0003nz-SQ for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 03:17:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npm1N-0003lt-OC for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 03:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 May 2022 07:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19267 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 19267-submit@debbugs.gnu.org id=B19267.165251256914414 (code B ref 19267); Sat, 14 May 2022 07:17:01 +0000 Original-Received: (at 19267) by debbugs.gnu.org; 14 May 2022 07:16:09 +0000 Original-Received: from localhost ([127.0.0.1]:45647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npm0W-0003kQ-Or for submit@debbugs.gnu.org; Sat, 14 May 2022 03:16:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npm0V-0003ji-17 for 19267@debbugs.gnu.org; Sat, 14 May 2022 03:16:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npm0P-0003ee-Lq; Sat, 14 May 2022 03:16:01 -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=rQkgQMTFi21T1Jh4v2RT685aKUErN/E/QuKyxa320rM=; b=DCLuUq5Gp39UN8 +hIinj4BtJAwp+Pj+TPCtwQkUS+A65rUPWpgJTYwL/Qhvn1mqpsGpEMDHXP9wrM+w34KpAKw07/rg KoDsBtF/i5a7sqvrdYtngIWLx9sS4rdisj2tkHik8n6VbdE24m+fYL+qsDvdGaW71A3oeTgKVFs7O lSGAX16UZQ8hVl9wDIQaPLWoOgEal9zJWuV1WpeSOjKlAo8oaJTgvsOW2SXL33nPDq4Z2a6XLEitM UHbDbvmiCYlQuMEITfe552zOItsuIRwokZR2yxMiiYCsHqU2vtCSsjWUinPBUDh1T0KoAOAMIsZC0 2cYWhqBUVeNZ3UQPYBhg==; Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:35961) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npm0O-0004le-6q; Sat, 14 May 2022 03:16:01 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 3674027C0054; Sat, 14 May 2022 03:15:59 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 14 May 2022 03:15:59 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrhedtgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvvefuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe dujedtheduvdelffejkeetgedvheelhedvueefhfeukeekkeehvdfggeegffevgfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 14 May 2022 03:15:57 -0400 (EDT) In-reply-to: <87lev4df7e.fsf@gnus.org> 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:232216 Archived-At: Lars Ingebrigtsen writes: Hi Lars, >> Would it be ok for you to define it in your init file? I've documented >> the positive arg = tabs/spaces, negative arg = tabs/spaces/newlines as a >> general contract of all predefined actions (see new patch below) and >> your favorite action would immediately violate it... > > I think the newline-including variations would be as popular as the > non-newline ones, so I think we should have those variations for all > of the actions. You're quite strong willed, aren't you? ;-) > Perhaps `M--' could work as a toggle -- if the action doesn't include > newlines, `M--' switches on, and if it does, `M--' switches it off. That's indeed an idea. How about cycle-spacing-actions could also have actions of the form (just-one-space inverted-arg) (just-one-space 4) where the former would, you guess it, use the inverted value of this cycle's prefix arg and the latter would ignore the cycle's prefix arg and just use 4? That would fit your desire, right? >> No, at least not yet. But if they did, you would need to always give >> an explicit prefix arg when you really want to delete all spaces >> before/after point because the default value of a numerical prefix >> arg is 1. > > But it doesn't have to be, surely? No prefix for > delete-space-after-point could mean exactly that, but a prefix of four > could mean leave four. I don't like that no prefix arg (aka 1) would be treated differently than any other value. And what if you actually want to delete all but one space? Or do you suggest that cycle-spacing should be changed from taking a numeric prefix arg to a raw prefix arg and then do the conversion to numeric itself (with prefix-numeric-value)? That would make it possible to distinguish no prefix arg from 1. I think that would be benefitical otherwise, e.g., to force a new cycle. In any case, how would you define the semantics for the delete-* actions with numeric values for N? I mean, for delete-space-after/before I can imagine that the N whitespace characters after/before should survive (in case there are at least so many). But in case of delete-all-space, there's no precise meaning of the correct spaces around point which could be a wild mix of spaces, tabs, and newlines. I'd rather suggest to leave the delete-* actions as-is and add another just-one-newline (and probably also just-one-newline-and-indent) action which is like just-one-space with newline instead of space (plus one indent-according-to-mode). Bye, Tassilo