From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rusi Newsgroups: gmane.emacs.help Subject: Re: symbols verses words Date: Thu, 3 Mar 2011 07:34:18 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <06BF1211-A1CA-4E57-ADF4-8C89EF6ACDE1@gmail.com> <87ei6opktu.fsf@member.fsf.org> <703145BE-ABE5-423F-8D2C-65B4F6A2515D@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1299166864 25853 80.91.229.12 (3 Mar 2011 15:41:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2011 15:41:04 +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 03 16:41:00 2011 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.69) (envelope-from ) id 1PvAeB-00084k-79 for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Mar 2011 16:40:59 +0100 Original-Received: from localhost ([127.0.0.1]:43670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvAeA-00078q-OO for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Mar 2011 10:40:58 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!t15g2000prt.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: 116.73.35.230 Original-X-Trace: posting.google.com 1299166688 10262 127.0.0.1 (3 Mar 2011 15:38:08 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 3 Mar 2011 15:38:08 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t15g2000prt.googlegroups.com; posting-host=116.73.35.230; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:185599 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:79752 Archived-At: On Mar 3, 7:48=A0pm, Tassilo Horn wrote: > Perry Smith writes: > > Hi Perry, > > > > >> I think, something like that should do the trick: > > >> --8<---------------cut here---------------start------------->8--- > >> (defun isearch-yank-symbol-or-char () > >> =A0"Pull next character or symbol from buffer into search string." > >> =A0(interactive) > >> =A0(isearch-yank-internal > >> =A0 (lambda () > >> =A0 =A0 (if (or (memq (char-syntax (or (char-after) 0)) '(?w ?_)) > >> =A0 =A0 =A0 =A0 =A0 =A0 (memq (char-syntax (or (char-after (1+ (point)= )) 0)) '(?w ?_))) > >> =A0 =A0 =A0 =A0 (forward-symbol 1) > >> =A0 =A0 =A0 (forward-char 1)) > >> =A0 =A0 (point)))) > > >> (define-key isearch-mode-map (kbd "C-S-w") 'isearch-yank-symbol-or-cha= r) > >> --8<---------------cut here---------------end--------------->8--- > > >> So when you are on a word constituent (?w) or on a symbol constituent > >> (?_), then do `forward-symbol', else `forward-char'. > > > Thanks. =A0The problem is that my emacs (GNU 23.2) doesn't have > > forward-symbol. =A0I didn't know how to do that. > > Ah, that function is defined in thingatpt.el, so you are only missing a > (require 'thingatpt). > > Bye, > Tassilo Its there but not documented (emacs 23.1.1)