unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: kill-ring-max or other var to convert killing to deleting?
Date: Wed, 1 Mar 2006 13:18:42 -0800	[thread overview]
Message-ID: <MEEKKIABFKKDFJMPIOEBKEJOCPAA.drew.adams@oracle.com> (raw)

Suppose you want to delete some text, and not add it to the kill ring. For
example, suppose you want to delete a word backward. In this case, there is
no `backward-delete-word' function to correspond to `backward-kill-word'.
You could do this, which is essentially the definition of
`backward-kill-word' with "delete" substituted for "kill":

 (delete-region (point) (progn (forward-word (- arg)) (point)))

But wouldn't it be handy, generally, to be able to just convert an existing
`kill-*' function to a `delete-*' function? That is, bind some flag to
indicate that the deleted text is not to be added to the kill ring:

 (let ((kill-p nil)) (backward-kill-word arg))

At first sight, I thought perhaps binding `kill-ring-max' to 0 might do the
trick, but it seems that the killed text is always added to the kill ring.
It is only the cdr of the kill-ring that is affected by `kill-ring-max'.

How about making `kill-ring-max' = 0 have the effect of plain deletion?

             reply	other threads:[~2006-03-01 21:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-01 21:18 Drew Adams [this message]
2006-03-03 22:46 ` kill-ring-max or other var to convert killing to deleting? Ryan Yeske
2006-03-03 22:58   ` Drew Adams
2006-03-05  0:58 ` Richard Stallman

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=MEEKKIABFKKDFJMPIOEBKEJOCPAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).