unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* A question about kill-region after reading emacs-lisp-intro
@ 2004-02-23 12:04 Hu Wei
  2004-02-23 13:16 ` Floyd Davidson
  2004-02-24  8:47 ` Kai Grossjohann
  0 siblings, 2 replies; 3+ messages in thread
From: Hu Wei @ 2004-02-23 12:04 UTC (permalink / 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/

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

* Re: A question about kill-region after reading emacs-lisp-intro
  2004-02-23 12:04 A question about kill-region after reading emacs-lisp-intro Hu Wei
@ 2004-02-23 13:16 ` Floyd Davidson
  2004-02-24  8:47 ` Kai Grossjohann
  1 sibling, 0 replies; 3+ messages in thread
From: Floyd Davidson @ 2004-02-23 13:16 UTC (permalink / raw)


"Hu Wei" <roy@mail.ustc.edu.cn> wrote:
>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?

You can precede any kill command with append-next-kill to get the
same effect as two sequential kill commands.

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

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

* Re: A question about kill-region after reading emacs-lisp-intro
  2004-02-23 12:04 A question about kill-region after reading emacs-lisp-intro Hu Wei
  2004-02-23 13:16 ` Floyd Davidson
@ 2004-02-24  8:47 ` Kai Grossjohann
  1 sibling, 0 replies; 3+ messages in thread
From: Kai Grossjohann @ 2004-02-24  8:47 UTC (permalink / raw)


"Hu Wei" <roy@mail.ustc.edu.cn> writes:

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

Hm?

Just hit M-d twice to kill two words.  (I presume you mean kill, not
delete.  Delete does not add to the kill-ring.)

Kai

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

end of thread, other threads:[~2004-02-24  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-23 12:04 A question about kill-region after reading emacs-lisp-intro Hu Wei
2004-02-23 13:16 ` Floyd Davidson
2004-02-24  8:47 ` Kai Grossjohann

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