unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: No copy when killing
Date: Sat, 14 Jun 2008 07:01:06 -0700 (PDT)	[thread overview]
Message-ID: <f3ce0d34-e42e-40e1-bb60-c06faa82cde8@a9g2000prl.googlegroups.com> (raw)
In-Reply-To: 0cd27ea8-87cb-4891-8cce-8887be2aa949@e39g2000hsf.googlegroups.com

Here's a kill-word command that does not push text into kill-ring.

(defun my-kill-word (arg)
  "Kill characters forward until encountering the end of a word.
With argument, do this that many times.
Do not push killed text to kill-ring"
  (interactive "p")
  (delete-region (point) (progn (forward-word arg) (point))))

it's basically copy-paste of the same code of kill-word, execpt that
kill-region is replaced by delete-region.

here's a simple kill-line that doesn't push to kill-ring.

(defun delete-point-to-line-end ()
  "Delete text from current position to end of line char."
  (interactive)
  (delete-region
   (point)
   (save-excursion (move-end-of-line 1) (point))
   ))

> Thanks again so much :)

you are very welcome. :) I got lots help here too.

  Xah
∑ http://xahlee.org/

☄

On Jun 14, 3:18 am, rock69 <rocco.ro...@gmail.com> wrote:

> Thank youXahfor the detailed explanation. I would indeed like to see
> the code if it's not too much trouble. Although, as a matter of fact,
> I most likely am going to follow your suggestion, and use another
> register when I'm in one of the situations I mentioned.
>
> Thanks again so much :)



  reply	other threads:[~2008-06-14 14:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-14  9:24 No copy when killing rock69
2008-06-14  9:54 ` Xah
2008-06-14 10:18   ` rock69
2008-06-14 14:01     ` Xah [this message]
2008-06-15 11:27     ` Xah
2008-06-17  6:44       ` Xah
2008-06-16 17:21 ` Steinar Bang

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=f3ce0d34-e42e-40e1-bb60-c06faa82cde8@a9g2000prl.googlegroups.com \
    --to=xahlee@gmail.com \
    --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).