diff options
author | Richard M. Stallman <[email protected]> | 1994-05-13 08:29:22 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1994-05-13 08:29:22 +0000 |
commit | 03d186909d1b2cf43c31ff0daa9e4c855633474d (patch) | |
tree | 684b489bd50371b146459504a1837ea265ca473f /src/editfns.c | |
parent | 8b550e92abfe451b08062ff96ff9c6db52522458 (diff) |
(save_excursion_restore): Don't run activate-mark-hook
if mark position is unchanged.
Diffstat (limited to 'src/editfns.c')
-rw-r--r-- | src/editfns.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c index 22e14aca3c..14e6d31565 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -295,7 +295,7 @@ Lisp_Object save_excursion_restore (info) register Lisp_Object info; { - register Lisp_Object tem, tem1; + register Lisp_Object tem, tem1, omark, nmark; tem = Fmarker_buffer (Fcar (info)); /* If buffer being returned to is now deleted, avoid error */ @@ -309,7 +309,9 @@ save_excursion_restore (info) Fgoto_char (tem); unchain_marker (tem); tem = Fcar (Fcdr (info)); + omark = Fmarker_position (current_buffer->mark); Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ()); + nmark = Fmarker_position (tem); unchain_marker (tem); tem = Fcdr (Fcdr (info)); #if 0 /* We used to make the current buffer visible in the selected window @@ -326,8 +328,14 @@ save_excursion_restore (info) current_buffer->mark_active = Fcdr (tem); if (!NILP (Vrun_hooks)) { + /* If mark is active now, and either was not active + or was at a different place, run the activate hook. */ if (! NILP (current_buffer->mark_active)) - call1 (Vrun_hooks, intern ("activate-mark-hook")); + { + if (! EQ (omark, nmark)) + call1 (Vrun_hooks, intern ("activate-mark-hook")); + } + /* If mark has ceased to be active, run deactivate hook. */ else if (! NILP (tem1)) call1 (Vrun_hooks, intern ("deactivate-mark-hook")); } |