From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?Renaud_Casenave-P=E9r=E9?= Newsgroups: gmane.emacs.help Subject: Re: Is there an easier way to jump to the same word? Date: Fri, 12 Apr 2013 06:50:19 +0100 Message-ID: <874nfcmh5w.fsf@casenave-pere.fr> References: <878v4omosz.fsf@casenave-pere.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1365752237 2350 80.91.229.3 (12 Apr 2013 07:37:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Apr 2013 07:37:17 +0000 (UTC) To: "help-gnu-emacs\@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 12 09:37:21 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 1UQYXv-0004y0-Bf for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Apr 2013 09:37:19 +0200 Original-Received: from localhost ([::1]:39269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQYXv-0008DG-0m for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Apr 2013 03:37:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQXNc-00077y-Pi for help-gnu-emacs@gnu.org; Fri, 12 Apr 2013 02:22:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQXNb-0000VV-S8 for help-gnu-emacs@gnu.org; Fri, 12 Apr 2013 02:22:36 -0400 Original-Received: from 88-191-129-158.rev.dedibox.fr ([88.191.129.158]:42625 helo=casenave-pere.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQXNb-0000VJ-Lk for help-gnu-emacs@gnu.org; Fri, 12 Apr 2013 02:22:35 -0400 Original-Received: from RENAUD-PC.casenave-pere.fr (pb6abe08f.tokyff01.ap.so-net.ne.jp [182.171.224.143]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by casenave-pere.fr (Postfix) with ESMTPSA id ED33E6BE23 for ; Fri, 12 Apr 2013 07:47:27 +0200 (CEST) In-Reply-To: <878v4omosz.fsf@casenave-pere.fr> ("Renaud \=\?iso-8859-1\?Q\?Cas\?\= \=\?iso-8859-1\?Q\?enave-P\=E9r\=E9\=22's\?\= message of "Fri, 12 Apr 2013 04:05:16 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 88.191.129.158 X-Mailman-Approved-At: Fri, 12 Apr 2013 03:37:06 -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:90112 Archived-At: On Fri, Apr 12 2013, Renaud Casenave-P=E9r=E9 wrote: > You may find this solution a bit overkill, but if you install evil, you c= an use > something like this : > > (global-set-key (kbd "C-*") #'(lambda () > (interactive) > (evil-search-symbol t))) ;; search forward > > (global-set-key (kbd "C-#") #'(lambda () > (interactive) > (evil-search-symbol nil))) ;; search back= ward > > which does what you want and should work even if you don't use evil at al= l as > long as you do (require 'evil-search). Another (beggining of a) solution. With something like this : (defun isearch-yank-word-at-point () "Pull the word at point into search string." (interactive) (goto-char (beginning-of-thing 'word)) (isearch-yank-internal #'(lambda () (end-of-thing 'word)))) (define-key isearch-mode-map (kbd "C-*") 'isearch-yank-word-at-point) In combination with `isearch-forward-word', you can jump to the next iterat= ion of the word you are on, using only isearch and thing-at-point facilities. --=20 Renaud Casenave-Pere