From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Re: Proposal to change cursor appearance to indicate region activation Date: Thu, 22 Jan 2015 09:25:09 -0500 Message-ID: References: <1366426478.1624.YahooMailClassic@web141106.mail.bf1.yahoo.com> <78667428-5c03-402b-8d42-5342079d9bfd@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421936744 14715 80.91.229.3 (22 Jan 2015 14:25:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2015 14:25:44 +0000 (UTC) Cc: Drew Adams , emacs-devel@gnu.org To: Kelly Dean Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 22 15:25:36 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YEIhU-0004sn-Gl for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 15:25:36 +0100 Original-Received: from localhost ([::1]:53501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEIhT-0002wH-QH for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 09:25:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEIh9-0002uP-Rm for emacs-devel@gnu.org; Thu, 22 Jan 2015 09:25:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEIh4-00012v-OW for emacs-devel@gnu.org; Thu, 22 Jan 2015 09:25:15 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:53834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEIh4-00012p-Kz for emacs-devel@gnu.org; Thu, 22 Jan 2015 09:25:10 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4PAOwQflSnWBWM/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBBFYjEAs0EhQYDSSIU9ZZAQEBAQEFAQEBAR6QbweESAWLAZIxjHSHAYI3gWIhgncBAQE X-IPAS-Result: Aj4PAOwQflSnWBWM/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBBFYjEAs0EhQYDSSIU9ZZAQEBAQEFAQEBAR6QbweESAWLAZIxjHSHAYI3gWIhgncBAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="108466812" Original-Received: from 167-88-21-140.cpe.teksavvy.com (HELO pastel.home) ([167.88.21.140]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jan 2015 09:25:09 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 7FB642A58; Thu, 22 Jan 2015 09:25:09 -0500 (EST) In-Reply-To: (Kelly Dean's message of "Thu, 22 Jan 2015 05:38:34 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181601 Archived-At: > +(defcustom dynamic-cursor-mode 't > + "If non-nil, `cursor-type' is set dynamically to reflect `mark-active'." > + :type 'boolean > + :version "25.1" > + :group 'editing-basics) I'd rather see a `define-minor-mode' here, especially since you already chose a "...-mode" name. Nitpick: no need to quote t. > @@ -4430,6 +4436,7 @@ > ((eq transient-mark-mode 'lambda) > (setq transient-mark-mode nil))) > (setq mark-active nil) > + (if dynamic-cursor-mode (setq cursor-type 't)) > (run-hooks 'deactivate-mark-hook) > (redisplay--update-region-highlight (selected-window)))) > > @@ -4445,3 +4452,4 @@ > + (if dynamic-cursor-mode (setq cursor-type 'bar)) > (run-hooks 'activate-mark-hook)))) > > (defun set-mark (pos) But if the user has set cursor-type in his .emacs, we'll now overwrite his choice. So we can't enable this code by default. Two options: - keep the default as nil. - change the code to only modify the cursor-type if it hasn't been changed. Stefan