From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: XKCD/541 compliance, anyone? Date: Wed, 07 Jan 2015 23:09:25 +0100 Message-ID: <877fwyz1ii.fsf@wmi.amu.edu.pl> References: <8761drazec.fsf@wmi.amu.edu.pl> <87k318npmf.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1420668666 28145 80.91.229.3 (7 Jan 2015 22:11:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2015 22:11:06 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 07 23:11:01 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1Y8ynb-00049o-62 for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Jan 2015 23:09:55 +0100 Original-Received: from localhost ([::1]:43064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8yna-0006xH-Kp for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Jan 2015 17:09:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8ynO-0006x7-At for help-gnu-emacs@gnu.org; Wed, 07 Jan 2015 17:09:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8ynK-0006gJ-6Y for help-gnu-emacs@gnu.org; Wed, 07 Jan 2015 17:09:42 -0500 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:42839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8ynK-0006eQ-0X for help-gnu-emacs@gnu.org; Wed, 07 Jan 2015 17:09:38 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 67BDE4696A for ; Wed, 7 Jan 2015 23:09:35 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K9yzrz63T7Qs for ; Wed, 7 Jan 2015 23:09:35 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 0611046963 for ; Wed, 7 Jan 2015 23:09:34 +0100 (CET) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101929 Archived-At: On 2015-01-01, at 18:07, Stefan Monnier wrote: > Beware: syntax-propertize-function might already be in use, in which > case you should probably use add-function to combine the two. I think I'll just use the easiest solution: signal an error or warning if syntax-propertize-function is non-nil. As I wrote, in modes this is going to be useful it=E2=80=99s probably nil anyway. >> However, it did not work (in text mode); my make-smileys-punctuation >> seems not even to get called. > > Right, syntax-propertization is done lazily, so if nothing calls > syntax-propertize, then that's that. Usually the main triggers for > syntax-propertize are syntax-ppss and font-lock, but neither is likely > to be used in text-mode. So you'll probably need to arrange for font-l= ock to > be enabled *and* for font-lock-keywords-only not to be set to t. Now this question remains: how to ensure that syntax-propertize is getting called everywhere? Is (syntax-propertize (point-max)) the best idea? (In fact, probably rather something like (save-restriction (widen) (syntax-propertize (point-max))) would be better.) This way, I wouldn=E2=80=99t even have to ensure that font-lock is enabled or font-lock-keywords-only is set to nil. The reason I'm asking is that I do not want to assume that font-lock is in use; otherwise I could also e.g. call (font-lock-fontify-buffer). Curiously enough, doing M-: (syntax-ppss) RET did the trick, but only for a few lines. I guess this is because of the =E2=80=9Claziness=E2=80=9D= you mentioned. Now one problem remains. I=E2=80=99d like to mark all the smileys with a= greyed font. Are =E2=80=9Cfont lock keywords=E2=80=9D the right tool for that? = (Also, it might be interesting to use the =E2=80=9Cprettifying=E2=80=9D mode to dis= play them as Unicode smileys.) > Stefan Best, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University