Subject: Re: bug#47688: 28.0.50; repeat-mode: Make rectangle commands repeatable. Also some misc. queries, comments

From: Juri Linkov <[email-masked]>
Date: Wed, 14 Apr 2021 21:12:54 +0300

> Could you please add rectangle commands to the repeatable set?  This
> is what I have in my .emacs.
> ...
>                  (rectangle-backward-char               . "b")
>                  (rectangle-backward-char               . ,(kbd "C-b"))
>                  (rectangle-exchange-point-and-mark     . "x")
>                  (rectangle-exchange-point-and-mark     . ,(kbd "C-x C-x"))
>                  (rectangle-forward-char                . "f")
>                  (rectangle-forward-char                . ,(kbd "C-f"))
>                  (rectangle-left-char                   . ,(kbd "<left>"))
>                  (rectangle-mark-mode                   . " ")
>                  (rectangle-mark-mode                   . ,(kbd "C-x SPC"))
>                  (rectangle-next-line                   . ,(kbd "<down>"))
>                  (rectangle-next-line                   . ,(kbd "C-n"))
>                  (rectangle-number-lines                . "N")
>                  (rectangle-previous-line               . ,(kbd "<up>"))
>                  (rectangle-previous-line               . ,(kbd "C-p"))
>                  (rectangle-right-char                  . ,(kbd "<right>"))

Thanks for the suggestions.  'C-x SPC' activates 'rectangle-mark-mode'
that already supports short key sequences similar to 'repeat-mode':

  (defvar rectangle-mark-mode-map
    (let ((map (make-sparse-keymap)))
      (define-key map [?\C-o] 'open-rectangle)
      (define-key map [?\C-t] 'string-rectangle)
      (define-key map [remap exchange-point-and-mark]
        'rectangle-exchange-point-and-mark)
      (dolist (cmd '(right-char left-char forward-char backward-char
                     next-line previous-line))
        (define-key map (vector 'remap cmd)
          (intern (format "rectangle-%s" cmd))))

There are already single keys to edit the rectangle.
If you want, you can request more short keys to be
added to rectangle-mark-mode-map in a separate report.
So it seems this request can be closed now.