unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13027: Activating mark does not run mark activation hook
@ 2012-11-29 10:08 Kelly Dean
  2012-11-29 20:10 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Kelly Dean @ 2012-11-29 10:08 UTC (permalink / raw)
  To: 13027

In 24.2, from emacs -Q
(add-hook 'deactivate-mark-hook (lambda () (message "Deactivate mark hook called.")))
(add-hook 'activate-mark-hook (lambda () (message "Activate mark hook called.")))
C-SPC C-SPC C-SPC C-SPC
In *Messages* you get:

Mark set
Activate mark hook called.
Deactivate mark hook called.
Mark deactivated
Mark activated
Deactivate mark hook called.
Mark deactivated

Notice that the second "Activate mark hook called" is missing.

simple.el has:
(defun activate-mark ()
  "Activate the mark."
  (when (mark t)
    (setq mark-active t)
    (unless transient-mark-mode
      (setq transient-mark-mode 'lambda))))

The bug is fixed by changing that to:
(defun activate-mark ()
  "Activate the mark."
  (when (mark t)
    (setq mark-active t)
    (run-hooks 'activate-mark-hook)
    (unless transient-mark-mode
      (setq transient-mark-mode 'lambda))))






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#13027: Activating mark does not run mark activation hook
  2012-11-29 10:08 bug#13027: Activating mark does not run mark activation hook Kelly Dean
@ 2012-11-29 20:10 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2012-11-29 20:10 UTC (permalink / raw)
  To: Kelly Dean; +Cc: 13027-done

> The bug is fixed by changing that to:
> (defun activate-mark ()
>   "Activate the mark."
>   (when (mark t)
>     (setq mark-active t)
>     (run-hooks 'activate-mark-hook)
>     (unless transient-mark-mode
>       (setq transient-mark-mode 'lambda))))

Thank you, installed,


        Stefan





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-29 20:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29 10:08 bug#13027: Activating mark does not run mark activation hook Kelly Dean
2012-11-29 20:10 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).