From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Samuel Karl Peterson Newsgroups: gmane.emacs.help Subject: Re: Erase Region and paste in once? Date: 04 Apr 2007 02:37:37 -0700 Organization: University of California, Davis Message-ID: References: <1175650427.745405.43310@e65g2000hsc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1175683052 14496 80.91.229.12 (4 Apr 2007 10:37:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 4 Apr 2007 10:37:32 +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 Apr 04 12:37:24 2007 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.50) id 1HZ2rh-0007uZ-1Q for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Apr 2007 12:37:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HZ2uw-0003m5-48 for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Apr 2007 06:40:42 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!newsfeed.news.ucla.edu!ucdavis!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-NNTP-Posting-Host: pc13.cs.ucdavis.edu Original-X-Trace: skeeter.ucdavis.edu 1175679457 3062 169.237.5.52 (4 Apr 2007 09:37:37 GMT) Original-X-Complaints-To: usenet@ucdavis.edu Original-NNTP-Posting-Date: Wed, 4 Apr 2007 09:37:37 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Original-Xref: shelby.stanford.edu gnu.emacs.help:146804 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:42408 Archived-At: "Daniel" 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