all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* snarf up text when at query-replace from: prompt
@ 2003-01-02 22:55 Dan Jacobson
       [not found] ` <E18UYT9-0004yJ-00@fencepost.gnu.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Jacobson @ 2003-01-02 22:55 UTC (permalink / raw)


    ESC % runs the command query-replace
       which is an interactive compiled Lisp function in `replace'.
    (query-replace FROM-STRING TO-STRING &optional DELIMITED START END)

    Replace some occurrences of FROM-STRING with TO-STRING.
    As each match is found, the user must type a character saying
    what to do with it.  For directions, type C-h at that time.

I would like to have C-h tell me stuff right when I'm at the From:
string prompt.  To: also.

    In Transient Mark mode, if the mark is active, operate on the contents
    of the region.  Otherwise, operate from point to the end of the buffer.

    If `query-replace-interactive' is non-nil, the last incremental search
    string is used as FROM-STRING--you don't have to specify it with the
    minibuffer.

it would be nice if we could hit something to snarf up words from
point when we are entering the from and to strings.
-- 
http://jidanni.org/ Taiwan(04)25854780

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: snarf up text when at query-replace from: prompt
       [not found] ` <E18UYT9-0004yJ-00@fencepost.gnu.org>
@ 2003-01-06 23:14   ` Dan Jacobson
  2003-01-09  7:28     ` Richard Stallman
       [not found]     ` <E18WX79-0001b4-00@fencepost.gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Dan Jacobson @ 2003-01-06 23:14 UTC (permalink / raw)


RMS> Could you be more specific?  What do you propose that C-h should do
RMS> when you are in the minibuffer entering the from-string?... to-string

well actually lets talk about C-s.  If one hit C-s C-h, wouldn't it be
neat if it were like when one hit C-h k C-s?  At least give some hints
in the minibuffer about goodies like:

Type C-s to search again forward, C-r to search again backward.
Type C-w to yank word from buffer onto end of search string and search for it.
Type C-y to yank rest of line onto end of search string and search for it.
Type M-y to yank last killed text onto end of search string and search for it.
etc.

this would appear as "C-s, C-w, C-y.... C-h for more info" in the
minibuffer.

Do something similar when one hits M-% C-h, of course offering the
choices I propose below.

>     it would be nice if we could hit something to snarf up words from
>     point when we are entering the from and to strings.

RMS> You can copy the text with M-w then do query-replace-interactive and then
RMS> yank it with C-y.

ah, but setting that variable back and forth is quite inconvenient.
I say the from and to stings should be able to be vacuumed up with
things like those 4 above... just like C-s... hmmm, true we are
sitting in the minibuffer and not in the main window like with C-s.

Anyway, a start would be if M-% C-w would copy the word we are on into
the From string..  More C-w's would add more to it, like C-s....
Hmm, then there's the To string... well, we would have to reposition
the cursor usually.... bla bla bla... anyways, C-s is quite high
powered vs. M-%...
-- 
http://jidanni.org/ Taiwan(04)25854780

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: snarf up text when at query-replace from: prompt
  2003-01-06 23:14   ` Dan Jacobson
@ 2003-01-09  7:28     ` Richard Stallman
  2003-01-09 12:32       ` Robert J. Chassell
       [not found]     ` <E18WX79-0001b4-00@fencepost.gnu.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2003-01-09  7:28 UTC (permalink / raw)
  Cc: emacs-devel

    well actually lets talk about C-s.  If one hit C-s C-h, wouldn't it be
    neat if it were like when one hit C-h k C-s?  At least give some hints
    in the minibuffer about goodies like:

    Type C-s to search again forward, C-r to search again backward.
    Type C-w to yank word from buffer onto end of search string and search for it.
    Type C-y to yank rest of line onto end of search string and search for it.
    Type M-y to yank last killed text onto end of search string and search for it.
    etc.

Such a feature was implemented, but I turned it off.

    ;; Turned off because I find I expect to get the global definition--rms.
    ;; ;; Instead bind C-h to special help command for isearch-mode.
    ;; (define-key map "\C-h" 'isearch-mode-help)

I think I found it inconvenient because I would type C-h expecting it
to exit the search and do its usual job.  However, if this feature is
significantly good for beginners, maybe we should turn it on again,
and I can turn it of in my .emacs file.

Does anyone else have an opinion?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: snarf up text when at query-replace from: prompt
  2003-01-09  7:28     ` Richard Stallman
@ 2003-01-09 12:32       ` Robert J. Chassell
  2003-01-10  9:53         ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Robert J. Chassell @ 2003-01-09 12:32 UTC (permalink / raw)


       well actually lets talk about C-s.  If one hit C-s C-h, wouldn't it be
       neat if it were like when one hit C-h k C-s?  

No, because that action will confuse beginners.  Acting on the
principle of `least surprise' they will come to expect all commands to
work like that.  Thus, a beginner would expect `s C-h' to provide the
same results as `C-h k s' rather than the current result.

If you made such a change, to what would you rebind `C-h' to so as to
continue to provide the current features?

-- 
    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                                     bob@gnu.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: snarf up text when at query-replace from: prompt
       [not found]     ` <E18WX79-0001b4-00@fencepost.gnu.org>
