From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 188f657: Fix false negatives in tex--prettify-symbols-compose-p. Date: Sat, 26 Sep 2015 07:36:09 +0200 Message-ID: <87612xlp2u.fsf@gnu.org> References: <20150925210512.18505.12538@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1443245794 26327 80.91.229.3 (26 Sep 2015 05:36:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Sep 2015 05:36:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 26 07:36:24 2015 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 1Zfi9l-0005jR-An for ged-emacs-devel@m.gmane.org; Sat, 26 Sep 2015 07:36:21 +0200 Original-Received: from localhost ([::1]:52009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zfi9k-0003Ob-D6 for ged-emacs-devel@m.gmane.org; Sat, 26 Sep 2015 01:36:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zfi9g-0003OF-Kx for emacs-devel@gnu.org; Sat, 26 Sep 2015 01:36:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zfi9d-0003PK-Ed for emacs-devel@gnu.org; Sat, 26 Sep 2015 01:36:16 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:55069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zfi9d-0003PB-Ay for emacs-devel@gnu.org; Sat, 26 Sep 2015 01:36:13 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id F2998201D5 for ; Sat, 26 Sep 2015 01:36:12 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 26 Sep 2015 01:36:12 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=MFNfUxlIbdu58rAlbY/lXkZ+2FE=; b=A7rGl sNS/A7/JRaJQafglGxsQOk5EkSQmfRQJslfVX7pPF4g1J9TU++PxOm+dyyOQHBRf FhpaF/gb2Lzmt+aQ/yPnmP1SRRCCiySMM7HYfRsNJIzNqBg1x35C2JQwwUEFES8M 6xGZU+hPWRIcNy4HbBgIgC1aoiJ/SYlJ3T9GxA= X-Sasl-enc: vm3JcUiNxwrVLpQiBg6URJYhO2CCyHGO7QOXEBJdpexA 1443245772 Original-Received: from thinkpad-t440p (unknown [2.160.28.79]) by mail.messagingengine.com (Postfix) with ESMTPA id 29A5FC00013; Sat, 26 Sep 2015 01:36:12 -0400 (EDT) Mail-Followup-To: Stefan Monnier , emacs-devel@gnu.org In-Reply-To: (Stefan Monnier's message of "Sat, 26 Sep 2015 00:54:49 -0400") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.27 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:190352 Archived-At: Stefan Monnier writes: >> - ;; Don't compose inside verbatim blocks! >> - (nth 8 (syntax-ppss)) > [...] >> + ;; Don't compose inside verbatim blocks. >> + (let* ((face (get-text-property end 'face)) >> + (faces (if (consp face) face (list face)))) >> + (or (memq 'tex-verbatim faces) >> + (memq 'font-latex-verbatim-face faces))))))) > > Rather than check the `face' property, I think it'd be more robust to > use the (syntax-ppss) data. Since tex-env-mark uses "< c" for the > syntax of \begin{verbatim}, A test like > > (eq 2 (nth 7 (syntax-ppss))) > > should do the trick. > > Stefan "at least for the non-font-latex case" Yes, but only for the non-font-latex case. With font-latex, using the 8th ppss data will omit prettification in $...$ because those are treated as strings at fontification time, and it also doesn't give comment syntax to verbatim stuff. But if you prefer, I can use your check in `tex--prettify-symbols-compose-p' and have a font-latex-specific `prettify-symbols-compose-predicate' in AUCTeX which would go like (and (tex--prettify-symbols-compose-p start end match) (not (let ((face (get-text-property end 'face))) (if (consp face) (memq 'font-latex-verbatim-face face) (eq face 'font-latex-verbatim-face)))) Bye, Tassilo