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: Fri, 13 May 2022 21:01:07 +0200 Message-ID: <87y1z5dz9w.fsf@gnu.org> References: <87czghwroc.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="33040"; 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 Fri May 13 21:11:13 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 1npagy-0008Oy-Jh for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 21:11:12 +0200 Original-Received: from localhost ([::1]:43990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npagx-0004O5-NM for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 15:11:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npago-0004MZ-I6 for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 15:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51151) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npago-0008CO-17 for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 15:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npagn-0006J2-Qb for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 15:11: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: Fri, 13 May 2022 19:11: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.165246904724202 (code B ref 19267); Fri, 13 May 2022 19:11:01 +0000 Original-Received: (at 19267) by debbugs.gnu.org; 13 May 2022 19:10:47 +0000 Original-Received: from localhost ([127.0.0.1]:45045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npagY-0006IH-RN for submit@debbugs.gnu.org; Fri, 13 May 2022 15:10:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npagW-0006I1-DN for 19267@debbugs.gnu.org; Fri, 13 May 2022 15:10:45 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npagQ-00089x-V4; Fri, 13 May 2022 15:10:39 -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=D1afBEqB2BxPmgxIUp4FDYDHo5+ZjnSLjwGUdSuX2QY=; b=ds65wxP5koDuRA IG3ZqdQK4Jvc+Zlaketl8cg/RJqKCFAzjvYHp+5NBd/9z8I1ibaV0lHlugJH8JfXQ59fbq2dnHJKH g0QIKlFdHL8XMxRWNPzicpJRIDnFYnQLJK3h1ZMzSBf1DaZ7TLnW9OWyRR1CR9IOWHxAc/WPSxTzO yqd2IY2DQW5LvqEpSQVeT4+LOTp9G7YEIWQ+/dR295z30w4DZHNTsJvEQtB6iyt2+yRu+Kd7nXVEH GWzFU0jyN5RA2mwQ1XgFXWtXGDrUyjOFf7n333C0cQxUIWeUXkhV9ED67OCsLIevMsMxHyDIsgoH2 CRMazfEFAtXFM9jSG/vg==; Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:33157) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npagQ-0004BU-OF; Fri, 13 May 2022 15:10:38 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 3521D27C0054; Fri, 13 May 2022 15:10:38 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 13 May 2022 15:10:38 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgeelgddufeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvvefuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe dujedtheduvdelffejkeetgedvheelhedvueefhfeukeekkeehvdfggeegffevgfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 May 2022 15:10:37 -0400 (EDT) In-reply-to: <87czghwroc.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:232191 Archived-At: Lars Ingebrigtsen writes: >> Ok, attached is a first version of the patch for discussion. The >> supported actions are: >> >> (setq cycle-spacing-actions >> '( just-one-space ; you name it >> ;; delete-space-after ; delete spaces after point >> delete-space-before ; delete spaces before point >> delete-all-space ; delete all spaces around point >> restore)) ; restore the original spacing >> >> In addition, you can add functions (symbols) into that list which are >> simply funcall-ed. > > Sounds good. There should also be a just-one-space-including-newlines > (which is the `M-- M-SPC' action), and... Uhm, perhaps that's all > that's missing, if we want to cover all the `M-SPC'/`M-\' actions. > > Or perhaps newline-including versions of all the functions, really. I'll make it so that the prefix arg is passed on in the cycle so M-- M-SPC M-SPC will delete all space including newline before point. IMO, that's better than a separate action. >> However, with the new version, I think it would make more sense >> when the prefix arg given to the initial invocation is passed on >> to following invocations of this cycle. The reason is that only >> just-one-space actually cares about the exact numerical value >> whereas all actions (except 'restore) care about the prefix arg >> being positive or negative. > > delete-space-before/after could also care about the numerical prefix? Yes, in the sense that negative means "including newlines". >> A negative arg always indicates that newlines are treated as a >> deletable space whereas arg => 0 only considers tabs and spaces. >> So right now, if you want to delete all space including newlines, >> you have to type M-- M-SPC M-- M-SPC M-- M-SPC which is >> inconvenient. If the initial arg was passed on, it would just be >> M-- M-SPC M-SPC M-SPC which is much easier to type. > > After typing `M-- M-SPC' once, further incantations of that doesn't do > anything, does it? Right now and with my patch, M-- M-SPC would call (just-one-space -1) and the next M-SPC would start another cycle with (just-one-space 1) because the prefix arg changed. My suggestion is that M-- M-SPC M-SPC will call (just-one-space -1) (delete-space-before -1) [ok, the latter is no function but you get the idea]. Bye, Tassilo