From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kgold@watson.ibm.com (kgold) Newsgroups: gmane.emacs.help Subject: Re: kill-region and white space Date: 1 Sep 2004 13:31:54 GMT Organization: IBM T.J. Watson Research Center Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <4135cf4a_3@news1.prserv.net> References: <41336f8c_1@news1.prserv.net> <413495D4.9090106@yahoo.com> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1094045145 32215 80.91.224.253 (1 Sep 2004 13:25:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Sep 2004 13:25:45 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 01 15:25:33 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C2V7E-0004kd-00 for ; Wed, 01 Sep 2004 15:25:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C2VC9-0008Rl-MY for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Sep 2004 09:30:37 -0400 X-Newsreader: xrn 9.02 Original-Newsgroups: gnu.emacs.help Original-NNTP-Posting-Host: yktgi01e0-s5.watson.ibm.com Original-X-Trace: 1 Sep 2004 13:31:54 GMT, yktgi01e0-s5.watson.ibm.com Original-Lines: 31 Original-X-Complaints-To: abuse@prserv.net Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.us.prserv.net!prserv.net!news1.prserv.net!alpha.watson.ibm.com!kgold Original-Xref: shelby.stanford.edu gnu.emacs.help:125046 Original-To: help-gnu-emacs@gnu.org 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: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20399 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20399 Kevin Rodgers writes: > kgold wrote: > > I set mouse-3 to kill-region, and mouse-2 to mouse-yank-at-click. So > > I can cut and paste using only the mouse. > > > > mouse-1 double click selects a word, so I'd like to be able to select, > > cut, and paste a word using the mouse. However, the double click > > doesn't select the white space after the word. I grabbed this code for > > kill-word to do what I want. Is there something similar for mouse-1 > > double click? > > > > (defadvice kill-word (after delete-horizontal-space activate) > > "Delete trailing whitespace as well." > > (if (looking-at "\\s ") > > (just-one-space))) > > Why not advise kill-region similarly, since that's what you've bound > mouse-3 to? Here's what I tried. They both kill correctly, but the yank does not yank the whitespace. I think I need the mouse-1 double click to select the word and the whitespace after it. That is, I think the problem and solution involve the select, not the kill. (defadvice kill-region (after delete-horizontal-space activate) "Delete trailing whitespace as well." (if (looking-at "\\s ") (just-one-space)))