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] Run hook when variable is set Date: Fri, 30 Jan 2015 10:55:54 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422633410 32093 80.91.229.3 (30 Jan 2015 15:56:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Jan 2015 15:56:50 +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 30 16:56:50 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 1YHDw9-0008JY-FD for ged-emacs-devel@m.gmane.org; Fri, 30 Jan 2015 16:56:49 +0100 Original-Received: from localhost ([::1]:37451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHDw8-0005RE-S3 for ged-emacs-devel@m.gmane.org; Fri, 30 Jan 2015 10:56:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHDw5-0005Qw-4m for emacs-devel@gnu.org; Fri, 30 Jan 2015 10:56:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHDw0-0000oa-6S for emacs-devel@gnu.org; Fri, 30 Jan 2015 10:56:45 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:35423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHDvz-0000nj-Jj for emacs-devel@gnu.org; Fri, 30 Jan 2015 10:56:40 -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 B15C885EC2; Fri, 30 Jan 2015 10:56:21 -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 5278F1E5B8B; Fri, 30 Jan 2015 10:55:54 -0500 (EST) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 398B8B4102; Fri, 30 Jan 2015 10:55:54 -0500 (EST) In-Reply-To: (Kelly Dean's message of "Fri, 30 Jan 2015 07:34:23 +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:182065 Archived-At: > You mean something like setq-with-hook, which you can use in place of setq? > Then in general, you also need set-with-hook, setq-default-with-hook, > set-default-with-hook, setq-local-with-hook, and let-with-hook. That > seems cumbersome. Yes, you can make it cumbersome if you want. Or you can drop the let-with-hook since it would be a misfeature anyway, and then consolidate the remaining 4 into a single function. You'd probably want a second function which does the "read value with hook", OTOH. > In summary: > cursor-type can be changed buffer-locally, which doesn't affect other > buffers or the global setting. Therefore dynamic-cursor-mode must be > disabled in the same buffer, but not in other buffers or globally. The code I provided disables the effect of dynamic-cursor-mode as soon as the value of cursor-type is not the expected one (without needing to disable dynamic-cursor-mode). So AFAICT the problem doesn't exist. Stefan