[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Erase Region and paste in once?
From: |
Matthew Flaschen |
Subject: |
Re: Erase Region and paste in once? |
Date: |
Wed, 04 Apr 2007 13:52:30 -0400 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20070306) |
Alexander Zhukov wrote:
>>>>>> Samuel Karl Peterson (SKP) writes:
>
> SKP> "Daniel" <hanmoai@gmail.com> on 3 Apr 2007 18:33:47 -0700 didst
> SKP> step forth and proclaim thus:
>
> >> Hi all,
> >>
> >> In general editors, I do copy (ctrl-c) some text in firefox and make
> >> a region in a editor where I want to replace and paste(ctrl-v) it.
> >>
> >> I tried to do in emacs, but I can't find a way to overwrite a
> >> certain region by doing yank at one time.
> >>
> >> Is it possible to do it in emacs?
>
> SKP> Anything's possible in Emacs ;)
>
> SKP> Behold my lisp snippet:
>
> SKP> (defun sams-zap-yank (beg end) (interactive "r") (delete-region
> SKP> beg end) (yank))
>
> SKP> Assign it to a key such as:
>
> SKP> (global-set-key "\C-cv" 'sams-zap-yank)
>
> SKP> Who knows, Emacs may have already had this functionality. I may
> SKP> have just reinvented the wheel, but eh, it was a small wheel.
>
> I use this:
>
> (delete-selection-mode 1)
>
> Here is description:
>
> delete-selection-mode is an interactive compiled Lisp function in
> `delsel.el'. (delete-selection-mode &optional arg)
>
> Toggle Delete Selection mode.
> With prefix arg, turn Delete Selection mode on if and only if arg is
> positive.
Interesting. I'll try it out for a while.
Matt Flaschen