From: Michal Nazarewicz <mina86@mina86.com>
To: Alan Mackenzie <acm@muc.de>, Glenn Morris <rgm@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: key-binding for cycle-spacing
Date: Mon, 10 Feb 2014 14:45:03 +0100 [thread overview]
Message-ID: <xa1tbnyfhyjk.fsf@mina86.com> (raw)
In-Reply-To: <20140129202810.GA3092@acm.acm>
[-- Attachment #1: Type: text/plain, Size: 2622 bytes --]
On Wed, Jan 29 2014, Alan Mackenzie wrote:
> Also, why do we need this function? Surely somebody adjusting her
> whitespace at some place will know in advance whether she wants:
> (a) 1 space;
> (b) n spaces;
> (c) no space,
> and cycling through the possibilities to get there is an inefficient
> waste of time.
Albeit no. I'm using `cycle-spacing' with the following binding:
(define-key esc-map " "
(lambda (n) (interactive "*p")
(cycle-spacing (- n) t)))
and I sometimes end up with a situation like this one:
const unsigned long long foo =-!-
calculate_stuff() * calculate_other_stuff();
(-!- denoting point) in which case I don't know if I want 1 space or
whatever there is now. What I end up doing is hit M-SPC to end up with:
const unsigned long long foo = calculate_stuff() * calculate_other_stuff();
and if it fits in my window (which is 80-character wide) I go on with my
life, if it does not, I press M-SPC two more times.
(And before you ask, yes, I am aware of M-^ and C-_ but see below.)
> There are already suitable commands and bindings for them to do each of
> the things done by `cycle-spacing', namely M-SPC, C-u n M-space, M-\,
> and C-_.
Sure, but:
* It is *much* easier to press the same key sequence three times in
a row than to use different key sequences. Compare:
- hold ALT down
- press SPACE
- press SPACE
- press SPACE
- release ALT
with:
- hold ALT down
- press SPACE
- press \ (which in many keyboard layouts is on far right which
forces you to extend your pinky)
- release ALT
- hold SHIFT and CTRL down
- press _
- release SHIFT and CTRL
* I find it easier to remember one key sequence that does magic stuff
then to remember bindings for everything. I never use M-\ and don't
have to remember it's there because M-SPC almost always does what
I want it to do if I press it enough times.
Similarly, I have no idea what is the key binding is for going back to
indention or to the beginning of buffer since my C-a does all that for
me.
BTW. M-\ does not work on new line characters whereas `cycle-spacing'
can.
> I don't thing we need this function. I can't see a use case.
Hope the above helps.
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--
[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]
next prev parent reply other threads:[~2014-02-10 13:45 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-29 17:15 key-binding for cycle-spacing Glenn Morris
2014-01-29 17:21 ` Bastien
2014-01-29 17:44 ` Eli Zaretskii
2014-01-29 18:35 ` Glenn Morris
2014-01-29 18:46 ` Glenn Morris
2014-01-29 18:49 ` Eli Zaretskii
2014-01-30 2:33 ` Glenn Morris
2014-01-31 22:36 ` Tassilo Horn
2014-01-29 19:18 ` Teemu Likonen
2014-01-29 19:53 ` David Kastrup
2014-01-29 20:28 ` Alan Mackenzie
2014-01-30 2:37 ` Glenn Morris
2014-01-30 6:11 ` Alan Mackenzie
2014-01-31 22:40 ` Tassilo Horn
2014-01-31 22:55 ` Alan Mackenzie
2014-01-31 23:35 ` Tassilo Horn
2014-02-10 13:45 ` Michal Nazarewicz [this message]
2014-02-10 12:19 ` [PATCH] Make `cycle-spacing' behave more like `just-one-space' if called once Michal Nazarewicz
2014-03-27 14:27 ` Stefan Monnier
2014-03-28 16:29 ` Michal Nazarewicz
2014-01-29 20:30 ` key-binding for cycle-spacing Johan Bockgård
2014-01-30 2:32 ` Glenn Morris
2014-01-30 14:09 ` Richard Stallman
2014-01-30 15:21 ` Stefan Monnier
2014-01-30 23:23 ` Richard Stallman
2014-02-10 13:09 ` Michal Nazarewicz
2014-02-10 13:06 ` [PATCH] Make `cycle-spacing' behave more like `just-one-space' if colled once Michal Nazarewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xa1tbnyfhyjk.fsf@mina86.com \
--to=mina86@mina86.com \
--cc=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.