From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: Re: How to search current word under cursor? Date: Sat, 19 Jul 2008 21:27:23 +0200 Organization: FH-Trier Message-ID: <1216495685.531766@arno.fh-trier.de> References: <86bqtwkgh0.fsf@gmail.com> <87k68kn998.fsf@tallis.ilo.ucl.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1216536213 26488 80.91.229.12 (20 Jul 2008 06:43:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Jul 2008 06:43:33 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 20 08:44:22 2008 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 1KKSeW-0002nC-1z for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Jul 2008 08:44:16 +0200 Original-Received: from localhost ([127.0.0.1]:38074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KKSdc-00029s-CG for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Jul 2008 02:43:20 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-kl.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 143-93-54-11.arno.fh-trier.de Original-X-Trace: news.uni-kl.de 1216495673 15210 143.93.54.11 (19 Jul 2008 19:27:53 GMT) Original-X-Complaints-To: usenet@news.uni-kl.de Original-NNTP-Posting-Date: Sat, 19 Jul 2008 19:27:53 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509) In-Reply-To: Cache-Post-Path: arno.fh-trier.de!unknown@dslb-084-059-109-213.pools.arcor-ip.net X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) Original-Xref: news.stanford.edu gnu.emacs.help:160389 X-Mailman-Approved-At: Sun, 20 Jul 2008 02:40:40 -0400 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:55742 Archived-At: cfelton wrote: > How do you extend this to the occur function? I have a key binding mapped to > the occur function, and I would like the word at the cursor (compete word > foo_bar, not just foo) to be the default search when invoked? > > Thanks > > > bastien-3 wrote: >> Jijun MA writes: >> >>> I want search this buffer of current word under cursor, how can I do >>> it? >> C-s C-w >> >> -- >> Bastien occur takes the first item in `regexp-history' as default value. This list can be manipulated. (defun occur-symbol-at-point () (interactive) (let ((sym (thing-at-point 'symbol))) (if sym (push (regexp-quote sym) regexp-history)) ;regexp-history defvared in replace.el (call-interactively 'occur))) -ap