From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Scott Frazer Newsgroups: gmane.emacs.help Subject: Re: highlight select whole word when in the middle shortcut Date: Wed, 12 May 2010 04:32:08 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0bf6115d-74c6-4734-b69b-e8bb561ccb94@k2g2000yqe.googlegroups.com> References: <8481edba-6131-49c8-9d6c-7b9cb1b8fd9f@q16g2000yqq.googlegroups.com> <4bb9e7f7$0$280$14726298@news.sunsite.dk> <86ljbpvbzt.fsf@zeus.knighten.org> 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 1291827847 23529 80.91.229.12 (8 Dec 2010 17:04:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 17:04:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 18:04:03 2010 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 1PQNQw-0004ZL-AH for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 18:04:02 +0100 Original-Received: from localhost ([127.0.0.1]:57448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQNQv-0006k7-Jt for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 12:04:01 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!k2g2000yqe.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: 174.97.253.170 Original-X-Trace: posting.google.com 1273663928 19548 127.0.0.1 (12 May 2010 11:32:08 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 12 May 2010 11:32:08 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k2g2000yqe.googlegroups.com; posting-host=174.97.253.170; posting-account=mTP6TAoAAADeO2EO3QMjJrmUPGLwlQy3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:178151 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:75662 Archived-At: On May 12, 3:02=A0am, Robert Knighten wrote: > Kevin Rodgers writes: > > Colin S. Miller wrote: > >> mouezapeter wrote: > >>> Hi, > >>> If I am in the middle of the word "deduction", is there a shortcut to > >>> highlight,select the hole word ? > > >> Hi, > >> If you are using a GUI, then double-click on the word to select it. > >> Otherwise, add this to your .emacs, restart, and then press C-x w > > >> HTH, > >> Colin S. Miller > > >> (defun select-word-at-point () > >> =A0 =A0 (interactive) > >> =A0 =A0 (let ((p (bounds-of-thing-at-point 'word))) > >> =A0 =A0 =A0 (set-mark (car p)) > >> =A0 =A0 =A0 (exchange-point-and-mark) > >> =A0 =A0 =A0 (set-mark (cdr p)) > >> =A0 =A0 =A0 )) > > >> (global-set-key '[(control x) (w)] 'select-word-at-point) > > > M-x mark-word > > That just marks to the end of the word. > > -- > Robert L. Knighten > R...@knighten.org I use this: (defun my-select-word-at-point () "Select the word at point." (interactive) (skip-syntax-forward "w_") (push-mark (point)) (skip-syntax-backward "w_") (exchange-point-and-mark))