unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Samuel Karl Peterson <skpeterson@nospam.please.ucdavis.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: Erase Region and paste in once?
Date: 04 Apr 2007 02:37:37 -0700	[thread overview]
Message-ID: <o36irccscny.fsf@pc13.cs.ucdavis.edu> (raw)
In-Reply-To: 1175650427.745405.43310@e65g2000hsc.googlegroups.com

"Daniel" <hanmoai@gmail.com> on 3 Apr 2007 18:33:47 -0700 didst 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?

Anything's possible in Emacs ;)

Behold my lisp snippet:

(defun sams-zap-yank (beg end)
  (interactive "r")
  (delete-region beg end)
  (yank))

Assign it to a key such as:

(global-set-key "\C-cv" 'sams-zap-yank)

Who knows, Emacs may have already had this functionality. I may have
just reinvented the wheel, but eh, it was a small wheel.

-- 
Sam Peterson
skpeterson At nospam ucdavis.edu
"if programmers were paid to remove code instead of adding it,
software would be much better" -- unknown

  parent reply	other threads:[~2007-04-04  9:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04  1:33 Erase Region and paste in once? Daniel
2007-04-04  3:08 ` Eli Zaretskii
2007-04-04  3:18   ` Matthew Flaschen
     [not found] ` <mailman.1733.1175656317.7795.help-gnu-emacs@gnu.org>
2007-04-04  4:37   ` Daniel
2007-04-04 10:28     ` cmr.Pent
2007-04-04  9:37 ` Samuel Karl Peterson [this message]
2007-04-04 11:13   ` Alexander Zhukov
2007-04-04 16:24     ` Daniel
2007-04-04 16:41       ` Drew Adams
2007-04-04 17:52     ` Matthew Flaschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=o36irccscny.fsf@pc13.cs.ucdavis.edu \
    --to=skpeterson@nospam.please.ucdavis.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).