emacs-devel
[Top][All Lists]
Advanced

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

Re: save-excursion and the mark


From: Stefan Monnier
Subject: Re: save-excursion and the mark
Date: Sat, 18 Apr 2015 00:26:17 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> Code that previously relied on `save-excursion' restoring the mark no
> longer works, and that's fine.  But could we have a new form like
> `save-mark' (or something) that we could just slap around forms that
> previously relied on this form behaving the old way?

(cl-letf (((mark))) ...) might do the trick.
Or maybe you'll need (cl-letf (((mark)) (mark-active)) ...).
note that if the "..." activates or deactivates the mark, you're
probably somewhat in trouble in the sense that (de)activate-mark-hook
will be run, despite the cl-letf, and you can't really undo the effect
of running a hook.


        Stefan



reply via email to

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