From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Mauger Newsgroups: gmane.emacs.devel Subject: Re: Need help fixing comint fontification for python. Date: Mon, 8 Oct 2012 12:05:43 -0700 (PDT) Message-ID: <1349723143.33123.YahooMailNeo@web160905.mail.bf1.yahoo.com> Reply-To: Michael Mauger NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1349723151 16411 80.91.229.3 (8 Oct 2012 19:05:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Oct 2012 19:05:51 +0000 (UTC) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 08 21:05:57 2012 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 1TLIeL-0002WY-DF for ged-emacs-devel@m.gmane.org; Mon, 08 Oct 2012 21:05:57 +0200 Original-Received: from localhost ([::1]:41048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLIeF-0005cU-Ad for ged-emacs-devel@m.gmane.org; Mon, 08 Oct 2012 15:05:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLIeD-0005cJ-0o for emacs-devel@gnu.org; Mon, 08 Oct 2012 15:05:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLIeA-0005o3-CL for emacs-devel@gnu.org; Mon, 08 Oct 2012 15:05:48 -0400 Original-Received: from nm11.bullet.mail.bf1.yahoo.com ([98.139.212.170]:25846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLIeA-0005lm-2t for emacs-devel@gnu.org; Mon, 08 Oct 2012 15:05:46 -0400 Original-Received: from [98.139.215.140] by nm11.bullet.mail.bf1.yahoo.com with NNFMP; 08 Oct 2012 19:05:44 -0000 Original-Received: from [98.139.212.200] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 08 Oct 2012 19:05:44 -0000 Original-Received: from [127.0.0.1] by omp1009.mail.bf1.yahoo.com with NNFMP; 08 Oct 2012 19:05:44 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 103597.87087.bm@omp1009.mail.bf1.yahoo.com Original-Received: (qmail 47614 invoked by uid 60001); 8 Oct 2012 19:05:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1349723144; bh=IhnjdPbcPsMzSVW2eTGP/XtrtZrDUAYEKJEt87flnpM=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=OGujxpCiHTkKh96vEiBmreED6Y0y6gyObk44clF2F/NYFVYsbtou7O0OmQaW6EaMsp6X4WTXe4u5xWCYMAzycoJ6pth5VxXKYzXCZi19wd5PnliDpRqJ4os0lVNAEHaVTRA4Og+TES0EgcztfzC5Qrp5WDTVB1yFVIJpGEMAR8c= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=v7JIgF12EEJg8/ZVDS6OSdOczh4uEd7R4CHbTs4+HWu77MGXhj5AroNnPBj4O32y/P3owwvQUUU5ShMl7QNMiv4mvB/GevK8X7d0WsscHaLeDdWZQZZgM9OBC8E6j0C4js3s/tyBJ3qqZ5gZLwZb/IT/5D9Cd5ReOIm+7x6mV5Y=; X-YMail-OSG: C1R68oIVM1lf6q4_ZeRvbPWiKnYpnVDJ738LJVYJDMMxZLK 8HrcAiFNGpVzAwj0fee16dEMRz5UUvNqT6z2m6ca3VWMctvwskwzwLbt1TOa vDYdFvX9Br0pNrMPhpPlAVa27MzzlS81qCRQHv_GRvt4FwAmNrHck8fsho3i darKxO872XAhYlKnb8dIFcqQ1FErD3ZsyFg9Bm1SGPBjh68igvrmjgKDAwH0 2vriIw7ae6xRaCIa2y62g4Q0BQl20QjSvzFowjHwAcZiLPTjqiE5lMvIMkCG ytElC2fhqEznYZ2Z6cEQ5UPsOL0yzUEy1enE6jUGU7fXiBoLMm.nPkVa0B5W _ug_fb_Sg9a4JfpPplabppOwGIifiunFW5qlY61my8qfC2dRPIvgiiKOuXgL ypnEgccje9R28AUjf5mEE_XO8QvoiSfubT10.17yZKitmLiV5E_N7adfIJvM Yx1km6XyEr648HPLtR997z1sVEMoKVuzyNHU- Original-Received: from [98.216.52.54] by web160905.mail.bf1.yahoo.com via HTTP; Mon, 08 Oct 2012 12:05:43 PDT X-Rocket-MIMEInfo: 001.001, T24gU3VuLCAwNyBPY3QgMjAxMiAxMDozNzoyOCAtMDQwMCwgU3RlZmFuIE1vbm5pZXIgc2FpZDogID4gPiBXaGF0IHdvdWxkIGJlIHRoZSBiZXN0IHdheSByZW1vdmUgdGhlIHN5bnRheCBjbGFzcyBmb3IgYWxsIHRoZSBvdXRwdXQ_Cj4gCj4gVXNlIGEgc3ludGF4LXByb3BlcnRpemUtZnVuY3Rpb24uCj4gCj4gTG9vayBhdCB0aGUgYGZpZWxkJyBwcm9wZXJ0eSBhbmQgd2hlcmV2ZXIgaXRzIHZhbHVlIGlzIGBvdXRwdXQnLCBwbGFjZQo.IGFuIGFwcHJvcHJpYXRlIHN5bnRheC10YWJsZSBwcm9wZXJ0eS4KPiABMAEBAQE- X-Mailer: YahooMailWebService/0.8.123.450 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 98.139.212.170 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:154243 Archived-At: On Sun, 07 Oct 2012 10:37:28 -0400, Stefan Monnier said: > > What would be= the best way remove the syntax class for all the output?=0A> =0A> Use a sy= ntax-propertize-function.=0A> =0A> Look at the `field' property and whereve= r its value is `output', place=0A> an appropriate syntax-table property.=0A= > Or alternatively, use a "safe" syntax-table in the buffer, but add=0A> Py= thon's syntax-table as a property whereas the `field' property is nil.=0A> = =0A> =0A> Stefan I've tried this and it doesn't appear that the fie= ld text property has=0Abeen applied to the output text when the syntax-prop= ertize-function=0Afires. Once the display is complete, the field property i= s present but=0Ain the hook function it isn't present. Am I missing someth= ing? At the start of the syntax-propertize-function on the START location: = ------------------------------------------------------------------------ po= sition: 12182 of 13643 (89%), column: 4 character: [ (displayed as [) (code= point 91, #o133, #x5b) preferred charset: iso-8859-1 (Latin-1 (ISO/IEC 8859= -1))=0Acode point in charset: 0x5B syntax: (]=09which means: open, matches = ] category: .:Base, a:ASCII, l:Latin, r:Roman to input: type "C-x 8 RET HEX= -CODEPOINT" or "C-x 8 RET NAME" buffer code: #x5B file code: #x5B (encoded = by coding system iso-latin-1-unix) display: by this font (glyph code) xft:-= unknown-DejaVu Sans Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1 (#x= 3E) Character code properties: customize what to show name: LEFT SQUARE BRA= CKET old-name: OPENING SQUARE BRACKET general-category: Ps (Punctuation, Op= en) decomposition: (91) ('[') There is an overlay here: From 12182 to 12182= face hl-line window #= There are text properties here: charset iso-8859-1 fontified = nil ------------------------------------------------------------= ------------ At the same location, in the comint buffer -------------------= ----------------------------------------------------- position: 12182 of 13643 (89%), column: 0 character: [ (displayed as [) (codepoint 91, #o133,= #x5b) preferred charset: iso-8859-1 (Latin-1 (ISO/IEC 8859-1))=0Acode poin= t in charset: 0x5B syntax: (]=09which means: open, matches ] category: .:Ba= se, a:ASCII, l:Latin, r:Roman to input: type "C-x 8 RET HEX-CODEPOINT" or "= C-x 8 RET NAME" buffer code: #x5B file code: #x5B (encoded by coding system= iso-latin-1-unix) display: by this font (glyph code) xft:-unknown-DejaVu S= ans Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1 (#x3E) Character co= de properties: customize what to show name: LEFT SQUARE BRACKET old-name: O= PENING SQUARE BRACKET general-category: Ps (Punctuation, Open) decompositio= n: (91) ('[') There is an overlay here: From 12182 to 12183 face = show-paren-match priority 1000 There are text properties = here: charset iso-8859-1 field output fontified= t front-sticky (field inhibit-line-move-field-capture) = inhibit-line-move-field-capture t rear-nonsticky t [back] -----------= -------------------------------------------------------------=0AHere's what= I did:=0A=0A=A0 (defun my-comint-output-propertize (start end)=0A=A0 =A0 (= let (output-start output-end)=0A=A0 =A0 =A0 (while (< start end)=0A=A0 =A0 = =A0 =A0 (describe-char start)=0A=A0 =A0 =A0 =A0 (setq output-start (text-pr= operty-any start end 'field 'output))=0A=A0 =A0 =A0 =A0 (if output-start = =A0 =A0;; <-- Never satisfied=0A=A0 =A0 =A0 =A0 =A0 =A0 (progn=A0=0A=A0 =A0= =A0 =A0 =A0 =A0 =A0 (setq output-end=A0=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (min=A0=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(next-single-c= har-property-change output-start 'field nil end)=0A=A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0(next-single-char-property-change output-start 'font-loc= k-face nil end)))=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 (unless (eq (get-char-prope= rty output-start 'font-lock-face)=A0=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 'comint-highlight-prompt)=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= (put-text-property output-start output-end 'font-lock-face 'italic))=0A=A0= =A0 =A0 =A0 =A0 =A0 =A0 (setq start output-end))=0A=A0 =A0 =A0 =A0 =A0 (se= tq start end)))))=0A=0A=A0 (add-hook 'comint-mode-hook=A0=0A=A0 =A0 =A0 =A0= =A0 =A0 (lambda () (setq syntax-propertize-function 'my-comint-output-prop= ertize)))=0A=0A=0AThe output above is from the `describe-char' call; the=0A= `text-property-any' call is never detecting the `field' property being=0Ase= t to `output'. =A0The second output is from me positioning the caret and=0A= hitting C-u C-x =3D.=0A=0AObviously, dope slap me if appropriate, I can't l= earn=0Aotherwise. Be gentle.=A0=0A=0A-- Michael