From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs 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) Message-ID: <59855a35-cdc2-4c58-bcb2-791c62188374@default> References: <87ftnj5s5s.2.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="260485"; mail-complaints-to="usenet@blaine.gmane.org" To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson , 36525@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 06 18:01:44 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hjn8A-0015V9-9g for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Jul 2019 18:01:42 +0200 Original-Received: from localhost ([::1]:60250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjn3E-0002ym-Hg for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Jul 2019 11:56:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60301) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjn2i-0002xU-9D for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2019 11:56:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjn2g-0005BT-Jf for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2019 11:56:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46967) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjn2f-0005Av-V9 for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2019 11:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hjn2f-0000SH-TJ for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2019 11:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jul 2019 15:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36525 X-GNU-PR-Package: emacs Original-Received: via spool by 36525-submit@debbugs.gnu.org id=B36525.15624285221702 (code B ref 36525); Sat, 06 Jul 2019 15:56:01 +0000 Original-Received: (at 36525) by debbugs.gnu.org; 6 Jul 2019 15:55:22 +0000 Original-Received: from localhost ([127.0.0.1]:55788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hjn21-0000RO-LY for submit@debbugs.gnu.org; Sat, 06 Jul 2019 11:55:21 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:56962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hjn1z-0000RB-Vh for 36525@debbugs.gnu.org; Sat, 06 Jul 2019 11:55:20 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x66FrTAo016119; Sat, 6 Jul 2019 15:55:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=ktSD1gMyz3Kxbt9rL8J/D0f3sM086B7NZjJjYJnQrnQ=; b=EeH5tM0YQc1cRMvh5gTZcU415BAORw1uXuPoP1tGFgb+lJuMaA0qk7xct+mV+0M8eCC9 NlmYvGUXutvlXrpPVJ7dFJEzBAlgHjSRhVl2VHaMq5pRTeWUVHiER8w/QvLXL2pmERHq YGErJcOiFjhIciiPk9+EspJuizgWNxGsEkFU+ylFm7M2Fghwrby3b8KfNALUpICMFgpI aSbZBS8acwbR0j8W4BljA8ucCRna4spmZSZxSCTn/QnM2P9Ibu4H6gJx7VwejpgGZOK6 jA5EgmWUDFAS3n1EbZwcVlMTtJjE+EFHmLPfNf+96j4aZgY5kVrqzcnt2kxse9ojK9RU EA== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2tjk2t9a4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 06 Jul 2019 15:55:12 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x66Fr0X3166049; Sat, 6 Jul 2019 15:55:12 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 2tjgrsyc5s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 06 Jul 2019 15:55:12 +0000 Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x66FtBKM022168; Sat, 6 Jul 2019 15:55:11 GMT In-Reply-To: <87ftnj5s5s.2.fsf@jidanni.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4861.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9310 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907060209 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9310 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907060209 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162241 Archived-At: > 2. Put the cursor on top of > =E2=80=98M-x list-coding-systems=E2=80=99 > 3. Hit M-x >=20 > Wouldn't it be great if we saw that it was now > the default in the minibuffer? >=20 > That way we could just hit RET to run it. >=20 > 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=20 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.)