From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Isearch - Incremental search with predefined initial character? Date: Wed, 8 Oct 2014 15:32:03 -0700 (PDT) Message-ID: <04461b86-7a41-4171-aa18-5ab9559d5fee@default> References: <3732af9c-0454-431c-88c5-975f34971eee@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1412807568 19152 80.91.229.3 (8 Oct 2014 22:32:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Oct 2014 22:32:48 +0000 (UTC) To: BobD , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 09 00:32:41 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xbzme-0008Jo-9b for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Oct 2014 00:32:36 +0200 Original-Received: from localhost ([::1]:38728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xbzmd-0002h0-Ks for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2014 18:32:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbzmL-0002gi-BS for help-gnu-emacs@gnu.org; Wed, 08 Oct 2014 18:32:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbzmC-0005k0-KF for help-gnu-emacs@gnu.org; Wed, 08 Oct 2014 18:32:17 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:43191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbzmC-0005jp-Ex for help-gnu-emacs@gnu.org; Wed, 08 Oct 2014 18:32:08 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s98MW5V7032347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 8 Oct 2014 22:32:06 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s98MW4vZ026623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 8 Oct 2014 22:32:05 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s98MW4Qs026610; Wed, 8 Oct 2014 22:32:04 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100345 Archived-At: > 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).