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: Thu, 22 Jan 2015 23:55:44 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421988967 8369 80.91.229.3 (23 Jan 2015 04:56:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2015 04:56:07 +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 05:56:01 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 1YEWHp-0008Ve-EI for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2015 05:56:01 +0100 Original-Received: from localhost ([::1]:57073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEWHp-0007uU-0P for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 23:56:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEWHc-0007uP-QC for emacs-devel@gnu.org; Thu, 22 Jan 2015 23:55:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEWHZ-0000nf-Jo for emacs-devel@gnu.org; Thu, 22 Jan 2015 23:55:48 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:12234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEWHZ-0000nb-GT for emacs-devel@gnu.org; Thu, 22 Jan 2015 23:55:45 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjsPAOwQflSnWBWM/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQRWIxALNBIUGA0kiFPWWQEBAQEGAQEBAR6QbweESAWLAaYmhBkhgTQkgR8BAQE X-IPAS-Result: AjsPAOwQflSnWBWM/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQRWIxALNBIUGA0kiFPWWQEBAQEGAQEBAR6QbweESAWLAaYmhBkhgTQkgR8BAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="108522934" Original-Received: from 167-88-21-140.cpe.teksavvy.com (HELO ceviche.home) ([167.88.21.140]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jan 2015 23:55:44 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 6124666100; Thu, 22 Jan 2015 23:55:44 -0500 (EST) In-Reply-To: (Kelly Dean's message of "Fri, 23 Jan 2015 03:08:33 +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:181651 Archived-At: > +(defun maybe-disable--dynamic-cursor () > + (unless (eq (default-value 'cursor-type) > + (eval (car (get 'cursor-type 'standard-value)))) > + (global-dynamic-cursor-mode 0))) Hmm... that's rather ugly. I was thinking of rather doing something like: (defvar-local dynamic-cursor-mode--set nil "If non-nil, we've temporarily modified the cursor.") > + (if dynamic-cursor-mode (setq cursor-type t)) (when dynamic-cursor-mode (if (and dynamic-cursor-mode--set (eq cursor-type 'bar)) (setq cursor-type t)) (setq dynamic-cursor-mode--set nil)) and > + (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)) So you don't need a buffer-local activation of dynamic-cursor-mode. Stefan