all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Erase Region and paste in once?
@ 2007-04-04  1:33 Daniel
  2007-04-04  3:08 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Daniel @ 2007-04-04  1:33 UTC (permalink / raw)
  To: help-gnu-emacs

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?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Erase Region and paste in once?
  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  9:37 ` Samuel Karl Peterson
  2 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2007-04-04  3:08 UTC (permalink / raw)
  To: help-gnu-emacs

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

Did you try to turn on the CUA mode?

   M-x cua-mode RET

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Erase Region and paste in once?
  2007-04-04  3:08 ` Eli Zaretskii
@ 2007-04-04  3:18   ` Matthew Flaschen
  0 siblings, 0 replies; 10+ messages in thread
From: Matthew Flaschen @ 2007-04-04  3:18 UTC (permalink / raw)
  To: emacs

Eli Zaretskii wrote:
>> From: "Daniel" <hanmoai@gmail.com>
>> Date: 3 Apr 2007 18:33:47 -0700
>>
>> 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.
> 
> Did you try to turn on the CUA mode?
> 
>    M-x cua-mode RET

It doesn't seem to be included.  See http://www.cua.dk/cua.el

Matt Flaschen

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Erase Region and paste in once?
       [not found] ` <mailman.1733.1175656317.7795.help-gnu-emacs@gnu.org>
@ 2007-04-04  4:37   ` Daniel
  2007-04-04 10:28     ` cmr.Pent
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel @ 2007-04-04  4:37 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 3, 8:08 pm, Eli Zaretskii <e...@gnu.org> wrote:
> > From: "Daniel" <hanm...@gmail.com>
> > Date: 3 Apr 2007 18:33:47 -0700
>
> > 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.
>
> Did you try to turn on the CUA mode?
>
>    M-x cua-mode RET

The problem of cua-mode is override C-c and C-v. I am using C-v for
moving pages. Is there any way to use only to overwrite the region not
touching C-c or C-v?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Erase Region and paste in once?
  2007-04-04  1:33 Erase Region and paste in once? Daniel
  2007-04-04  3:08 ` Eli Zaretskii
       [not found] ` <mailman.1733.1175656317.7795.help-gnu-emacs@gnu.org>
@ 2007-04-04  9:37 ` Samuel Karl Peterson
  2007-04-04 11:13   ` Alexander Zhukov
  2 siblings, 1 reply; 10+ messages in thread
From: Samuel Karl Peterson @ 2007-04-04  9:37 UTC (permalink / raw)
  To: help-gnu-emacs

"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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Erase Region and paste in once?
  2007-04-04  4:37   ` Daniel
@ 2007-04-04 10:28     ` cmr.Pent
  0 siblings, 0 replies; 10+ messages in thread
From: cmr.Pent @ 2007-04-04 10:28 UTC (permalink / raw)
  To: help-gnu-emacs


Daniel:
> On Apr 3, 8:08 pm, Eli Zaretskii <e...@gnu.org> wrote:
> > > From: "Daniel" <hanm...@gmail.com>
> > > Date: 3 Apr 2007 18:33:47 -0700
> >
> > > 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.
> >
> > Did you try to turn on the CUA mode?
> >
> >    M-x cua-mode RET
>
> The problem of cua-mode is override C-c and C-v. I am using C-v for
> moving pages. Is there any way to use only to overwrite the region not
> touching C-c or C-v?

Try M-x cua-mode 'emacs RET

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Erase Region and paste in once?
  2007-04-04  9:37 ` Samuel Karl Peterson
@ 2007-04-04 11:13   ` Alexander Zhukov
  2007-04-04 16:24     ` Daniel
  2007-04-04 17:52     ` Matthew Flaschen
  0 siblings, 2 replies; 10+ messages in thread
From: Alexander Zhukov @ 2007-04-04 11:13 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> 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.

When Delete Selection mode is enabled, Transient Mark mode is also
enabled and typed text replaces the selection if the selection is
active.  Otherwise, typed text is just inserted at point regardless of
any selection.

-- 
Alexander Zhukov

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Erase Region and paste in once?
  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
  1 sibling, 1 reply; 10+ messages in thread
From: Daniel @ 2007-04-04 16:24 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 4, 4:13 am, Alexander Zhukov <z...@yandex.ru> wrote:
> >>>>> Samuel Karl Peterson (SKP) writes:
>
>  SKP> "Daniel" <hanm...@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.
>
> When Delete Selection mode is enabled, Transient Mark mode is also
> enabled and typed text replaces the selection if the selection is
> active.  Otherwise, typed text is just inserted at point regardless of
> any selection.
>
> --
> Alexander Zhukov

Thank you, Alexander Zhukov,

I didn't even know the mode. Great Help.

Thank you and other guys. I could know emacs do lot of things. Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Erase Region and paste in once?
  2007-04-04 16:24     ` Daniel
@ 2007-04-04 16:41       ` Drew Adams
  0 siblings, 0 replies; 10+ messages in thread
From: Drew Adams @ 2007-04-04 16:41 UTC (permalink / raw)
  To: help-gnu-emacs

> > delete-selection-mode
>
> Thank you, Alexander Zhukov,
> I didn't even know the mode. Great Help.

http://www.emacswiki.org/cgi-bin/wiki/DeleteSelectionMode

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Erase Region and paste in once?
  2007-04-04 11:13   ` Alexander Zhukov
  2007-04-04 16:24     ` Daniel
@ 2007-04-04 17:52     ` Matthew Flaschen
  1 sibling, 0 replies; 10+ messages in thread
From: Matthew Flaschen @ 2007-04-04 17:52 UTC (permalink / raw)
  To: emacs

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-04-04 17:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.