From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: how is emacs lisp syntax colored in emacs-lisp-mode? Date: Tue, 17 Mar 2009 02:53:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1237302034 27106 80.91.229.12 (17 Mar 2009 15:00:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Mar 2009 15:00:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 17 16:01:51 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LjanZ-0005ht-P9 for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Mar 2009 16:01:46 +0100 Original-Received: from localhost ([127.0.0.1]:51832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LjamD-0000ur-HI for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Mar 2009 11:00:21 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v1g2000prd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 57 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1237283598 5699 127.0.0.1 (17 Mar 2009 09:53:18 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 17 Mar 2009 09:53:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v1g2000prd.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:167713 X-Mailman-Approved-At: Tue, 17 Mar 2009 11:00:03 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63011 Archived-At: On Mar 17, 1:41 am, Nikolaj Schumacher wrote: > Xah Lee wrote: > > On Mar 10, 1:06 pm, Nikolaj Schumacher wrote: > > >> If you want to highlight symbols that are "shipped" with Emacs (to > >> whatever extend) you'll need to add a matcher function to the font loc= k > >> keywords that checks whether, and in which files, symbols have been de= fined > > > doesn't anyone see this as a defect? namely, the fact that only parts > > of keywords are syntax colored in emacs-lisp-mode. This behavior is > > contrary to all other major modes. > > What do you mean? > If I write printf in C-mode, it isn't colored, either. > > printf isn't a keyword, it's a library function, just as "message" > is in elisp. Why is it interesting to highlight functions that shipped > with Emacs, say erc-.*? > > You use the word "keyword" as in font-lock-keywords, but please not that > the name has additional meanings. In C, reserved words are named > keywords, in Emacs Lisp they are things like :foo and :bar. To avoid > confusion, maybe you should call them symbols. I think there are 2 basic issues that indicates its' a problem. A: it seems to be it is not clear, or consist, the way emacs color some of the lisp symbols but not others. B: emacs-lisp-mode does not support font-lock-maximum-decoration for progressive levels of font coloring. On this elisp manual page: =E2=80=A2 What Is a Function - GNU Emacs Lisp Reference Manual http://xahlee.org/elisp/What-Is-a-Function.html it lists: function, primitive, lambda expression, special form, macro, command, and others. the way emacs-lisp-mode color'd symbols, doesn't seem to me to be a particular class of the above. it appears to me, the way it chooses symbol to color, is not based on some strict technicality, but rather chosen for functions that are likely to open a significant block of code. e.g. let, lambda, if, when, while, progn, cond, condition-case, save-excursion, with- current-buffer. Note that it also colors with-selected-window, with- output-to-temp-buffer, with-selected-window, unless. Note that it doesn't color for example: eq, or, setq, cons. Xah =E2=88=91 http://xahlee.org/ =E2=98=84