aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Colascione2015-05-04 11:46:12 -0700
committerDaniel Colascione2015-05-04 11:46:12 -0700
commit255a011f0ecf004b31c59945b10154b10fac3af1 (patch)
treeef4c1809537fd50c98cd137dbb70a8d48c015616 /src
parentfe4e258b17feb529ac364daee67a5f0441f851f4 (diff)
downloademacs-255a011f0ecf004b31c59945b10154b10fac3af1.tar.gz
emacs-255a011f0ecf004b31c59945b10154b10fac3af1.zip
Add `save-mark-and-excursion', which has the old `save-excursion' behavior
* doc/lispref/positions.texi (Excursions): Document `save-mark-and-excursion'. * lisp/font-lock.el (font-lock-fontify-block): Use `save-mark-and-excursion' instead of `save-excursion', restoring Emacs 24 behavior. * lisp/simple.el (save-mark-and-excursion--save) (save-mark-and-excursion--restore): New functions. (save-mark-and-excursion): New user macro. * src/editfns.c (Fsave_excursion): Mention `save-mark-and-excursion' in `save-excursion' documentation.
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/editfns.c b/src/editfns.c
index dead48c1a62..1686fbf668b 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -908,6 +908,10 @@ even in case of abnormal exit (throw or error).
908If you only want to save the current buffer but not point, 908If you only want to save the current buffer but not point,
909then just use `save-current-buffer', or even `with-current-buffer'. 909then just use `save-current-buffer', or even `with-current-buffer'.
910 910
911Before Emacs 25.1, `save-excursion' used to save the mark state.
912To save the marker state as well as the point and buffer, use
913`save-mark-and-excursion'.
914
911usage: (save-excursion &rest BODY) */) 915usage: (save-excursion &rest BODY) */)
912 (Lisp_Object args) 916 (Lisp_Object args)
913{ 917{