/* Lisp functions pertaining to editing.
- Copyright (C) 1985, 1986, 1987, 1989, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1985,86,87,89,93,94 Free Software Foundation, Inc.
This file is part of GNU Emacs.
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 */
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
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"));
}