unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>,
	"48134@debbugs.gnu.org" <48134@debbugs.gnu.org>
Subject: bug#48134: [External] : bug#48134: When sitting on top of a M-x item in the manual
Date: Sat, 1 May 2021 14:01:26 +0000	[thread overview]
Message-ID: <SA2PR10MB4474300ACEB624A15D1B037FF35D9@SA2PR10MB4474.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87fsz73t9z.8.fsf@jidanni.org>

> Do (info "(emacs) Colors")
> Now put the cursor on top of ‘M-x list-colors-display’
> and hope emacs realizes it... but it doesn't so we end up typing...

Icicles provides a trivial remedy for this, which
isn't really connected with completion or anything
particular to do with Icicles (except that it helps):

It binds `M-.' in `minibuffer-local-map' to a command
(`icicle-insert-string-at-point') that inserts some
text at point into the minibuffer.

With cursor on `list-colors-display', `M-x', then `M-.'
pulls that text into the minibuffer: `M-x M-. RET'.

You can use `M-.' anytime the minibuffer is active.
It inserts the text at point in the minibuffer.  You
can use it to pull in more than one bit of text.

I suggested several times that vanilla Emacs have such
a simple feature, but...
_____________

See this description:

https://www.emacswiki.org/emacs/Icicles_-_Inserting_Text_from_Cursor
_____________

And here's the doc string:

icicle-insert-string-at-point is an interactive compiled Lisp function
in ‘icicles-mcmd.el’.

(icicle-insert-string-at-point &optional ARG)

Insert text at the cursor into the minibuffer.

Each time this command is called, some text at or near the cursor is
inserted into the minibuffer.  One of two things happens, depending on
the value of option `icicle-default-thing-insertion' and whether or
not you use `C-u'.

See the doc for option `icicle-thing-at-point-functions' for a
complete description of its behavior.  What follows is an overview.

`icicle-thing-at-point-functions' is a cons of two parts - call them
ALTERNATIVES and FORWARD-THING.

If ALTERNATIVES is not nil and one of the following is true:
 - FORWARD-THING is nil
 - the value of `icicle-default-thing-insertion' is `alternatives' and
   you have not used plain `C-u' in this series of `M-.'
 - the value of `icicle-default-thing-insertion' is `more-of-the-same'
   and you have used plain `C-u' in this series of `M-.'
then the next function in ALTERNATIVES is used to retrieve the text to
be inserted.

If FORWARD-THING is not nil and one of the following is true:
 - ALTERNATIVES is nil
 - the value of `icicle-default-thing-insertion' is `more-of-the-same'
   and you have not used `C-u' in this series of `M-.'
 - the value of `icicle-default-thing-insertion' is `alternatives' and
   you have used `C-u' in this series of `M-.'
then function FORWARD-THING is used to retrieve the text to be
inserted.

If you use a numeric prefix arg (not just plain `C-u'), the behavior
is as follows.

* If a function in ALTERNATIVES is used (see above), then the text
  that is grabbed at or near point is read as a Lisp sexp and
  evaluated, and the value is inserted instead of the grabbed text.

  Yes, this means you need to know when the particular ALTERNATIVES
  function that you want is coming up next, and use, say, `C-9' just
  before hitting `M-.' for that alternative.

* If the FORWARD-THING is being used, then the prefix arg determines
  the number of things to grab, and the direction of grabbing.: A
  negative argument grabs text to the left of the cursor; a positive
  argument grabs text to the right.

You can use this command only from the minibuffer (`M-.').

  parent reply	other threads:[~2021-05-01 14:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01  5:41 bug#48134: When sitting on top of a M-x item in the manual 積丹尼 Dan Jacobson
2021-05-01  8:59 ` Kévin Le Gouguec
2021-05-01 12:15   ` 積丹尼 Dan Jacobson
2021-05-02  7:14     ` Lars Ingebrigtsen
2021-05-02 14:09       ` Howard Melman
2021-05-02 16:09       ` Kévin Le Gouguec
2021-05-03  9:00         ` Lars Ingebrigtsen
2021-05-01 14:01 ` Drew Adams [this message]
2021-05-01 14:35   ` bug#48134: [External] : " Eli Zaretskii
2021-05-01 16:28     ` Drew Adams
2021-05-01 20:09   ` Juri Linkov
2021-05-01 23:23     ` Drew Adams
2021-05-02 20:52       ` Juri Linkov
2021-05-03  0:35         ` Drew Adams

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=SA2PR10MB4474300ACEB624A15D1B037FF35D9@SA2PR10MB4474.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=48134@debbugs.gnu.org \
    --cc=jidanni@jidanni.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).