emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to stop delete key putting a region into kill ring
@ 2010-08-14 10:19 Ivanov Dmitry
  2010-08-14 16:02 ` Nick Dokos
  0 siblings, 1 reply; 3+ messages in thread
From: Ivanov Dmitry @ 2010-08-14 10:19 UTC (permalink / raw)
  To: emacs-orgmode

When I am editing a text in Emacs - not only in org-mode - when I select a region and press <Del> to remove it, it's being placed into the clipboard and when I want to paste some text instead I have to get rid of it.

Does anybody know, how to stop it and make <Del> simply kill the region without putting it into the clipboard?

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

* Re: how to stop delete key putting a region into kill ring
  2010-08-14 10:19 how to stop delete key putting a region into kill ring Ivanov Dmitry
@ 2010-08-14 16:02 ` Nick Dokos
  2010-08-14 16:36   ` Thierry Volpiatto
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Dokos @ 2010-08-14 16:02 UTC (permalink / raw)
  To: Ivanov Dmitry; +Cc: nicholas.dokos, emacs-orgmode

[Somewhat off-topic for this list, so it might be better to follow up
on gnu.emacs.help or some such.]

Ivanov Dmitry <usr345@gmail.com> wrote:

> When I am editing a text in Emacs - not only in org-mode - when I
> select a region and press <Del> to remove it, it's being placed into
> the clipboard and when I want to paste some text instead I have to get
> rid of it.
> 

> Does anybody know, how to stop it and make <Del> simply kill the
> region without putting it into the clipboard?
> 

My <delete> key is (normally) bound to delete-char and it does not
behave at all the way you describe: in particular, it does not matter
whether a region is selected or not - it deletes one character (and that
is *not* saved in the kill ring.) In order to delete a selected region,
I use C-w (kill-region) which *does* save the killed region to the kill
ring (it also copies it to the X cut buffer - or the successors
thereof - if emacs is running under X.) The kill-region function is also
bound to S-<delete> in my case, which may be what you mean - or it may
be that you have customized your keys somehow.

You can delete the region without saving it to the kill ring by calling
the function delete-region (which in my case is bound to the Clear item
in the Edit menu). And you can rebind any key you want to call this
function (in particular, the <delete> key, however inadvisable that
would be)[1], at the risk of being incompatible with everybody else in
the universe and therefore having a harder time getting help. In
particular, if you do that, mentioning keys is not going to help: you
will have to use C-h c (describe-key-briefly) or C-h k (describe-key) on
the key in order to find out the function that it is bound to and then
mention that. You might want to do that now with <delete> and see what
function it is bound to.

<opinion>
This latter problem is partly the reason that having command names, as
well as key descriptions, in the manual is useful. It is also why
things like ErgoEmacs (see Don Womick's posting in this list a little
while ago) make whatever hair I have left on my head stand on end.
</opinion>

BTW, I mention X and assume that you are running on some Unix variant.
If you are running on Windows of some sort, things are probably different,
at least in some details.

HTH,
Nick

[1] see section 57.4, "Customizing Key Bindings", in the Emacs manual
    for details.

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

* Re: how to stop delete key putting a region into kill ring
  2010-08-14 16:02 ` Nick Dokos
@ 2010-08-14 16:36   ` Thierry Volpiatto
  0 siblings, 0 replies; 3+ messages in thread
From: Thierry Volpiatto @ 2010-08-14 16:36 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

> [Somewhat off-topic for this list, so it might be better to follow up
> on gnu.emacs.help or some such.]
>
> Ivanov Dmitry <usr345@gmail.com> wrote:
>
>> When I am editing a text in Emacs - not only in org-mode - when I
>> select a region and press <Del> to remove it, it's being placed into
>> the clipboard and when I want to paste some text instead I have to get
>> rid of it.
>> 
>
>> Does anybody know, how to stop it and make <Del> simply kill the
>> region without putting it into the clipboard?
>> 
>
> My <delete> key is (normally) bound to delete-char and it does not
> behave at all the way you describe: in particular, it does not matter
> whether a region is selected or not - it deletes one character (and that
> is *not* saved in the kill ring.) In order to delete a selected region,
> I use C-w (kill-region) which *does* save the killed region to the kill
> ring (it also copies it to the X cut buffer - or the successors
> thereof - if emacs is running under X.) The kill-region function is also
> bound to S-<delete> in my case, which may be what you mean - or it may
> be that you have customized your keys somehow.

Things have changed in Emacs24:

,----
| *** New option `delete-active-region'.
| If non-nil, C-d, [delete], and DEL delete the region if it is active
| and no prefix argument is given.  If set to `kill', these commands
| kill instead.
`----

Before i had to use this:

,----
| (defun tv-delete-char (arg beg end)
|   (interactive "p\nr")
|   (if (region-active-p)
|       (delete-region beg end)
|       (delete-char arg)))
| 
| (global-set-key (kbd "C-d") 'tv-delete-char)
`----

> You can delete the region without saving it to the kill ring by calling
> the function delete-region (which in my case is bound to the Clear item
> in the Edit menu). And you can rebind any key you want to call this
> function (in particular, the <delete> key, however inadvisable that
> would be)[1], at the risk of being incompatible with everybody else in
> the universe and therefore having a harder time getting help. In
> particular, if you do that, mentioning keys is not going to help: you
> will have to use C-h c (describe-key-briefly) or C-h k (describe-key) on
> the key in order to find out the function that it is bound to and then
> mention that. You might want to do that now with <delete> and see what
> function it is bound to.
>
> <opinion>
> This latter problem is partly the reason that having command names, as
> well as key descriptions, in the manual is useful. It is also why
> things like ErgoEmacs (see Don Womick's posting in this list a little
> while ago) make whatever hair I have left on my head stand on end.
> </opinion>
>
> BTW, I mention X and assume that you are running on some Unix variant.
> If you are running on Windows of some sort, things are probably different,
> at least in some details.
>
> HTH,
> Nick
>
> [1] see section 57.4, "Customizing Key Bindings", in the Emacs manual
>     for details.
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

-- 
Thierry Volpiatto
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 

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

end of thread, other threads:[~2010-08-14 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-14 10:19 how to stop delete key putting a region into kill ring Ivanov Dmitry
2010-08-14 16:02 ` Nick Dokos
2010-08-14 16:36   ` Thierry Volpiatto

Code repositories for project(s) associated with this public inbox

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

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