From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Rankin Newsgroups: gmane.emacs.devel Subject: Re: Turning off colorization Date: Mon, 10 Nov 2014 11:41:03 +1000 Message-ID: <1415583663.933454.188964801.345E55CB@webmail.messagingengine.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1415583694 29424 80.91.229.3 (10 Nov 2014 01:41:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Nov 2014 01:41:34 +0000 (UTC) Cc: Richard Stallman , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 10 02:41:28 2014 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 1Xndyx-0002Ch-Ve for ged-emacs-devel@m.gmane.org; Mon, 10 Nov 2014 02:41:28 +0100 Original-Received: from localhost ([::1]:40583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xndyx-00071S-IG for ged-emacs-devel@m.gmane.org; Sun, 09 Nov 2014 20:41:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xndyq-00070U-HK for emacs-devel@gnu.org; Sun, 09 Nov 2014 20:41:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xndyb-0001Vb-Ie for emacs-devel@gnu.org; Sun, 09 Nov 2014 20:41:20 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xndyb-0001VI-Ak for emacs-devel@gnu.org; Sun, 09 Nov 2014 20:41:05 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id CD37E20736 for ; Sun, 9 Nov 2014 20:41:03 -0500 (EST) Original-Received: from web6 ([10.202.2.216]) by compute4.internal (MEProxy); Sun, 09 Nov 2014 20:41:03 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=tilk.co; h= message-id:x-sasl-enc:from:to:cc:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=mesmtp; bh=HpJa7uJYojf14cArc0hA9tvyvvM=; b=gJmo H52p391yo0J00tfelvdTaBUkGQFVSRQTapmp/g2gjjpY8TSFBJ4rx0+ActxhDuqj 7eADrGMXOdS28ZtxUq1I1cgObintk5vr0xODPdWKW7JsjhnXfRRGfllF4qz2ZkhQ xrtUJv6HlAZoFp3oKy0++OYKdt/fdIxrG6tRWlw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to:cc :mime-version:content-transfer-encoding:content-type:in-reply-to :references:subject:date; s=smtpout; bh=HpJa7uJYojf14cArc0hA9tvy vvM=; b=YxmfIacCO07d8CcidAN0caIbKVyvae2wjPlDQM1Ot+OUiofoUe5B1Juy hTRaEHbDpet5gShQ0MKwg4IHhshOG4WXFD1oHh3jyaJOfBnt0dGWB8ofMR+i4dLZ bsLhAs21keOrUc/awW1F1E0CMpUIdOwVZWMwj+UZGSFYtdHa8Ws= Original-Received: by web6.nyi.internal (Postfix, from userid 99) id 6E6105947D; Sun, 9 Nov 2014 20:41:03 -0500 (EST) X-Sasl-Enc: jQ+camx9oVO/+SBC64MNU91iqf8O1jScC+0rAbaVo7zU 1415583663 X-Mailer: MessagingEngine.com Webmail Interface - ajax-9183bd94 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.111.4.26 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:176656 Archived-At: On Mon, 10 Nov 2014, at 06:08 AM, Richard Stallman wrote: > > I develop a package that uses font-lock-mode extensively for > > coloured syntax highlighting but also line-prefix, wrap-prefix and > > invisible text properties. I also use font-lock-mode to manage a > > "element" text property that is integral to the mode. > > What job does the `element' property do? Does it help set up the > highlighting, or does it do some other job? > > If it does some other job, you want to have it done regardless of > whether Font Lock mode is enabled. I think font lock has a hook for > setting up such things, but I don't remember its name. The text property (called `fountain-element') helps along fontification, but it also helps along exporting to other formats, a la `htmlize'. Actually the export engine I wrote was perhaps misguidedly based on `htmlize'. The basic functionality is: 1. look at text block's `fountain-element' text property 2. check if `fountain-element' is correct 3. create exported element containing text formatted according to `fountain- element' At the time I figured the `fountain-element' text property was a great idea, but it is managed by `font-lock-mode', which is probably the wrong way to do it. I'm currently looking at the parser in `org-element.el' but it's a little overwhelming. If someone can recommend a good element parser to study I would be very grateful :) On Mon, 10 Nov 2014, at 08:03 AM, Stefan Monnier wrote: > > Am I doing something wrong in using font-lock-mode to manage these > > text properties? I tried to follow the docs to the letter. > > The way to decide is simple: font-lock-mode should be a cosmetic > choice. The user should be able to turn it off and still get the same > functionality, just with less visual effects (the user who turns off > font-lock might call it "clutter" ;-). Agreed, although my concern is more about non-coloured visual effects. The mode makes extensive use of line-prefix and wrap-prefix to display blocks of text indented according to syntax. The syntax, which I didn't create, dictates indentation must remain cosmetic and not alter the file contents (hence line-prefix and wrap- prefix a la `adaptive-wrap-mode'). So far so good. But if a regular user sees the option "colorize-mode" and disables it, he or she will be surprised/confused to see cosmetic indentation disappear also. Did no one like my idea of utilising `font-lock-maximum-decoration'? I feel like if an option called "Minimize Color" set this variable to 1 (either globally or for the current mode) and modes implemented multi- level font lock keywords where 1 truly is the absolute minimum colour, then this would be preferable. It seems like the control is already there in font-lock, just that no one really uses it? -- Paul W. Rankin http://www.paulwrankin.com