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

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

Re: Kill ring leak in winemacs macros


From: Kevin Rodgers
Subject: Re: Kill ring leak in winemacs macros
Date: Wed, 03 Aug 2005 09:52:16 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Peterson, Eric wrote:
> When I create a keyboard macro in which I kill and yank form the EMACS
> kill ring and infinitely apply the macro via the "0" prefix argument, I
> have to make sure and not copy or kill into the Windows kill ring while
> the macro is running.  Otherwise this inadvertently introduces
> unwanted/unexpected data into the EMACS kill ring.  My macros can run
> for a long time on large files, so this can stop me from doing other
> work while I am waiting.  Or I can forget about the danger and corrupt
> the data I am manipulating.
...
> I couldn't find a version of or argument for EMACS "kill-line" or
> "kill-ring-save" that would help me.  I'm hoping for a solution that
> wouldn't require me to code and manipulation of
> "interprogram-cut-function" seemed to require codeing.

Anything you put in your ~/.emacs file is Lisp, so that's coding -- but
you can use the M-x customize interface to do it for you.

I don't think your problem is with interprogram-cut-function, since that
just causes the killed text in Emacs to be propagated to the window
system's cut buffer.  I think your problem is actually with
interprogram-paste-function, which gets the text to be yanked in Emacs
from the window system's cut buffer instead of from the kill ring.

If you don't ever want Emacs to yank from the window system's cut
buffer: (setq interprogram-paste-function nil)

If you just want to make sure Emacs yanks from its kill ring when
calling a keyboard macro:

(defadvice call-last-kbd-macro (around yank-from-kill-ring activate)
  "Yank text from the kill ring, ignoring the window system's cut buffer."
  (let ((interprogram-paste-function nil))
    ad-do-it))

--
Kevin Rodgers





reply via email to

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