all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kelly Dean <kellydeanch@yahoo.com>
To: 14225@debbugs.gnu.org
Subject: bug#14225: [PATCH] Winner mode fails to run mark activation and deactivation hooks
Date: Wed, 17 Apr 2013 20:17:33 -0700 (PDT)	[thread overview]
Message-ID: <1366255053.95181.YahooMailClassic@web141101.mail.bf1.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

Using Emacs 24.3
emacs -Q
(winner-mode 1)
(add-hook 'deactivate-mark-hook (lambda () (setq cursor-type t)))
(add-hook 'activate-mark-hook (lambda () (setq cursor-type 'bar)))
C-x 2
C-c left

Notice that the cursor type is now a bar, not a block. It should be a block.
The attached winnerbug.patch fixes it.

BTW, by default in Emacs, when the region is active but empty, there's no visual indication of this status. Neither is there indication of the active region if point is one less than mark and blink-cursor-mode is off. Also, if point is greater than mark, the active region is highlighted, but the block cursor does an inverse-video highlight of the character following the region, which (speaking from experience) an Emacs newbie finds distracting, since it seems to indicate that that character is also part of the region. Setting the cursor type to bar when the region is active solves all those problems, and I recommend it as the default for Emacs.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: winnerbug.patch --]
[-- Type: text/x-diff; name="winnerbug.patch", Size: 634 bytes --]

--- emacs-24.3/lisp/winner.el
+++ emacs-24.3/lisp/winner.el
@@ -309,7 +309,9 @@
                  for entry = (cadr (assq buf winner-point-alist))
                  do (progn (set-buffer buf)
                            (set-mark (car entry))
-                           (setf (winner-active-region) (cdr entry)))))
+                           (setf (winner-active-region) (cdr entry))
+			   (if (cdr entry) (run-hooks 'activate-mark-hook)
+			     (run-hooks 'deactivate-mark-hook)))))
       ;; Delete windows, whose buffers are dead or boring.
       ;; Return t if this is still a possible configuration.
       (or (null xwins)

             reply	other threads:[~2013-04-18  3:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18  3:17 Kelly Dean [this message]
2013-04-18 13:15 ` bug#14225: [PATCH] Winner mode fails to run mark activation and deactivation hooks Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366255053.95181.YahooMailClassic@web141101.mail.bf1.yahoo.com \
    --to=kellydeanch@yahoo.com \
    --cc=14225@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.