GNU bug report logs - #23787
[PATCH] * lisp/bindings.el: create binding for ‘cycle-spacing’

Previous Next

Package: emacs;

Reported by: Michal Nazarewicz <mina86 <at> mina86.com>

Date: Fri, 17 Jun 2016 20:13:01 UTC

Severity: wishlist

Tags: patch

Done: Michal Nazarewicz <mina86 <at> mina86.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michal Nazarewicz <mina86 <at> mina86.com>
To: 23787 <at> debbugs.gnu.org
Cc: Glenn Morris <rgm <at> gnu.org>, David Kastrup <dak <at> gnu.org>, Richard Stallman <rms <at> gnu.org>, Johan Bockgård <bojohan <at> gnu.org>, Tassilo Horn <tsdh <at> gnu.org>, Alan Mackenzie <acm <at> muc.de>, Eli Zaretskii <eliz <at> gnu.org>, Teemu Likonen <tlikonen <at> iki.fi>
Subject: bug#23787: [PATCH] * lisp/bindings.el: create binding for ‘cycle-spacing’
Date: Fri, 17 Jun 2016 22:12:16 +0200
‘cycle-spacing’ behaves like ‘just-one-space’ when invoked once so
binding it to M-SPC should not be (very) destructive to users.

When this change has been propesed back in 2014¹, the main concern
was that back then the function behaved a bit differently from the
old one in certain situations.  This has since been changed by a
[687e0e1: “Make ‘cycle-spacing’ behave more like ‘just-one-space’
if colled once.”] commit.

¹ https://lists.gnu.org/archive/html/emacs-devel/2014-01/msg02183.html
---
 etc/NEWS         | 6 ++++++
 lisp/bindings.el | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

 Unless there are objections, I’ll submit this in a week.  I’ve CC’d
 everyone who was involved in the original thread.

diff --git a/etc/NEWS b/etc/NEWS
index d8583cf..1041239 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -187,6 +187,12 @@ questions, with a handy way to display help texts.
 'undo', undo the last replacement; bound to 'u'.
 'undo-all', undo all replacements; bound to 'U'.
 
+** M-SPC is now bound to 'cycle-spacing'.
+When called once, 'cycle-spacing' behaves the same way
+'just-one-space' does so this change should not disturb any old
+habits.  When pressed multiple times it manipulate whitespace around
+point in a smart way giving user more editing powers.
+
 
 * Changes in Specialized Modes and Packages in Emacs 25.2
 
diff --git a/lisp/bindings.el b/lisp/bindings.el
index c13f4b1..cf9aaf3 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -807,7 +807,7 @@ esc-map
 (define-key esc-map "\\" 'delete-horizontal-space)
 (define-key esc-map "m" 'back-to-indentation)
 (define-key ctl-x-map "\C-o" 'delete-blank-lines)
-(define-key esc-map " " 'just-one-space)
+(define-key esc-map " " 'cycle-spacing)
 (define-key esc-map "z" 'zap-to-char)
 (define-key esc-map "=" 'count-words-region)
 (define-key ctl-x-map "=" 'what-cursor-position)
-- 
2.8.0.rc3.226.g39d4020





This bug report was last modified 9 years and 25 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.