help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kill-region and white space


From: kgold
Subject: Re: kill-region and white space
Date: 1 Sep 2004 13:31:54 GMT

Kevin Rodgers <ihs_4664@yahoo.com> 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)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]