From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fabian Ezequiel Gallina Newsgroups: gmane.emacs.devel Subject: Re: adding a standard font-lock-number-face Date: Fri, 17 Jun 2011 00:54:55 -0300 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1308282916 29866 80.91.229.12 (17 Jun 2011 03:55:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2011 03:55:16 +0000 (UTC) Cc: Emacs-Devel devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 17 05:55:12 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QXQ9H-0003Fm-F7 for ged-emacs-devel@m.gmane.org; Fri, 17 Jun 2011 05:55:11 +0200 Original-Received: from localhost ([::1]:36006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXQ9G-0007pU-Mc for ged-emacs-devel@m.gmane.org; Thu, 16 Jun 2011 23:55:10 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXQ93-0007pN-Pi for emacs-devel@gnu.org; Thu, 16 Jun 2011 23:54:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXQ92-0000UU-OO for emacs-devel@gnu.org; Thu, 16 Jun 2011 23:54:57 -0400 Original-Received: from mail-pz0-f41.google.com ([209.85.210.41]:43844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXQ92-0000UN-DK for emacs-devel@gnu.org; Thu, 16 Jun 2011 23:54:56 -0400 Original-Received: by pzk4 with SMTP id 4so1831974pzk.0 for ; Thu, 16 Jun 2011 20:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7IjK35IrDb5K9xe+j3BFphJFWvlkGAtpLcWk/x/u4pw=; b=TRtuTLhj5giXuD3heKrewkP5serY6/HmUDHleqScp/8FPZEByWa+OFu4nMxI/cNYOn gDd1FJA60DwEYN69WxQioQ+XfehxBMu8dmQMFl5ok9Nh219k8PGcE2S5SLYkRTJZ2yH0 jo7WqbQfulZIsOtWwrxrE75PnDpBDhrlQUvrk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=hUHiXBrUFQ+IYM0PwMfMTG8sojUxU8SEi8Malnbg/I9EvfBcSlfYOocke/vRdOAmxv LBxiIHa62gLQRmqecuSClOlSK1U2o0FJh8/hCueWlVDkIEy7YDxeX0+qr2NbKkosdUQQ tak/pKy5D9cyMPLS4HkoYc7iqip/dxtkBV40I= Original-Received: by 10.68.6.232 with SMTP id e8mr882754pba.343.1308282895185; Thu, 16 Jun 2011 20:54:55 -0700 (PDT) Original-Received: by 10.68.41.98 with HTTP; Thu, 16 Jun 2011 20:54:55 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.41 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:140584 Archived-At: 2011/6/17 Stefan Monnier : >> So long story short: isn't a good idea to add a standard >> font-lock-number-face in order to have fine grained control on >> font-lock and give the users the chance to customize numbers >> decoration out of the box? > > I don't think highlighting tokens that are only lexically relevant but > not syntactically relevant is a good idea. > E.g. it's good to highlight keywords because they determine structure. > It's good to highlight strings and comments because keywords within them > *don't* determine structure. > It's good to highlight identifier definitions because these are > semantically important and they tend to be a bit like section titles, so > syntactically meaningful. > > But it's not useful to highlight all identifiers, or all numbers, or all > separators, or all infix operators, ... because that doesn't help the > user navigate his code. > Thanks for the clarification Stefan, I was pretty sure there was a good reason why it wasn't there already. An argument I can think of for inclusion is that it seems highlighting those kind of stuff (event operators) is really common on other editors, so it is acceptable that people coming from other places would expect this kind of stuff highlighted out-of-the-box. I know the "people coming from other editors" argument is kinda weak, but I don't see why not giving them the chance to enable that easily in a vanilla Emacs. Please note that I'm no expert at font-locking but I think it might be good (and possible) to let modes to specify a higher or special level of font-locking so this kind of things can be highlighted. Let the default be the standard Emacs way, but giving the users the chance to enable that special level easily. This way standard font-lock performance shouldn't be hit. What do you think? Regards, --=20 Fabi=E1n E. Gallina