From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Damien Wyart Newsgroups: gmane.emacs.help Subject: Re: Is there an easier way to jump to the same word? Date: Thu, 11 Apr 2013 09:57:19 +0200 Organization: Serveur de News Free Message-ID: <51666cdf$0$3720$426a34cc@news.free.fr> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1365686478 5893 80.91.229.3 (11 Apr 2013 13:21:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Apr 2013 13:21:18 +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 Apr 11 15:21:22 2013 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 1UQHRH-0001ob-70 for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 15:21:19 +0200 Original-Received: from localhost ([::1]:59576 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQHRG-0004rK-Oi for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 09:21:18 -0400 X-Received: by 10.180.106.73 with SMTP id gs9mr6171915wib.2.1365667040189; Thu, 11 Apr 2013 00:57:20 -0700 (PDT) Original-Path: usenet.stanford.edu!19no77811851wie.1!news-out.google.com!ex12ni35926wid.1!nntp.google.com!proxad.net!feeder1-2.proxad.net!cleanfeed4-a.proxad.net!nnrp3-2.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 Original-Lines: 29 Original-NNTP-Posting-Date: 11 Apr 2013 09:57:20 CEST Original-NNTP-Posting-Host: 213.41.244.197 Original-X-Trace: 1365667040 news-4.free.fr 3720 213.41.244.197:58150 Original-X-Complaints-To: abuse@proxad.net Original-Xref: usenet.stanford.edu gnu.emacs.help:197814 X-Mailman-Approved-At: Thu, 11 Apr 2013 09:20:11 -0400 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:90093 Archived-At: > > Often times I find that I want to jump to another occurrence of the > > word-under-point, almost always variables or functions. I end up > > going to the beginning of the word with M-b, doing isearch-forward > > with C-s, adding all the words until the full word is the search > > term with C-w a bunch of times, and finally C-s to jump around to > > other instances of it. > > Is there a better way to do this? * "Chris F.A. Johnson" in gnu.emacs.help: > This is what I use: > (defun current-word-search () > "search forward for word under cursor" > (interactive) > (word-search-forward (current-word))) I was about to point OP to highlight-symbol.el, but your solution seems simple and elegant. A few links anyway: http://emacswiki.org/emacs/SearchAtPoint http://stackoverflow.com/questions/10373118/vim-like-next-previous-word-at-point-in-emacs http://www.emacswiki.org/emacs/HighlightSymbol http://nschum.de/src/emacs/highlight-symbol/ https://github.com/nschum/highlight-symbol.el -- DW