unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: BobD <daycandle@gmail.com>, help-gnu-emacs@gnu.org
Subject: RE: Isearch - Incremental search with predefined initial character?
Date: Wed, 8 Oct 2014 15:32:03 -0700 (PDT)	[thread overview]
Message-ID: <04461b86-7a41-4171-aa18-5ab9559d5fee@default> (raw)
In-Reply-To: <b9bb57c4-61cc-4757-a39c-4f15019acd19@googlegroups.com>

> After fiddling a while, I came up with this, which does what I want.
> ...
> Thank you very much for your help.  Pointing me at (isearch-yank-
> string ...) made this work.

You're welcome.

> I wish to do this so that I can search for "{abc" without typing the
> "{" first.  Typing something like "\C-s{abc" is exhausting.

You have what you want.  And the string you want as a prefix each
time is just one char in this case (`{`).  Things would be a lot
more exhausting if the commonly used prefix were a complex string!

Anyway, just FYI, in case you have other things that you sometimes
want to yank into the search string, here are two tips (they require
libraries `isearch+.el' and `second-sel.el'):

1. You can use `C-M-y' to yank the secondary selection to the search
   string.

   The secondary selection does not change when the region changes,
   so it is a good place to hold onto a string that you might use
   fairly often but intermittently.

   For example, it can be handy for a kind of on-demand replacement:
   select something, then `C-M-y' to yank the secondary selection
   in place of it (`C-w' first, if you don't use `delete-selection-mode').

   You can't yank the region text to replace the region text (!), but
   you can yank the secondary selection.  And it remains as the same
   text until you explicitly change it.

   And unlike the region, point is generally nowhere near the secondary
   selection, which means the s.s. can be off-window.

   Most Emacs users never use the secondary selection.  I use it all
   the time.  My guess is that people don't use it because they have
   never bound it to a keyboard key (like `C-M-y').  The only default
   key for yanking the s.s. is a mouse key (`M-mouse-2':
   `mouse-yank-secondary').

2. You can use `C-x r g' to append the contents of a register to the
   search string.  This is the same key that is bound globally to
   `insert-register'.  You are prompted for the register (a character).





      reply	other threads:[~2014-10-08 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-04 17:57 Isearch - Incremental search with predefined initial character? BobD
2014-10-04 21:58 ` Drew Adams
2014-10-08 20:49 ` BobD
2014-10-08 22:32   ` Drew Adams [this message]

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=04461b86-7a41-4171-aa18-5ab9559d5fee@default \
    --to=drew.adams@oracle.com \
    --cc=daycandle@gmail.com \
    --cc=help-gnu-emacs@gnu.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.
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).