diff options
Diffstat (limited to 'src/editfns.c')
-rw-r--r-- | src/editfns.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/editfns.c b/src/editfns.c index 1f98ff040b3..009e1d34bde 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -928,18 +928,21 @@ save_excursion_restore (Lisp_Object info) tem1 = BVAR (current_buffer, mark_active); BVAR (current_buffer, mark_active) = 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 (tem)) { - /* If mark is active now, and either was not active - or was at a different place, run the activate hook. */ - if (! NILP (BVAR (current_buffer, mark_active))) - { - 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")); + if (! EQ (omark, nmark)) + { + tem = intern ("activate-mark-hook"); + Frun_hooks (1, &tem); + } + } + /* If mark has ceased to be active, run deactivate hook. */ + else if (! NILP (tem1)) + { + tem = intern ("deactivate-mark-hook"); + Frun_hooks (1, &tem); } /* If buffer was visible in a window, and a different window was |