[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possibly incorrect non-deactivation of mark from kbd macro
From: |
Ben North |
Subject: |
Re: Possibly incorrect non-deactivation of mark from kbd macro |
Date: |
Mon, 26 Feb 2007 08:52:56 +0000 |
User-agent: |
Internet Messaging Program (IMP) 3.2.8 |
Stuart D. Herring wrote:
> [Ben North wrote:]
> > (defun insert-X-as-if-from-kbd-macro ()
> > (interactive)
> > (save-excursion (execute-kbd-macro "X")))
> >
> > [...] The mark is not deactivated
>
> [...] the only buffer modification that occurs takes place in a nested
> command -- one started by `execute-kbd-macro' [...]. When _it_
> finishes, it does in fact deactivate the mark. But it finishes before
> `execute-kbd-macro' returns! [...] Then the macro finishes, and as
> you exit the `save-excursion' it reactivates the mark.
Thanks for the explanation. I see what's going on now.
Perhaps it would have been more useful for me to have given the
non-cut-down version of what I encountered: I had recorded a keyboard
macro, and then applied it to the lines in the region using `C-x C-k r'.
Despite many buffer modifications, the mark remained active. This
struck me as counter-intuitive behaviour from a user level.
I wouldn't claim this is a huge problem, but if it could be fixed, I
think emacs' behaviour would be less surprising in this situation.