diff options
| author | Richard M. Stallman | 1994-05-13 08:29:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-05-13 08:29:22 +0000 |
| commit | 03d186909d1b2cf43c31ff0daa9e4c855633474d (patch) | |
| tree | 684b489bd50371b146459504a1837ea265ca473f | |
| parent | 8b550e92abfe451b08062ff96ff9c6db52522458 (diff) | |
| download | emacs-03d186909d1b2cf43c31ff0daa9e4c855633474d.tar.gz emacs-03d186909d1b2cf43c31ff0daa9e4c855633474d.zip | |
(save_excursion_restore): Don't run activate-mark-hook
if mark position is unchanged.
| -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 22e14aca3cb..14e6d315659 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -295,7 +295,7 @@ Lisp_Object | |||
| 295 | save_excursion_restore (info) | 295 | save_excursion_restore (info) |
| 296 | register Lisp_Object info; | 296 | register Lisp_Object info; |
| 297 | { | 297 | { |
| 298 | register Lisp_Object tem, tem1; | 298 | register Lisp_Object tem, tem1, omark, nmark; |
| 299 | 299 | ||
| 300 | tem = Fmarker_buffer (Fcar (info)); | 300 | tem = Fmarker_buffer (Fcar (info)); |
| 301 | /* If buffer being returned to is now deleted, avoid error */ | 301 | /* If buffer being returned to is now deleted, avoid error */ |
| @@ -309,7 +309,9 @@ save_excursion_restore (info) | |||
| 309 | Fgoto_char (tem); | 309 | Fgoto_char (tem); |
| 310 | unchain_marker (tem); | 310 | unchain_marker (tem); |
| 311 | tem = Fcar (Fcdr (info)); | 311 | tem = Fcar (Fcdr (info)); |
| 312 | omark = Fmarker_position (current_buffer->mark); | ||
| 312 | Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ()); | 313 | Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ()); |
| 314 | nmark = Fmarker_position (tem); | ||
| 313 | unchain_marker (tem); | 315 | unchain_marker (tem); |
| 314 | tem = Fcdr (Fcdr (info)); | 316 | tem = Fcdr (Fcdr (info)); |
| 315 | #if 0 /* We used to make the current buffer visible in the selected window | 317 | #if 0 /* We used to make the current buffer visible in the selected window |
| @@ -326,8 +328,14 @@ save_excursion_restore (info) | |||
| 326 | current_buffer->mark_active = Fcdr (tem); | 328 | current_buffer->mark_active = Fcdr (tem); |
| 327 | if (!NILP (Vrun_hooks)) | 329 | if (!NILP (Vrun_hooks)) |
| 328 | { | 330 | { |
| 331 | /* If mark is active now, and either was not active | ||
| 332 | or was at a different place, run the activate hook. */ | ||
| 329 | if (! NILP (current_buffer->mark_active)) | 333 | if (! NILP (current_buffer->mark_active)) |
| 330 | call1 (Vrun_hooks, intern ("activate-mark-hook")); | 334 | { |
| 335 | if (! EQ (omark, nmark)) | ||
| 336 | call1 (Vrun_hooks, intern ("activate-mark-hook")); | ||
| 337 | } | ||
| 338 | /* If mark has ceased to be active, run deactivate hook. */ | ||
| 331 | else if (! NILP (tem1)) | 339 | else if (! NILP (tem1)) |
| 332 | call1 (Vrun_hooks, intern ("deactivate-mark-hook")); | 340 | call1 (Vrun_hooks, intern ("deactivate-mark-hook")); |
| 333 | } | 341 | } |