unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com>
To: emacs-devel@gnu.org
Subject: Minibuffer Execute + Repeat
Date: Sat, 16 Jan 2021 19:33:41 -0300	[thread overview]
Message-ID: <CH2PR01MB58796CA38DAE98564C24A5758BA60@CH2PR01MB5879.prod.exchangelabs.com> (raw)

In Emacs, some commands asks for user input by using a minibuffer
prompt. If you want to run that command again with the same or similar
input, you should run the command again (using the original keybinding
or 'C-x z') and type 'M-p' to get the last history element or type the
whole input again if history variable is absent. There are many use
cases where executing the command without leaving the minibuffer prompt
could be useful. A similar behavior exists today with 'M-e' on
isearch-mode, which is much more convenient that quitting the current
search and repeating the search command to modify the last input.

I know some packages exists that implements that feature, but doesn't
make sense to install a big package that will modify everything related
to minibuffer and completions. AFAIK, currently Emacs doesn't offer this
feature OOB and I failed to implement on my own using ELisp without too
much dirty hacks. The way 'exit-minibuffer' works and how commands and
args are stored ('last-command', 'real-last-command',
'current-minibuffer-command' and so on) makes it difficult to implement,
at least for me.

So I would like to know if there is any easy way to get this behavior
without installing big packages that re-implements the whole
minibuffer. Is this feature a thing we want to ship in Emacs, or at
least provide more functions/variables to make it feasible to be
implemented by users without too much hacking ?

Any guidance is appreciated, thanks!
Gabriel



                 reply	other threads:[~2021-01-16 22:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH2PR01MB58796CA38DAE98564C24A5758BA60@CH2PR01MB5879.prod.exchangelabs.com \
    --to=gabriel376@hotmail.com \
    --cc=emacs-devel@gnu.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).