lisp - emacs, how to invoke kill-region several times? -


it said in manual if use kill-region sequentially, texts kill concatenated 1 in kill-ring.
i'm confused how works. tried eval in scratch buffer:

(progn    (kill-region 1 5) ; kills ";; t"    (kill-region 1 5)); kills "his " 

what expect that, since use kill-region 2 times, killed texts should concatenated 1 in kill-ring.
when use c-y, "his ".
have 2 questions here:

  • in lisp, how invoke kill-region several times killed texts concatenated?

  • using keyboard c-w, how invoke kill-region several times killed texts concatenated? since typical workflow kill-region(c-w), move-cursor, kill-region again.

here doc string of kill region. isn't 2nd paragraph , last paragraph contradictory?

"kill (\"cut\") text between point , mark. deletes text buffer , saves in kill ring. command \\[yank] can retrieve there. \(if want save region without killing it, use \\[kill-ring-save].)  if want append killed region last killed text, use \\[append-next-kill] before \\[kill-region].  if buffer read-only, emacs beep , refrain deleting text, put text in kill ring anyway.  means can use killing commands copy text read-only buffer.  lisp programs should use function killing text.  (to delete text, use `delete-region'.) supply 2 arguments, character positions indicating stretch of text  killed. command calls function \"kill command\". if previous command kill command, text killed time appends text killed last time make 1 entry in kill ring." 

the documentation refers commands, not functions. command function initiates command loop.

any command calls function \"kill command\". if previous command kill command, text killed time appends text killed last time make 1 entry in kill ring.

this not mean kill-region per se. it's saying command calls kill-region function becomes "kill command" (including kill-region itself). e.g. kill-line kill-word, etc

  • in lisp, how invoke kill-region several times killed texts concatenated?

use kill-append.

(progn    (kill-region 1 5) ; kills ";; t"    (kill-region 1 5)); kills "his " 

what expect that, since use kill-region 2 times, killed texts should concatenated 1 in kill-ring.

you called kill-region twice not commands. both these calls happen within same command loop run.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -