From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: How to yank a regexp in isearch-mode? Date: Sat, 10 Nov 2018 18:22:19 -0800 (PST) Message-ID: <225f0813-8140-4ab5-a97c-bfdee0451be6@default> References: <4DFE9F27-7B86-4C33-B1BE-8193B56AD261@outlook.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1541902856 11174 195.159.176.226 (11 Nov 2018 02:20:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Nov 2018 02:20:56 +0000 (UTC) To: Zhang Haijun , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 11 03:20:52 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gLfMp-0002my-63 for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Nov 2018 03:20:51 +0100 Original-Received: from localhost ([::1]:40640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLfOv-00065I-H0 for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2018 21:23:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLfON-000652-7C for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 21:22:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLfOK-00030G-0D for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 21:22:27 -0500 Original-Received: from userp2120.oracle.com ([156.151.31.85]:60710) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gLfOJ-0002vn-MX for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 21:22:23 -0500 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAB2F4Pk133423; Sun, 11 Nov 2018 02:22:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=3+gQryhE5KMCA0HsHtr6R/nc16HVpPBo2HKWtuJ6bgY=; b=UwV4JUSHRhDO0ncbsLkPYvxIgCXPRbgg3yi2ioy44HMcMYX/Md30DsiGhRfTiEFGIItw 74vL0sDtk3/KssZII6SqxxEqi2n8yoDJoBkzKb4943UBX4MfL5ZorY+x+G+j+6NnouBs uwY1QgAymLe5Isbp1u9KWePhumkJ5z7EVy72eF5gVq0eE2X0nM7Cpke84OyUTyJM7biD BGEPyPAQ9C5m3zKGLQhR+7zfH6UrC8i2kHHwL0Moxc/7Ahf3eJQS/dA1MgJxez5hpRrM PhjHUdTcxrl/mDLfyi3YXSrPnhvcPAVRB2NwjFhwOVxrehOn8Ln34OZ64eBUE8xQRrLp 1Q== Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2nnwc0945s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 11 Nov 2018 02:22:21 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wAB2MKtr021346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 11 Nov 2018 02:22:21 GMT Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wAB2MKmf011782; Sun, 11 Nov 2018 02:22:20 GMT In-Reply-To: <4DFE9F27-7B86-4C33-B1BE-8193B56AD261@outlook.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4756.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9073 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=610 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811110020 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:118642 Archived-At: > Is there a functions like isearch-yank-string but yank a regexp? >=20 > (defun my-isearch-foobar () > (interactive) > (isearch-mode t) > (isearch-yank-string " foobar ")) `isearch-yank-string' can yank a regexp string as well. If you use Isearch+ then you have option `isearchp-regexp-quote-yank-flag': Non-nil means escape special chars in text yanked for a regexp isearch. You can toggle this using `isearchp-toggle-regexp-quote-yank', bound to `C-`' during Isearch. IOW, if you turn off this escaping then regexp search interprets yanked regexps normally. If you turn it on then a yanked regexp string has its special chars quoted (escaped). With this escaping turned off, you can yank text such as `^\*.*' without it being transformed to `\^\\\*\.\*'. Isearch+: https://www.emacswiki.org/emacs/IsearchPlus