all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Hu Wei" <roy@mail.ustc.edu.cn>
Subject: A question about kill-region after reading emacs-lisp-intro
Date: Mon, 23 Feb 2004 20:04:17 +0800	[thread overview]
Message-ID: <c1cq2t$8te$1@mail.cn99.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

In the body of kill-region there is a statement as
        (when string
          (if (eq last-command 'kill-region)
              ;; if true, prepend string
              (kill-append string (< end beg))
            (kill-new string)))

The purpose is "The if expression checks whether the previous command was
kill-region. If it was, concatenates a copy of the newly clipped text to the
just previously clipped text in the kill ring. If you then yank back the
text, i.e., `paste' it, you get both pieces of text at once. That way, if
you delete two words in a row, and then yank them back, you get both words,
in their proper order, with one yank. (The (< end beg)) expression makes
sure the order is correct.)"

But how can I delete two words in a row£¿I have to set mark between two
deletions, and this would cause last-command to change.  Is there some
advanced function I don't know?

-------------------
Yours sincerely,
Hu, Wei
My CV can be found at http://mail.ustc.edu.cn/~roy/

             reply	other threads:[~2004-02-23 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-23 12:04 Hu Wei [this message]
2004-02-23 13:16 ` A question about kill-region after reading emacs-lisp-intro Floyd Davidson
2004-02-24  8:47 ` Kai Grossjohann

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='c1cq2t$8te$1@mail.cn99.com' \
    --to=roy@mail.ustc.edu.cn \
    /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 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.