all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>, 36525@debbugs.gnu.org
Subject: bug#36525: M-x default when cursor on top of a M-x command in INFO
Date: Sat, 6 Jul 2019 15:55:10 +0000 (UTC)	[thread overview]
Message-ID: <59855a35-cdc2-4c58-bcb2-791c62188374@default> (raw)
In-Reply-To: <87ftnj5s5s.2.fsf@jidanni.org>

> 2. Put the cursor on top of
> ‘M-x list-coding-systems’
> 3. Hit M-x
> 
> Wouldn't it be great if we saw that it was now
> the default in the minibuffer?
> 
> That way we could just hit RET to run it.
> 
> Currently C-h C-f knows what the cursor is on,
> but not M-x (ESC x).

A better way to handle this is to have a key
(Icicles uses `M-.') that pulls text from the
buffer into the minibuffer, appending it to
whatever input text might already be there.

This is much more general than just pulling
in a command name from an Info buffer.

But it also means that users should be given
some way to control over _which_ text from the
buffer should be inserted into the minibuffer.
There are several reasonable possibilities.

As food for thought, Icicles handles this as
described here:

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

Summary:

Repeated `M-.' can have two different behaviors.
You can choose (by an option) which one to use.

1. Repeating `M-.' cycles through alternative
   bits of text from the buffer.  Each time you
   hit `M-.' consecutively it inserts a different 
   string of text (replacing the previously
   inserted one).

   You can configure (user option) which kinds
   of text to grab.  By default the kinds are:

   . `non-nil-symbol-name-nearest-point'
   . `word-nearest-point'
   . `list-nearest-point-as-string'
   . Same (nearest list), but 2 levels up.
   . Same (nearest list), but 3 levels up.
   . `ffap-guesser' (but first deactivate a
     large active region)
   . `thing-at-point-url-at-point'

2. Repeating `M-.' grabs another thing of the
   chosen kind.  By default it is the next
   word (using `forward-word').

IOW, you can either (1) keep using `M-.' to
insert _additional_ text things of a kind you
choose with an option setting or (2) use `M-.'
to cycle to get one thing of a kind that you
choose on the fly.

[Note that for your example, either (1) or (2)
does what you request: `list-coding-system'
is added to the minibuffer.  `forward-word'
and `non-nil-symbol-name-nearest-point' both
grab that text.]

Whether vanilla Emacs would allow flexibility
to this degree is not so important as at
least having Emacs have a key that grabs
_something_ from the buffer text and appends
it to minibuffer input.  Choice #2 above is
pretty simple to realize - give users an
option to specify which kind of text thing
they want to insert.

Alternatively, Emacs itself could provide
some context-sensitive DWIM to determine the
kind of text thing to grab.  (As one user,
I prefer to control that choice myself, but
I'm sure that some others would be OK with
Emacs choosing.)





  reply	other threads:[~2019-07-06 15:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-06 11:17 bug#36525: M-x default when cursor on top of a M-x command in INFO 積丹尼 Dan Jacobson
2019-07-06 15:55 ` Drew Adams [this message]
2019-07-07  0:25   ` 積丹尼 Dan Jacobson
2019-07-07 22:43   ` Juri Linkov
2019-07-08  0:27     ` Drew Adams
2019-07-08 20:58       ` Juri Linkov
2019-07-08 21:37         ` Drew Adams
2019-07-09 20:09           ` Juri Linkov
2019-07-09 21:07             ` Drew Adams
2019-07-07 13:55 ` Basil L. Contovounesios
2019-07-09  8:52   ` 積丹尼 Dan Jacobson
2019-07-09 10:55     ` Stefan Kangas
2019-07-09 11:10       ` 積丹尼 Dan Jacobson
2019-07-09 12:24         ` Stefan Kangas
2019-07-09 12:24         ` Basil L. Contovounesios
2019-07-15  8:43           ` Sebastian Urban
2019-07-09 12:24     ` Basil L. Contovounesios
2019-10-14 20:53       ` Lars Ingebrigtsen

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=59855a35-cdc2-4c58-bcb2-791c62188374@default \
    --to=drew.adams@oracle.com \
    --cc=36525@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 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.