From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#14225: [PATCH] Winner mode fails to run mark activation and deactivation hooks Date: Thu, 18 Apr 2013 09:15:11 -0400 Message-ID: References: <1366255053.95181.YahooMailClassic@web141101.mail.bf1.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1366290991 4304 80.91.229.3 (18 Apr 2013 13:16:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Apr 2013 13:16:31 +0000 (UTC) Cc: 14225@debbugs.gnu.org To: Kelly Dean Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 18 15:16:35 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USohT-0007de-Vf for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Apr 2013 15:16:32 +0200 Original-Received: from localhost ([::1]:53314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USohT-0005oZ-H6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Apr 2013 09:16:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USogb-00052j-Cv for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 09:15:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USogY-0005Oc-RK for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 09:15:37 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USogY-0005Nu-MB for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 09:15:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1USoks-0007f7-GS for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 09:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Apr 2013 13:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14225 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 14225-submit@debbugs.gnu.org id=B14225.136629119129413 (code B ref 14225); Thu, 18 Apr 2013 13:20:02 +0000 Original-Received: (at 14225) by debbugs.gnu.org; 18 Apr 2013 13:19:51 +0000 Original-Received: from localhost ([127.0.0.1]:58352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1USokf-0007eL-SU for submit@debbugs.gnu.org; Thu, 18 Apr 2013 09:19:50 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:37371) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1USoka-0007dz-PF for 14225@debbugs.gnu.org; Thu, 18 Apr 2013 09:19:48 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+LAd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kE4gLBsEtjQ+DewOSII1FAoUTgV6DE4FT X-IPAS-Result: Av4EABK/CFHO+LAd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kE4gLBsEtjQ+DewOSII1FAoUTgV6DE4FT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="7707244" Original-Received: from 206-248-176-29.dsl.teksavvy.com (HELO pastel.home) ([206.248.176.29]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 18 Apr 2013 09:15:11 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 828F667859; Thu, 18 Apr 2013 09:15:11 -0400 (EDT) In-Reply-To: <1366255053.95181.YahooMailClassic@web141101.mail.bf1.yahoo.com> (Kelly Dean's message of "Wed, 17 Apr 2013 20:17:33 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73490 Archived-At: > Notice that the cursor type is now a bar, not a block. It should be a block. > The attached winnerbug.patch fixes it. Thanks. I installed a slightly different patch which uses higher-level functions instead. > 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. I'd never thought about it, but it does sound like a good idea. This said, I see two problems with it: - we'll probably bump into more bugs along the lines of this one (should all be fixable, but). - every once will be exposed to this change, and someone out there is bound to dislike it. So could you send a separate email about it to emacs-devel? No need to participate in the ensuing flamewar, but it's important to let people use their flamethrowers to "let it out" ;-) Stefan === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-18 06:24:10 +0000 +++ lisp/ChangeLog 2013-04-18 13:08:17 +0000 @@ -1,3 +1,10 @@ +2013-04-18 Stefan Monnier + + * winner.el (winner-active-region): Use region-active-p, activate-mark + and deactivate-mark (bug#14225). + + * simple.el (deactivate-mark): Don't inline it. + 2013-04-18 Tassilo Horn * files.el (auto-mode-alist): Delete OpenDocument and StarOffice === modified file 'lisp/simple.el' --- lisp/simple.el 2013-04-18 00:12:33 +0000 +++ lisp/simple.el 2013-04-18 13:05:44 +0000 @@ -4177,7 +4177,7 @@ (marker-position (mark-marker)) (signal 'mark-inactive nil))) -(defsubst deactivate-mark (&optional force) +(defun deactivate-mark (&optional force) "Deactivate the mark. If Transient Mark mode is disabled, this function normally does nothing; but if FORCE is non-nil, it deactivates the mark anyway. === modified file 'lisp/winner.el' --- lisp/winner.el 2013-01-01 09:11:05 +0000 +++ lisp/winner.el 2013-04-18 13:04:51 +0000 @@ -45,10 +45,8 @@ (if (featurep 'xemacs) `(if ,store (zmacs-activate-region) (zmacs-deactivate-region)) - `(setq mark-active ,store))))) - (if (boundp 'mark-active) - mark-active - (region-active-p))) + `(if ,store (activate-mark) (deactivate-mark)))))) + (region-active-p)) (defalias 'winner-edges (if (featurep 'xemacs) 'window-pixel-edges 'window-edges))