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] Proposal to change cursor appearance to indicate region activation Date: Fri, 23 Jan 2015 15:34:43 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1422045333 17051 80.91.229.3 (23 Jan 2015 20:35:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2015 20:35:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kelly Dean Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 23 21:35:33 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 1YEkx2-0008QQ-OU for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2015 21:35:32 +0100 Original-Received: from localhost ([::1]:33010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEkx2-0000Qk-7C for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2015 15:35:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEkwm-0000Qf-U7 for emacs-devel@gnu.org; Fri, 23 Jan 2015 15:35:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEkwh-0001Gg-F0 for emacs-devel@gnu.org; Fri, 23 Jan 2015 15:35:16 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:48605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEkwh-0001DO-9P for emacs-devel@gnu.org; Fri, 23 Jan 2015 15:35:11 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id D027F85E7C; Fri, 23 Jan 2015 15:35:10 -0500 (EST) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 8A9E71E5B8B; Fri, 23 Jan 2015 15:34:43 -0500 (EST) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 6E588B4102; Fri, 23 Jan 2015 15:34:43 -0500 (EST) In-Reply-To: (Kelly Dean's message of "Fri, 23 Jan 2015 11:07:38 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:181694 Archived-At: >>> + (if dynamic-cursor-mode (setq cursor-type 'bar)) >> (if (and dynamic-cursor-mode (eq cursor-type t)) >> (setq cursor-type 'bar dynamic-cursor-mode--set t)) > That's even uglier! ;-) You still have a global minor mode (and its > variable), and a separately-named buffer-local variable, so it's no > simpler. It's a lot simpler because the buffer-local var is internal. > (setq-default cursor-type 'bar) > A few days later in the same Emacs session... > (dynamic-cursor-mode) No, because dynamic-cursor-mode can do (setq-default cursor-type t). That's one of the advantages of a minor mode over a plain defcustom. >> So you don't need a buffer-local activation of dynamic-cursor-mode. > If (global) dynamic-cursor-mode is enabled, your code provides no way > to prevent it from operating in a buffer in which cursor-type happens > to be t. Of course it does: (add-hook 'foo-mode-hook (lambda () (setq-local dynamic-cursor-mode nil)= )) > Modifying the =ABset=BB family of functions to provide triggers would be = the > ideal solution, as I described in my previous message. The difference between a boolean defcustom and a global minor-mode is pretty much that the global minor mode offers the "set triggers". Stefan