@ 2003-01-10  4:03       ` Dan Jacobson
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Jacobson @ 2003-01-10  4:03 UTC (permalink / raw)


>>>>> "RMS" == Richard Stallman <rms@gnu.org> writes:

RMS> You can copy the text with M-w then do query-replace-interactive and then
RMS> yank it with C-y.

SMR>     ah, but setting that variable back and forth is quite inconvenient.

RMS> Sorry, I meant to type query-replace-regexp, not
RMS> query-replace-interactive.  (M-/ must have found
RMS> query-replace-interactive.)

RMS> Is it clear now?  You can use C-y to yank into the minibuffer
RMS> because it is an ordinary buffer and ordinary commands work.

Ah, but after enjoying C-s C-w C-w... one thirsts for other smart
commands that can snarf up text like that... that the cursor is in the
minibuffer is probably just a technical distraction.  The smart
command would remember where the cursor used to be in the big buffer
above and still snarf.

The 'M-w first' method requires forethought where my so called smart
method would be usable right there...

compare {M-w plus old non interactive search}, vs. {isearch plus C-w}. 
-- 
http://jidanni.org/ Taiwan(04)25854780

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: snarf up text when at query-replace from: prompt
  2003-01-09 12:32       ` Robert J. Chassell
@ 2003-01-10  9:53         ` Richard Stallman
  2003-01-10 12:02           ` Robert J. Chassell
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2003-01-10  9:53 UTC (permalink / raw)
  Cc: emacs-devel

    If you made such a change, to what would you rebind `C-h' to so as to
    continue to provide the current features?

The point of the HELP key is that it does various kinds of help.
Whenever HELP has a special local meaning, its normal meaning is
unavailable.

However, while in isearch, if you want to use the global meaning
of HELP, RET HELP would always do it.  The question is what HELP
should do if you don't type RET.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: snarf up text when at query-replace from: prompt
  2003-01-10  9:53         ` Richard Stallman
@ 2003-01-10 12:02           ` Robert J. Chassell
  2003-01-10 14:25             ` Kim F. Storm
  0 siblings, 1 reply; 9+ messages in thread
From: Robert J. Chassell @ 2003-01-10 12:02 UTC (permalink / raw)


   However, while in isearch, if you want to use the global meaning
   of HELP, RET HELP would always do it.  

No!  His proposal, which I am against, suggests (by the principle of
`least surprise') converting RET HELP to being equivalent to `C-h k
RET'.  Without a new keybinding, the global meaning of HELP would lack
a keybinding.  We should stick with what we have.

-- 
    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                                     bob@gnu.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: snarf up text when at query-replace from: prompt
  2003-01-10 12:02           ` Robert J. Chassell
@ 2003-01-10 14:25             ` Kim F. Storm
  2003-01-12 11:54               ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Kim F. Storm @ 2003-01-10 14:25 UTC (permalink / raw)
  Cc: emacs-devel

"Robert J. Chassell" <bob@rattlesnake.com> writes:

>    However, while in isearch, if you want to use the global meaning
>    of HELP, RET HELP would always do it.  
> 
> No!  His proposal, which I am against, suggests (by the principle of
> `least surprise') converting RET HELP to being equivalent to `C-h k
> RET'.  Without a new keybinding, the global meaning of HELP would lack
> a keybinding.  We should stick with what we have.

As I understood Dan's proposal, he would like C-h during isearch to
tell you what options (special bindings) you have in isearch mode
[also known as context-sensitive help].

IMO, context sensitive help is a good thing, and it could be done
quite cleanly like this (examplified by isearch):

User enters isearch mode with C-s and maybe types a few characters.
Minibuffer (or really the echo-area) contains:

  ========================
  I-search: fewchars

User now enters C-h; this enlarges the minibuffer/echo area to
contain:

  ========================
  C-w: copy word, C-t: toggle case, C-r: toggle regexp,
  C-s: next match, C-r: prev match, RET: quit
  I-search: fewchars

Now, if the user hits C-h again, that could work like the normal help
prefix (terminating I-search).  

We can even make the first C-h wait 0.3 seconds to see if the user
enters another C-h and not show the context sensitive help in that
case.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: snarf up text when at query-replace from: prompt
  2003-01-10 14:25             ` Kim F. Storm
@ 2003-01-12 11:54               ` Richard Stallman
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2003-01-12 11:54 UTC (permalink / raw)
  Cc: emacs-devel

    User now enters C-h; this enlarges the minibuffer/echo area to
    contain:

      ========================
      C-w: copy word, C-t: toggle case, C-r: toggle regexp,
      C-s: next match, C-r: prev match, RET: quit
      I-search: fewchars

The old code I commented out displayed the doc string isearch-forward,
in a window.  This could be more convenient.  We could also add

    C-h: normal help commands in search

to show how to get those commands.

Want to implement it?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-01-12 11:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-02 22:55 snarf up text when at query-replace from: prompt Dan Jacobson
     [not found] ` <E18UYT9-0004yJ-00@fencepost.gnu.org>
2003-01-06 23:14   ` Dan Jacobson
2003-01-09  7:28     ` Richard Stallman
2003-01-09 12:32       ` Robert J. Chassell
2003-01-10  9:53         ` Richard Stallman
2003-01-10 12:02           ` Robert J. Chassell
2003-01-10 14:25             ` Kim F. Storm
2003-01-12 11:54               ` Richard Stallman
     [not found]     ` <E18WX79-0001b4-00@fencepost.gnu.org>
2003-01-10  4:03       ` Dan Jacobson

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.