help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A question about kill-region after reading emacs-lisp-intro


From: Hu Wei
Subject: A question about kill-region after reading emacs-lisp-intro
Date: Mon, 23 Feb 2004 20:04:17 +0800

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 via email to

[Prev in Thread] Current Thread [Next in Thread]