# HG changeset patch # User Richard M. Stallman # Date 1110140150 0 # Node ID be3ac492036f3f0082e8820f64c2fc8f185015ff # Parent df46d87c0c2fb54bf6e03a008d37fffbb85d536f (activate-mark-hook, deactivate-mark-hook): Add defvars. (push-mark-command): Run activate-mark-hook. diff -r df46d87c0c2f -r be3ac492036f lisp/simple.el --- a/lisp/simple.el Sun Mar 06 18:32:32 2005 +0000 +++ b/lisp/simple.el Sun Mar 06 20:15:50 2005 +0000 @@ -2913,6 +2913,14 @@ (put 'mark-inactive 'error-conditions '(mark-inactive error)) (put 'mark-inactive 'error-message "The mark is not active now") +(defvar activate-mark-hook nil + "Hook run when the mark becomes active. +It is also run at the end of a command, if the mark is active and +it is possible that the region may have changed") + +(defvar deactivate-mark-hook nil + "Hook run when the mark becomes inactive.") + (defun mark (&optional force) "Return this buffer's mark value as integer; error if mark inactive. If optional argument FORCE is non-nil, access the mark value @@ -3004,6 +3012,7 @@ (if (or arg (null mark) (/= mark (point))) (push-mark nil nomsg t) (setq mark-active t) + (run-hooks 'activate-mark-hook) (unless nomsg (message "Mark activated")))))