From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]) Date: Wed, 9 Mar 2016 12:06:57 -0500 Message-ID: <56E05831.9070900@gmail.com> References: <20160308132530.861.91488@vcs.savannah.gnu.org> <20160308183010.GB6269@acm.fritz.box> <20160308200753.GC6269@acm.fritz.box> <20160309104900.GA3948@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="75c6STi15IkoU7tMBoe5M7BmRNwejnKM6" X-Trace: ger.gmane.org 1457543281 26413 80.91.229.3 (9 Mar 2016 17:08:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2016 17:08:01 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 09 18:07:45 2016 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 1adha8-0007PH-N1 for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2016 18:07:32 +0100 Original-Received: from localhost ([::1]:42828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adha7-0006Mf-NF for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2016 12:07:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adhZe-0006Iz-Vh for emacs-devel@gnu.org; Wed, 09 Mar 2016 12:07:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adhZb-00075P-PE for emacs-devel@gnu.org; Wed, 09 Mar 2016 12:07:02 -0500 Original-Received: from mout.kundenserver.de ([217.72.192.74]:61688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adhZb-00074w-Gd for emacs-devel@gnu.org; Wed, 09 Mar 2016 12:06:59 -0500 Original-Received: from [18.26.2.123] ([18.26.2.123]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0Lh6r1-1a2Bwz0p3n-00oVaz for ; Wed, 09 Mar 2016 18:06:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <20160309104900.GA3948@acm.fritz.box> X-Provags-ID: V03:K0:/BbiZbVy6kEcdVzin9ftLWKLUYcawyyvXyq684/49H9HDBeRXmS yBZzCuQF8NTRxAgqTOhaDeXhtxKpm+C+3+SggHp4AyEix4TbqTynHmViysxJgXLOykgVYfp 69Dj2d4DITURw2ryDqzzTSgha245938AmaOs0p+dwOLwLw+PB/8nzhlXHgPA7lG11sHr6sW tE+SlKtTUdKdA9fJmDHiA== X-UI-Out-Filterresults: notjunk:1;V01:K0:iBJ35BZ0rfU=:eleDbS+rzSY6DDF1Z/xShu 3WaJYVPduRVNfxBkwU6iORo66brxBcRN65S0gn2tXZUU5CdOcDRDQBP0+PZ00elnnH4hwCnK3 IU0sEpLyvMvdonaipTNK7WpVBk1LYiJ7vtmfu6aDpHZBvAS2L2APymVXVavuD4GZXSmcJfPHR JEjdNwJcnsnS9VAUFKO0irMu38cpdEmIcgXdvll99xM2Z3/SI/4D3Gj32OMzrr3iGFC4+WKP7 JN2UfWpwTn5DAOHrK8XSm832PFBQzoi/oH8gsef6Lb1jZV8dwJUjY2OWwJ8adq1SeihITvH7I HWcHOJvDH2HY12ZzLItBDYJpD5Lf2MH/wegvl6/L3mgFkWTI0E7Cpvk0O6I9vu7F/ezbbaylC jxp23vVxugWuDOa4Y9NnGvvTW1QgtUFWbzktztz1xe6Ofo/QdhcEGZrdHJipaZ6opUtSyzC6U cqd2ys+jZHS9JDKfjiYZekdq+5MkvsJoVx3g5ymCZxgxUOvdiMcZaoKOGE8hOvt+ZGRWzH0+S sg6a0P/Un5ODnfyp8l/iIs577z4cbFoXLoV7N2ZloH7jX7FwOyervnvEpd1vaI2GJNC9Typni grGdBQdodnL8elRhUmfr3qWk6m4rVOPUMCBSc6geKTVm3d9WDcsklU0GjuhvmolCCoqAZT2bO Ke0dYlMetyr1jCKhonMzhvf9812Hc0Y42Pu5Melg5zUahNdk4OjfWi6VeazEhNVi2mLA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.74 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:201257 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --75c6STi15IkoU7tMBoe5M7BmRNwejnKM6 Content-Type: multipart/mixed; boundary="1cqwr9cRPDltbUAs52R7q8dajwLsihApv" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: emacs-devel@gnu.org Message-ID: <56E05831.9070900@gmail.com> Subject: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]) References: <20160308132530.861.91488@vcs.savannah.gnu.org> <20160308183010.GB6269@acm.fritz.box> <20160308200753.GC6269@acm.fritz.box> <20160309104900.GA3948@acm.fritz.box> In-Reply-To: <20160309104900.GA3948@acm.fritz.box> --1cqwr9cRPDltbUAs52R7q8dajwLsihApv Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 03/09/2016 05:49 AM, Alan Mackenzie wrote: > (ii) No account is taken of possibly starting a parse-partial-sexp from= > after the first character of a two character comment starter or ender= =2E > OK, this is really a problem with the parser state not recording this= > situation (which we could correct), but failing that, syntax-ppss > should check for this. We did talk about this (in connection with a > CC Mode bug) a few years ago. I keep running into this, actually. There are plenty of examples out ther= e of people checking whether the face at point is font-lock-comment-face = or font-lock-string-face or font-lock-doc-face to know whether the curren= t point is in a comment or string. Using (nth 8 (syntax-ppss)) instead mo= stly works, except that it's nil in comment openers (e.g. in ;; in ELisp)= and closers. Am I missing something? Cl=E9ment. --1cqwr9cRPDltbUAs52R7q8dajwLsihApv-- --75c6STi15IkoU7tMBoe5M7BmRNwejnKM6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJW4FgxAAoJEPqg+cTm90wjG6IP/R3Xevt5OySHNbghnRsbyT3b mWB7sgqYdwtGes+jWDWllCt/XxKTWXORKN+hqjPYA23VsaInA1t6IjJoVQ5mp5ps Qq/Y47dmmlSfaQxdr84D8fq7kIXTU/m2BIWqMprbJjzFkEzAgdaMmDS341MWNdoE Hm7CbwsfEfjZCSdHSMgW/nXeJYbM53QYeSQQ/KOf1LKOCf06aZvGgq47r6GUdE0O W40E/N+Sx/x2aLv4RqLfo2DFAPwISiYE6dymLel3Opp+0CjAePR+u5JvDF3YRbLG gk/y1j2Xi//bU02b0Mm8OAkTI7/x+pHgA41ZsNYdlgc9Jvd/+5DH//7P1oLkwQMk Bg1FA/pCPr+yeobDel0ymkjNg8i5v9OokEzykOO+F2FKs2KqnxcMZeRVZpFWhptz d3kLQsjlLp2HYhVJz8NuP51JMGFTY44zbzaTsw7QBwAXnjP6ddH755i/nEvNVhZJ 9DlQxtKVTG4aeYRxzreF1LmvcBKFb5re5OYQ1NGBVnOex6S5x0GEzxrk2QFQpZpG YjvDeW6zXUR0dqAibRQ+I8/+PNXgySekGX3crskdSYIfFqigxDYLgL3EJZvaz9Nq C7lBHtj7D75FCJux0LfXdMFM7vI+OlM0+KGIt5kLU0N0S1yLr9fE/M40WcuuKh1m 1/+yFOA1zFRHIusJifrZ =zlQq -----END PGP SIGNATURE----- --75c6STi15IkoU7tMBoe5M7BmRNwejnKM6--