* bug#355: M-x should prompt with function under cursor as default [not found] <mailman.12639.1212534433.18990.bug-gnu-emacs@gnu.org> @ 2008-06-05 1:18 ` John Paul Wallington 2008-06-05 17:58 ` jidanni 2008-06-05 19:11 ` John Paul Wallington 0 siblings, 2 replies; 12+ messages in thread From: John Paul Wallington @ 2008-06-05 1:18 UTC (permalink / raw) To: jidanni; +Cc: 355 jidanni@jidanni.org writes: > So I put the cursor upon the word customize-apropos-options and typed M-x, > and would you believe I had to help emacs figure out what I wanted to do, > which was of course to type M-x customize-apropos-options. > (Yes, with the assistance of TAB.) > > Compare C-h f (describe-function) with the cursor in that position. It > knows what to do: prompt with what it finds under the cursor. Hm. That's an interesting idea. > P.S., I cannot help with patches because I am too busy reporting bugs > I encounter in the surface interface, which I am much better at doing > than coding. Each person has things they are better at doing. Well, a patch follows. If you could test it, I would be interested to see whether you liked it in regular use. I'll test it for a while too. --- keyboard.c.~1.959.~ 2008-06-02 22:07:24.000000000 +0100 +++ keyboard.c 2008-06-05 02:04:13.000000000 +0100 @@ -10451,6 +10451,7 @@ Lisp_Object prefixarg; { Lisp_Object function; + Lisp_Object symatpt; char buf[40]; int saved_last_point_position; Lisp_Object saved_keys, saved_last_point_position_buffer; @@ -10491,9 +10492,16 @@ restricting to the set of all defined commands. Don't provide any initial input. Save the command read on the extended-command history list. */ + + symatpt = call0 (intern ("function-called-at-point")); + symatpt = (NILP (call1 (Qcommandp, symatpt))) ? Qnil : symatpt; + + if (!NILP (symatpt)) + symatpt = SYMBOL_NAME (symatpt); + function = Fcompleting_read (build_string (buf), Vobarray, Qcommandp, - Qt, Qnil, Qextended_command_history, Qnil, + Qt, symatpt, Qextended_command_history, Qnil, Qnil); #ifdef HAVE_WINDOW_SYSTEM ^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#355: M-x should prompt with function under cursor as default 2008-06-05 1:18 ` bug#355: M-x should prompt with function under cursor as default John Paul Wallington @ 2008-06-05 17:58 ` jidanni 2008-06-05 18:55 ` Stefan Monnier 2008-06-05 19:11 ` John Paul Wallington 1 sibling, 1 reply; 12+ messages in thread From: jidanni @ 2008-06-05 17:58 UTC (permalink / raw) To: jpw; +Cc: 355 JPW> patch follows. If you could test it JPW> --- keyboard.c ^^thank you but in my "apt-get install emacs" world I don't brush with .c's, and in fact have barely the brains to test .el's. So thank you anyway and I'm sure your fix works. OK, bye. ^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#355: M-x should prompt with function under cursor as default 2008-06-05 17:58 ` jidanni @ 2008-06-05 18:55 ` Stefan Monnier 0 siblings, 0 replies; 12+ messages in thread From: Stefan Monnier @ 2008-06-05 18:55 UTC (permalink / raw) To: jidanni; +Cc: 355, jpw tag 355 +wontfix JPW> patch follows. If you could test it JPW> --- keyboard.c > ^^thank you but in my "apt-get install emacs" world I > don't brush with .c's, and in fact have barely the brains to test > .el's. So thank you anyway and I'm sure your fix works. OK, bye. In any case, I don't think the functionality you're asking makes much sense: it is rather rare to do a M-x where the command you want to run happens to be under point. Stefan ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: bug#355: M-x should prompt with function under cursor as default 2008-06-05 1:18 ` bug#355: M-x should prompt with function under cursor as default John Paul Wallington 2008-06-05 17:58 ` jidanni @ 2008-06-05 19:11 ` John Paul Wallington 2008-06-05 21:15 ` John Paul Wallington 1 sibling, 1 reply; 12+ messages in thread From: John Paul Wallington @ 2008-06-05 19:11 UTC (permalink / raw) To: jidanni; +Cc: 355, bug-gnu-emacs, emacs-devel I neglected to CC: bug-gnu-emacs in my original reply. Do the Emacs developers think that this feature is worth adding ? I wrote: > jidanni@jidanni.org writes: > >> So I put the cursor upon the word customize-apropos-options and typed M-x, >> and would you believe I had to help emacs figure out what I wanted to do, >> which was of course to type M-x customize-apropos-options. >> (Yes, with the assistance of TAB.) >> >> Compare C-h f (describe-function) with the cursor in that position. It >> knows what to do: prompt with what it finds under the cursor. > > Hm. That's an interesting idea. > >> P.S., I cannot help with patches because I am too busy reporting bugs >> I encounter in the surface interface, which I am much better at doing >> than coding. Each person has things they are better at doing. > > Well, a patch follows. If you could test it, I would be interested to > see whether you liked it in regular use. I'll test it for a while too. --- keyboard.c.~1.959.~ 2008-06-02 22:07:24.000000000 +0100 +++ keyboard.c 2008-06-05 02:04:13.000000000 +0100 @@ -10451,6 +10451,7 @@ Lisp_Object prefixarg; { Lisp_Object function; + Lisp_Object symatpt; char buf[40]; int saved_last_point_position; Lisp_Object saved_keys, saved_last_point_position_buffer; @@ -10491,9 +10492,16 @@ restricting to the set of all defined commands. Don't provide any initial input. Save the command read on the extended-command history list. */ + + symatpt = call0 (intern ("function-called-at-point")); + symatpt = (NILP (call1 (Qcommandp, symatpt))) ? Qnil : symatpt; + + if (!NILP (symatpt)) + symatpt = SYMBOL_NAME (symatpt); + function = Fcompleting_read (build_string (buf), Vobarray, Qcommandp, - Qt, Qnil, Qextended_command_history, Qnil, + Qt, symatpt, Qextended_command_history, Qnil, Qnil); #ifdef HAVE_WINDOW_SYSTEM ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: bug#355: M-x should prompt with function under cursor as default 2008-06-05 19:11 ` John Paul Wallington @ 2008-06-05 21:15 ` John Paul Wallington 0 siblings, 0 replies; 12+ messages in thread From: John Paul Wallington @ 2008-06-05 21:15 UTC (permalink / raw) To: emacs-devel; +Cc: 355, bug-gnu-emacs, jidanni On 5 Jun 2008, at 20:11, John Paul Wallington wrote: > I neglected to CC: bug-gnu-emacs in my original reply. Do the Emacs > developers think that this feature is worth adding ? Ooops, I missed Stef's reply to the BTS saying no. Fair enough :) ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <mailman.12758.1212763022.18990.bug-gnu-emacs@gnu.org>]
* Re: bug#355: M-x should prompt with function under cursor as default [not found] <mailman.12758.1212763022.18990.bug-gnu-emacs@gnu.org> @ 2008-06-06 17:43 ` jidanni 2008-06-06 18:18 ` Stefan Monnier 2008-06-06 18:18 ` Stefan Monnier 2008-06-06 17:43 ` jidanni 1 sibling, 2 replies; 12+ messages in thread From: jidanni @ 2008-06-06 17:43 UTC (permalink / raw) To: jpw, drew.adams; +Cc: 355, emacs-devel JPW> Do the Emacs developers think that this feature is worth adding ? JPW> Ooops, I missed Stef's reply to the BTS saying no. Fair enough :) SM> In any case, I don't think the functionality you're asking makes much SM> sense: it is rather rare to do a M-x where the command you want to run SM> happens to be under point. Just as often as C-h f and C-h v for me at least. And why not upgrade the sensitivity of C-h v and C-h f and also make their prompting default behavior unified with M-x. Incorporating the John Paul Wallington bug #355 and Drew Adams bug #371 patches would be a big step in that direction. ^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#355: M-x should prompt with function under cursor as default 2008-06-06 17:43 ` jidanni @ 2008-06-06 18:18 ` Stefan Monnier 2008-06-06 18:18 ` Stefan Monnier 1 sibling, 0 replies; 12+ messages in thread From: Stefan Monnier @ 2008-06-06 18:18 UTC (permalink / raw) To: jidanni; +Cc: 355, emacs-devel, jpw JPW> Do the Emacs developers think that this feature is worth adding ? JPW> Ooops, I missed Stef's reply to the BTS saying no. Fair enough :) SM> In any case, I don't think the functionality you're asking makes much SM> sense: it is rather rare to do a M-x where the command you want to run SM> happens to be under point. > Just as often as C-h f and C-h v for me at least. And how often is that? For me, C-h f on the function at point is the most common use of C-h f (I'm looking at a piece of Elisp code and want to know what the function does). I have a hard time believe that you often do M-x <FUN> where <FUN> is the function at point. Please give me scenarios, Stefan ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: bug#355: M-x should prompt with function under cursor as default 2008-06-06 17:43 ` jidanni 2008-06-06 18:18 ` Stefan Monnier @ 2008-06-06 18:18 ` Stefan Monnier 2008-06-06 18:37 ` jidanni 2008-06-06 18:37 ` jidanni 1 sibling, 2 replies; 12+ messages in thread From: Stefan Monnier @ 2008-06-06 18:18 UTC (permalink / raw) To: jidanni; +Cc: 355, emacs-devel, drew.adams, jpw JPW> Do the Emacs developers think that this feature is worth adding ? JPW> Ooops, I missed Stef's reply to the BTS saying no. Fair enough :) SM> In any case, I don't think the functionality you're asking makes much SM> sense: it is rather rare to do a M-x where the command you want to run SM> happens to be under point. > Just as often as C-h f and C-h v for me at least. And how often is that? For me, C-h f on the function at point is the most common use of C-h f (I'm looking at a piece of Elisp code and want to know what the function does). I have a hard time believe that you often do M-x <FUN> where <FUN> is the function at point. Please give me scenarios, Stefan ^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#355: M-x should prompt with function under cursor as default 2008-06-06 18:18 ` Stefan Monnier @ 2008-06-06 18:37 ` jidanni 2008-06-06 18:37 ` jidanni 1 sibling, 0 replies; 12+ messages in thread From: jidanni @ 2008-06-06 18:37 UTC (permalink / raw) To: monnier; +Cc: 355, emacs-devel One puts the cursor on the name of a function, learns about it with C-h f, and if what one reads sounds good, gives it a roll (a trial) with M-x, Except no... this (M-x) time we have to type its name in even though we are sitting on top of it, because... SM> And how often is that? OK, only half the functions I read about sound good enough to use M-x on. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: bug#355: M-x should prompt with function under cursor as default 2008-06-06 18:18 ` Stefan Monnier 2008-06-06 18:37 ` jidanni @ 2008-06-06 18:37 ` jidanni 1 sibling, 0 replies; 12+ messages in thread From: jidanni @ 2008-06-06 18:37 UTC (permalink / raw) To: monnier; +Cc: 355, emacs-devel One puts the cursor on the name of a function, learns about it with C-h f, and if what one reads sounds good, gives it a roll (a trial) with M-x, Except no... this (M-x) time we have to type its name in even though we are sitting on top of it, because... SM> And how often is that? OK, only half the functions I read about sound good enough to use M-x on. ^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#355: M-x should prompt with function under cursor as default [not found] <mailman.12758.1212763022.18990.bug-gnu-emacs@gnu.org> 2008-06-06 17:43 ` jidanni @ 2008-06-06 17:43 ` jidanni 1 sibling, 0 replies; 12+ messages in thread From: jidanni @ 2008-06-06 17:43 UTC (permalink / raw) To: jpw, drew.adams; +Cc: 355, emacs-devel JPW> Do the Emacs developers think that this feature is worth adding ? JPW> Ooops, I missed Stef's reply to the BTS saying no. Fair enough :) SM> In any case, I don't think the functionality you're asking makes much SM> sense: it is rather rare to do a M-x where the command you want to run SM> happens to be under point. Just as often as C-h f and C-h v for me at least. And why not upgrade the sensitivity of C-h v and C-h f and also make their prompting default behavior unified with M-x. Incorporating the John Paul Wallington bug #355 and Drew Adams bug #371 patches would be a big step in that direction. ^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#355: M-x should prompt with function under cursor as default
@ 2008-06-03 22:53 jidanni
0 siblings, 0 replies; 12+ messages in thread
From: jidanni @ 2008-06-03 22:53 UTC (permalink / raw)
To: bug-gnu-emacs
Today I was reading a message where this guy said
> FWIW, there are also `customize-apropos' and `customize-apropos-options'.
So I put the cursor upon the word customize-apropos-options and typed M-x,
and would you believe I had to help emacs figure out what I wanted to do,
which was of course to type M-x customize-apropos-options.
(Yes, with the assistance of TAB.)
Compare C-h f (describe-function) with the cursor in that position. It
knows what to do: prompt with what it finds under the cursor.
P.S., I cannot help with patches because I am too busy reporting bugs
I encounter in the surface interface, which I am much better at doing
than coding. Each person has things they are better at doing.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-06-06 18:37 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <mailman.12639.1212534433.18990.bug-gnu-emacs@gnu.org> 2008-06-05 1:18 ` bug#355: M-x should prompt with function under cursor as default John Paul Wallington 2008-06-05 17:58 ` jidanni 2008-06-05 18:55 ` Stefan Monnier 2008-06-05 19:11 ` John Paul Wallington 2008-06-05 21:15 ` John Paul Wallington [not found] <mailman.12758.1212763022.18990.bug-gnu-emacs@gnu.org> 2008-06-06 17:43 ` jidanni 2008-06-06 18:18 ` Stefan Monnier 2008-06-06 18:18 ` Stefan Monnier 2008-06-06 18:37 ` jidanni 2008-06-06 18:37 ` jidanni 2008-06-06 17:43 ` jidanni 2008-06-03 22:53 jidanni
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.