help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ABC index


From: Daniel Martín
Subject: Re: ABC index
Date: Tue, 27 Oct 2020 23:12:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin)

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> A friend asked how to do this
>
> Kate Moss
> Elle Macpherson
> Alicia Silverstone
>
> into this
>
> A Kate Moss
> B Elle Macpherson
> C Alicia Silverstone
>
> No idea why!
>
> Anyway, ABC index contest! Elisp and keyboard macros allowed!
>

Interactively, make a rectangle selection just before the first column
and then:

C-u C-x r N 65 RET %c  RET

In Lisp, you could write something like

(defun rectangle-char-lines (beg end letter)
   (interactive "r\ncStart letter:")
   (rectangle-number-lines beg end letter "%c "))

and bind it to a key.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]