Flutterby™! : Emacs and muscle memory

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Emacs and muscle memory

2023-11-16 23:05:01.27431+01 by Dan Lyke 0 comments

So Simon Tatham @simontatham@hachyderm.io asked

In #emacs, what's the easiest way to type (say) a hundred 0s?

For a non-digit printing char, ESC 100 x is easy. But for a digit, you need to indicate what's the count and what's the literal.

Perhaps C-q, "insert this literally even if you otherwise wouldn't"? For digits 8 or 9, that works, e.g. ESC 100 C-q 9.

But C-q special-cases octal[Wiki] digits! So the best I've found is to enter the octal code for the digit you want: ESC 100 C-q 060 RET. Yuck. Is there an easier way I've missed?

It's Emacs, there are a number of answers. C-u 100 C-u 0 works, the second C-u works as a delimiter. A smartass suggested C-x C-c vi RET 100 i 0 ESC, and, a couple of people suggested using C-x z, broken down by Choan Gálvez 🐐 @choanmusic@mstdn.social as

0                                                  ;; self-insert-command
M-9						   ;; digit-argument
M-9						   ;; digit-argument
C-x z						   ;; repeat

And of course there's "record a 0 macro", and other such things. But what I found interesting is that as I tried to think through a couple of strategies for this, I didn't have a direct mechanism. I had to wiggle through my fingers to remember how to do this stuff.

[ related topics: Interactive Drama ]

comments in ascending chronological order (reverse):

Add your own comment:

(If anyone ever actually uses Webmention/indie-action to post here, please email me)

Format with:

(You should probably use "Text" mode: URLs will be mostly recognized and linked, _underscore quoted_ text is looked up in a glossary, _underscore quoted_ (http://xyz.pdq) becomes a link, without the link in the parenthesis it becomes a <cite> tag. All <cite>ed text will point to the Flutterby knowledge base. Two enters (ie: a blank line) gets you a new paragraph, special treatment for paragraphs that are manually indented or start with "#" (as in "#include" or "#!/usr/bin/perl"), "/* " or ">" (as in a quoted message) or look like lists, or within a paragraph you can use a number of HTML tags:

p, img, br, hr, a, sub, sup, tt, i, b, h1, h2, h3, h4, h5, h6, cite, em, strong, code, samp, kbd, pre, blockquote, address, ol, dl, ul, dt, dd, li, dir, menu, table, tr, td, th

Comment policy

We will not edit your comments. However, we may delete your comments, or cause them to be hidden behind another link, if we feel they detract from the conversation. Commercial plugs are fine, if they are relevant to the conversation, and if you don't try to pretend to be a consumer. Annoying endorsements will be deleted if you're lucky, if you're not a whole bunch of people smarter and more articulate than you will ridicule you, and we will leave such ridicule in place.

Flutterby™ is a trademark claimed by

Dan Lyke
for the web publications at www.flutterby.com and www.flutterby.net.