简体   繁体   中英

in emacs, append-next-kill sometimes prepends

For example, place point at the beginning of a line with the text "foo bar". Then Md C- Ce MCw Cw Cy produces " barfoo". This behaviour causes problems when I try to switch the order of text and when I combine a real kill with save-as-kill. No doubt prepending is often useful, but all the documentation I have found says that append-next-kill appends. How do I control emacs's choice between appending and prepending?

See the Emacs manual, node Appending Kills . It gives explicit examples, in particular an example that shows clearly what CMw is for and what it does. Here is part of that text:

If a kill command is separated from the last kill command by other
commands (not just numeric arguments), it starts a new entry on the kill
ring.  But you can force it to append by first typing the command
`C-M-w' (`append-next-kill') right before it.  The `C-M-w' tells the
following command, if it is a kill command, to append the text it kills
to the last killed text, instead of starting a new entry.  With
`C-M-w', you can kill several separated pieces of text and accumulate
them to be yanked back in one place.

For CMw to append the next kill, that kill must immediately follow CMw . If you do something else in between then there is no appending. The command name might better have been append-next-kill-if-it-follows-immediately . ;-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM