unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23787: [PATCH] * lisp/bindings.el: create binding for ‘cycle-spacing’
@ 2016-06-17 20:12 Michal Nazarewicz
  2016-06-17 20:22 ` Eli Zaretskii
  2016-06-24 22:14 ` Michal Nazarewicz
  0 siblings, 2 replies; 7+ messages in thread
From: Michal Nazarewicz @ 2016-06-17 20:12 UTC (permalink / raw)
  To: 23787
  Cc: David Kastrup, Richard Stallman, Johan Bockgård,
	Tassilo Horn, Alan Mackenzie, Teemu Likonen

‘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.
+
 \f
 * 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






^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-24 22:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-17 20:12 bug#23787: [PATCH] * lisp/bindings.el: create binding for ‘cycle-spacing’ Michal Nazarewicz
2016-06-17 20:22 ` Eli Zaretskii
2016-06-17 21:13   ` Michal Nazarewicz
2016-06-17 22:06     ` Glenn Morris
2016-06-17 22:16       ` David Kastrup
2016-06-20 13:30       ` Michal Nazarewicz
2016-06-24 22:14 ` Michal Nazarewicz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).