unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Juri Linkov <juri@linkov.net>
Cc: Karl Fogel <kfogel@red-bean.com>, Emacs developers <emacs-devel@gnu.org>
Subject: RE: PATCH: isearch-yank-until-char
Date: Tue, 27 Aug 2019 15:52:23 -0700 (PDT)	[thread overview]
Message-ID: <558c8b76-e120-4767-be00-391f375fae77@default> (raw)
In-Reply-To: <87y2zewb0w.fsf@mail.linkov.net>

> >> `M-.' and `C-M-.' are good keys for pulling text
> >> into the minibuffer, as well as into a search string,
> >> so let's reserve them for the text pulling feature.
> >
> > OK.  (But we already have multiple text-pulling
> > keys for Isearch.)
> 
> One of its first usages would be to bind `M-s M-.' to a command
> that turns the active region into the search string.

OK by me.  FWIW, that doesn't interfere with
any keys I have in `isearch-mode-map'.

(But `M-s M-.' is not `C-M-.' or `M-.'.)

>   (defun skip-to-char (arg char)
>     (interactive "^p\ncSkip to char: ")
>     (search-forward (char-to-string char) nil nil arg)
>     (forward-char -1))
> 
>   (define-key esc-map "\C-z" 'skip-to-char)
> 
> Then `C-SPC C-M-z ) M-s M-.' would be another way
> to yank until next char.

Looks useful, sounds good.


Oops, but no.  Now I see that you didn't mean
`M-s M-.' during Isearch.  You meant `M-s- M-.'
_globally_, to _start_ Isearch with a certain
search string.

When you said "a command that turns the active
region into the search string" I thought you
meant during search.

Personally, I'm not in favor of binding more
and more keys globally, to start particular
Isearches.  Global keys are rare these days.

I prefer to use the usual keys to start Isearch,
and then hit a key to make it a particular kind
of Isearch - in this case, to use the region
text as the search string (or maybe to append
it to the search string).

E.g., though I don't suggest we sacrifice the
global keys `C-M-s' and `C-M-r', nowadays we
_can_ just use `C-s M-r' to get regexp search
(a particular kind of Isearch), without needing
global keys just for that.

In this case, I'd sooner see `M-s M-.' be bound
in the Isearch map to a command that appends the
region text to the search string (or if you
prefer, replaces it).  That gives you what you
expected when starting Isearch.

IOW, `C-SPC C-M-z )' to activate the region up
to the `)' char, then `C-s M-s M-.' to use the
region as the search string.  IOW, just use
`C-s' (or `C-r' or `C-M-s' or `C-M-r') to start
searching; don't sacrifice yet another global
key for that.

---

[Personally, I'll have to bind `skip-to-char'
to a different key, because I bind `C-M-z'
to `thumfr-really-iconify-or-deiconify-frame'.

But that's OK.

I have a bunch of keys that end in `z', which
I use for things similar to the default `C-z'
binding of `suspend-frame' (aka
`iconify-or-deiconify-frame').

As is often the case in Emacs, a single key
(in this case `z') has more than one standard
meaning.

The frame-suspension meaning of `C-z' and
`C-x C-z' is just as old as the `zap-to-char'
meaning of `M-z' (at least checking back to
Emacs 20).  It's 6 of one, half a dozen of
the other.  I iconify (thumbify) much more
than I zap-to-char, so that association is
stronger in my head.]



  reply	other threads:[~2019-08-27 22:52 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14  3:05 PATCH: isearch-yank-until-char Karl Fogel
2019-08-14 14:20 ` Eli Zaretskii
2019-08-14 16:41   ` Karl Fogel
2019-08-14 16:48     ` Drew Adams
2019-08-14 17:20       ` Eli Zaretskii
2019-08-14 17:22       ` Karl Fogel
2019-08-14 17:51         ` Eli Zaretskii
2019-08-14 17:59 ` Noam Postavsky
2019-08-14 20:39   ` Juri Linkov
2019-08-14 20:34 ` Juri Linkov
2019-08-16  4:53   ` Karl Fogel
2019-08-16 17:52     ` Juri Linkov
2019-08-25  2:14       ` Karl Fogel
2019-08-25  3:22         ` Drew Adams
2019-08-25 20:03           ` Juri Linkov
2019-08-26  1:14             ` Drew Adams
2019-08-26  5:20           ` Karl Fogel
2019-08-26 14:50             ` Drew Adams
2019-08-26 17:51               ` Karl Fogel
2019-08-26 19:36                 ` Drew Adams
2019-08-26 21:29                   ` Karl Fogel
2019-08-26 21:57                     ` Drew Adams
2019-08-26 22:21                       ` Karl Fogel
2019-08-26 22:43                         ` Drew Adams
2019-09-04 16:47                           ` Karl Fogel
2019-09-04 17:00                             ` Eli Zaretskii
2019-09-12 17:44                               ` Karl Fogel
2019-09-16 21:24                   ` Drew Adams
2019-09-17 16:02                     ` Karl Fogel
2019-08-26 21:46                 ` Juri Linkov
2019-08-26 21:52                   ` Karl Fogel
2019-08-26 22:03                   ` Drew Adams
2019-08-26 22:19                     ` Juri Linkov
2019-08-26 22:33                       ` Karl Fogel
2019-08-26 22:40                       ` Drew Adams
2019-08-27 21:31                         ` Juri Linkov
2019-08-27 22:52                           ` Drew Adams [this message]
2019-08-27 23:15                             ` Drew Adams
2019-08-25 19:58         ` Juri Linkov
2019-08-14 22:26 ` Stefan Monnier
2019-08-15 18:24   ` Juri Linkov
2019-08-17 12:31     ` Stefan Monnier
2019-08-17 22:51       ` Juri Linkov
2019-08-16  5:11   ` Karl Fogel
     [not found] <<87tvakfnv4.fsf@red-bean.com>
     [not found] ` <<835zmzsuau.fsf@gnu.org>
2019-08-14 15:24   ` 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=558c8b76-e120-4767-be00-391f375fae77@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=kfogel@red-bean.com \
    /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).