all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Cc: Juri Linkov <juri@linkov.net>
Subject: RE: [External] : Re: master 371c4f642a 1/2: Add new commands to zoom emojis
Date: Thu, 30 Jun 2022 14:59:11 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488663F6D06187E6932B9E3F3BA9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87edz6ech5.fsf@gnus.org>

> These commands should probably be "self repeating" (i.e.,
> repeating without having to switch on repeat-mode).
>
> But do we have code somewhere to reuse the
> repeat-mode machinery in a convenient way?
> I poked around, but didn't see anything obvious.

(Caveat: I'm not following this thread.)

I don't use Emacs 28, with `repeat-mode'.  But surely
that should let you use its "machinery" conveniently,
no?  Wasn't that the idea behind adding it?

Anyway, this alternative is straightforward and works
fine, as a way to get a "self-repeating" command from
one that isn't.

(defun repeat-command (command)
  "Repeat COMMAND."
  (require 'repeat) ; Define its vars before we let-bind them.
  (let ((repeat-previous-repeated-command  command)
        (repeat-message-function           #'ignore)
        (last-repeatable-command           'repeat))
    (repeat nil)))

(defun next-buffer-repeat ()
  "Switch to the next buffer in the selected window.
You can repeat this by hitting the last key again..."
  (interactive)
  (require 'repeat)
  (repeat-command 'next-buffer))

(defun enlarge-window-repeat ()
  "Enlarge selected window vertically by one line.
You can repeat this by hitting the last key again..."
  (interactive)
  (require 'repeat)
  (repeat-command 'enlarge-window))

(defun isearch-yank-line-repeat ()
  "Yank buffer text till end of line onto search string.
You can repeat this by hitting the last key again..."
  (interactive)
  (repeat-command 'isearch-yank-line))

...


(You can also use `transient', but that's kinda
overkill for such simple behavior.)



  reply	other threads:[~2022-06-30 14:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165657886980.22137.11785189028438514501@vcs2.savannah.gnu.org>
     [not found] ` <20220630084754.DED31C016A1@vcs2.savannah.gnu.org>
2022-06-30  9:18   ` master 371c4f642a 1/2: Add new commands to zoom emojis Lars Ingebrigtsen
2022-06-30 14:59     ` Drew Adams [this message]
2022-06-30 16:10     ` Juri Linkov
2022-07-01  9:15       ` Lars Ingebrigtsen
2022-07-01 15:36         ` Juri Linkov
2022-07-04 16:57         ` Arash Esbati
2022-07-04 17:03           ` Eli Zaretskii
2022-07-04 17:23             ` Arash Esbati
2022-07-04 17:40               ` Eli Zaretskii
2022-07-04 18:06                 ` Arash Esbati
2022-07-04 18:14                   ` Eli Zaretskii
2022-07-05  7:15                     ` Arash Esbati
2022-07-05 11:00                       ` Eli Zaretskii
2022-07-05 12:40                         ` Arash Esbati
2022-07-05 11:18                       ` Lars Ingebrigtsen
2022-07-05 11:35                         ` Eli Zaretskii
2022-07-05 12:34                           ` Arash Esbati
2022-07-05 12:58                             ` Eli Zaretskii
2022-07-05 12:55                       ` Visuwesh
2022-07-05 18:23                         ` Arash Esbati
2022-07-07  9:42                           ` Arash Esbati
2022-07-07 10:50                             ` Eli Zaretskii
2022-07-10  8:35                             ` Eli Zaretskii
2022-07-10 17:01                               ` Arash Esbati
2022-07-10 17:09                                 ` Eli Zaretskii

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=SJ0PR10MB5488663F6D06187E6932B9E3F3BA9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.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.