From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Maindoor Newsgroups: gmane.emacs.help Subject: search forward at point question Date: Wed, 4 Mar 2009 22:42:00 -0800 (PST) Message-ID: <649123.79249.qm@web63004.mail.re1.yahoo.com> References: <22332944.post@talk.nabble.com> Reply-To: sanjeevfiles@yahoo.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1824811916-1236235320=:79249" X-Trace: ger.gmane.org 1236235372 19939 80.91.229.12 (5 Mar 2009 06:42:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Mar 2009 06:42:52 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 05 07:44:09 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lf7JQ-0006tU-6t for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 07:44:08 +0100 Original-Received: from localhost ([127.0.0.1]:55204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf7I4-0002a4-Jk for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 01:42:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lf7HS-0002Zq-7p for help-gnu-emacs@gnu.org; Thu, 05 Mar 2009 01:42:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lf7HN-0002ZQ-QG for Help-gnu-emacs@gnu.org; Thu, 05 Mar 2009 01:42:05 -0500 Original-Received: from [199.232.76.173] (port=41025 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf7HN-0002ZN-FM for Help-gnu-emacs@gnu.org; Thu, 05 Mar 2009 01:42:01 -0500 Original-Received: from web63004.mail.re1.yahoo.com ([69.147.96.215]:30012) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Lf7HN-0006vq-2n for Help-gnu-emacs@gnu.org; Thu, 05 Mar 2009 01:42:01 -0500 Original-Received: (qmail 85604 invoked by uid 60001); 5 Mar 2009 06:42:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1236235320; bh=e979DDOHIJ4WmXYJXbewYlQlVBaSMET0doXCUTGnZII=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=UBUU65PftSfBdH8CvMnqVK0zO93ss+za+ZjCrVt08KueDPuZsul8Zi/Q6zB7bi0nVi0TWLfa8aAznR40KCZzE+GeAVJM7Jrw1Qd//PAG1hfw8WjqILzTxu/at/N7hT0Id5jvq+8lU2UnfN+O39DFPVdUQAELLeNSDP2N1ZLg7z0= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=tjErXWvjTc1H2wXzLNykcIPC7NyAELEZciB1QZVHKmaBids1WKVC/HCLwF30482qQr2hx9tczL8Zj1Mv0/6AoqDCRqTCi7K05sK17xVYyCJl+jQDhtKkQZPYbAxTb3OenFbXq533RibA5F160tmZE0jzfR50oboksWxHVuXRzwQ=; X-YMail-OSG: SU4BSrsVM1m3bN4D0BnzCu2nXUOliir8xuIPoVyw2dxmJXYEsO9LFbJcOid19VfbHRPDUh8GbVIxTQmmiyp_Jtzp51JMhzWzht09xkepCKeJCM8toTZHb5eV7igUrYT9WfhVfiLnz9Q.iZXjqSgeBFTreEmRA.DAd27EpPBq3MJPYsEER5TVmoH_.Lyw7g-- Original-Received: from [124.30.112.50] by web63004.mail.re1.yahoo.com via HTTP; Wed, 04 Mar 2009 22:42:00 PST X-Mailer: YahooMailWebService/0.7.289.1 In-Reply-To: <22332944.post@talk.nabble.com> X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62603 Archived-At: --0-1824811916-1236235320=:79249 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi, =A0=A0=A0=A0 I have the following code to search forward from point. =A0=A0=A0=A0 But If I have a string like SOMETHING_HERE=3D$(HI) =A0=A0=A0=A0 then this code yanks the whole "SOMETHING_HERE=3D$" =A0=A0=A0=A0 and searches for it forward. How do I limit it to =A0=A0=A0=A0 "SOMETHING_HERE". I want it to stop if it encounters =A0=A0=A0=A0 any special characters except "_" and "-".=20 =A0=A0=A0=A0 Here is the code: (defun my-viper-search-yank-word (arg forward) =A0 "Search forward for ARG occurance of word under point. If FORWARD is nil, searches backward instead." =A0 (let ((viper-re-search t)) =A0=A0=A0 (viper-search =A0=A0=A0=A0 (concat "\\<" (regexp-quote (current-word)) "\\>") forward arg= ))) (defun my-viper-search-forward-yank-word (arg) =A0 "Search forward for ARG occurance of word under point. Like the Vim command \"*\" (but not exactly)." =A0 (interactive "P") =A0 (my-viper-search-yank-word arg t)) Regards, Maindoor. =0A=0A=0A --0-1824811916-1236235320=:79249 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
     I have the fo= llowing code to search forward from point.
     But = If I have a string like SOMETHING_HERE=3D$(HI)

   &nb= sp; then this code yanks the whole "SOMETHING_HERE=3D$"
  &nbs= p;  and searches for it forward. How do I limit it to
  &= nbsp;  "SOMETHING_HERE". I want it to stop if it encounters
 &= nbsp;   any special characters except "_" and "-".

 =     Here is the code:

(defun my-viper-search-yank-wor= d (arg forward)
  "Search forward for ARG occurance of word under p= oint.
If FORWARD is nil, searches backward instead."
  (let ((vi= per-re-search t))
    (viper-search
   =   (concat "\\<" (regexp-quote (current-word)) "\\>") forward arg)))

(defun my-viper-search-forward-yank-word (arg)
  "Se= arch forward for ARG occurance of word under point.
Like the Vim command= \"*\" (but not exactly)."
  (interactive "P")
  (my-viper-= search-yank-word arg t))

Regards,
Maindoor.
=
=0A=0A=0A=0A --0-1824811916-1236235320=:79249--