I very much {like, use} the kmacro-*-counter
family of commands. However I sometimes find myself needing to generate alphabetic sequences (e.g., A, B, C, ...) instead of integer sequences (e.g., 1, 2, 3 ...). I can sorta see how to do this in 2 passes using query-replace-regexp
and something like make-string
, but that means 1st generating the integer sequence and then replacing it.
Is there an easier way? Particularly, is there some {command, function, package} that will support a usecase like
M-x foo-set-alpha-counter A
- (loop)
M-x foo-insert-counter
?
(char-to-string 65)
is the capital letter "A". And, this increments sequentially, e.g.,(char-to-string 66)
is the capital letter "B". Lowercase letters begin at 97; e.g.,(char-to-string 97)
is the lowercase letter "a"; and, it continues sequentially; e.g.,(char-to-string 98)
is the lowercase letter "b". To check the number, you can do the reverse --(string-to-char "A")
returns the number 65.