From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] font-core: add font-lock-{enable, disable}-global-for functions Date: Mon, 05 Jan 2015 01:07:30 +0300 Message-ID: <54A9B9A2.2020301@yandex.ru> References: <1420300300-29754-1-git-send-email-mpn@google.com> <54A94BA7.8000705@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1420409297 14794 80.91.229.3 (4 Jan 2015 22:08:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Jan 2015 22:08:17 +0000 (UTC) Cc: Michal Nazarewicz , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 04 23:08:10 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 1Y7tLD-0000yN-9t for ged-emacs-devel@m.gmane.org; Sun, 04 Jan 2015 23:08:07 +0100 Original-Received: from localhost ([::1]:58266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7tLC-0004LS-Mj for ged-emacs-devel@m.gmane.org; Sun, 04 Jan 2015 17:08:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7tKu-0004LM-KT for emacs-devel@gnu.org; Sun, 04 Jan 2015 17:07:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7tKr-0004Ou-7z for emacs-devel@gnu.org; Sun, 04 Jan 2015 17:07:48 -0500 Original-Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]:41373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7tKr-0004Oh-0c for emacs-devel@gnu.org; Sun, 04 Jan 2015 17:07:45 -0500 Original-Received: by mail-lb0-f172.google.com with SMTP id z12so9135363lbi.17 for ; Sun, 04 Jan 2015 14:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=DEkaXbpk/YmptLrditkZ5rVhhRiHBoDluiNMZMbtafQ=; b=JWo61q18Gyp/pkFJDjs9+E4Ss3dm15Gkf9bR4BfU5Oe/NlXGmBLBlZCU20zr4yngwF BQ1ICNnlRB3BUtEnFc50rw66i3GykSVK3Kl9Sok791xRYYvQjBV/A2gkWXGUapoAP5nX oypXvJJyhLfjVa5jMuj+tXKBviNeRkm46MOePfB1eHHHriUogGGw677u2D90bCc302Ot UYl81ds/CtfqGs1gc574f+2Pbzx8Cs4U6p5OUFSJ/YfDtvaojrbPGzLQkLCfsYi7hSmB Xh32rxo9nxiUPce1kFP9auoX0/SmJcPO3+Woy4GFPciyy18okXMkcks96F2swo4Nmewl Qnvw== X-Received: by 10.112.200.103 with SMTP id jr7mr3175983lbc.0.1420409263624; Sun, 04 Jan 2015 14:07:43 -0800 (PST) Original-Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id r3sm14245394lal.37.2015.01.04.14.07.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jan 2015 14:07:43 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Thunderbird/33.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22c 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:180982 Archived-At: On 01/04/2015 10:42 PM, Stefan Monnier wrote: > But the redundancy is rather problematic As long as one is for `customize-variable' and the other for elisp, I think it's good enough. > not to mention the fact that > the semantics is unclear (e.g. how does it interact with derived modes? > How does it interact with explicit calls in the mode hook? ...). Right, these two aspects are not 100% transparent to a common user. Improving on either would be hard, though, if we want the derived modes sometimes to be affected (if we don't, that can just be documented). > Maybe we should provide something like M-x customize-minor-mode-states RET > which would collect the presence/absence of `foo-mode' or `(lambda () > (foo-mode N))' in all the hooks and let the user add/remove them from > those hooks. That might be handy. But that wouldn't solve the "derived modes problem" any better than a docstring would (if it would, how?). And scanning hooks for enabled/disabled modes would be necessarily imprecise: even if we take care of the three main variations (`foo-mode', (lambda () (foo-mode 1)), (lambda () (foo-mode -1))), that still leaves out random functions (lambdas or named) that include a `foo-mode' call among other code, that a more advanced user could have in their init file, or some yet-another package might include in their "initialize me" function. If a function has been compiled, can we even scan its body for `foo-mode' calls?