From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#40844: html mode sometimes fooled by apostrophe Date: Sun, 13 Jun 2021 20:14:08 +0200 Message-ID: <8735tlljin.fsf@gmx.net> References: <87pn5oq1hj.5.fsf@jidanni.org> <831ri34i0b.fsf@gnu.org> <87o8l7zdh6.fsf@rub.de> <83o8l731yd.fsf@gnu.org> <87h7qzzae2.fsf@rub.de> <83lfgb2yss.fsf@gnu.org> <87d01nz7gb.fsf@rub.de> <83blh72vlk.fsf@gnu.org> <878scbyw3s.fsf@rub.de> <87sgai76oj.fsf@gmx.net> <878s3e3qgf.fsf_-_@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28803"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 40844@debbugs.gnu.org, 43941@debbugs.gnu.org, jidanni@jidanni.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 13 20:15:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsUde-0007Jc-ND for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Jun 2021 20:15:14 +0200 Original-Received: from localhost ([::1]:38510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsUdd-0000ox-Mn for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Jun 2021 14:15:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsUdS-0000oW-NC for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2021 14:15:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsUdS-0003Hd-Fx for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2021 14:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lsUdS-0006zH-A7 for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2021 14:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Jun 2021 18:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40844 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed patch Original-Received: via spool by 40844-submit@debbugs.gnu.org id=B40844.162360806326783 (code B ref 40844); Sun, 13 Jun 2021 18:15:02 +0000 Original-Received: (at 40844) by debbugs.gnu.org; 13 Jun 2021 18:14:23 +0000 Original-Received: from localhost ([127.0.0.1]:44356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsUco-0006xq-T6 for submit@debbugs.gnu.org; Sun, 13 Jun 2021 14:14:23 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:59333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsUcn-0006xY-Fl; Sun, 13 Jun 2021 14:14:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1623608050; bh=jDJgsZpXA4A/RIUL6xDtaOV/120sIjHLn7ogacJZ+o0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=OrztXjFiL2nNzKrANavvF8qEWyjRc/XZF/akmieDb+8mlTxjIx/ABpI0UTwSE5pXV TxtMhKYh+MWnhW2Oqr9yfWtqoUdfsYCqDCS49NznPbKPyrvjZO09qQI2oajswLy1sW awWINUtNt2aGxy8sK48D71+wA2Ul5O7ma/9eC1XI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobelfs ([178.1.121.23]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M72sJ-1lxjHZ1J7f-008ar1; Sun, 13 Jun 2021 20:14:10 +0200 In-Reply-To: <878s3e3qgf.fsf_-_@gnus.org> (Lars Ingebrigtsen's message of "Sun, 13 Jun 2021 14:21:36 +0200") X-Provags-ID: V03:K1:3ui+D5T8XbG5a7wLeVpa3AbivGOodxsZq6iu6tnveE5ggRO90Ij lBH/t5WrU+TMov7e+8mdZ54BZXk5Hoem/gR29KkCWKiPtUV6QNFhCa2fuQfieWrxnN/oDgG xP46/6RnuO1QKvfaggKz1e6GA7mv/gzlXYNv+Liw3NFFS4mLavikULN0cz/AOtMhsJrqrei FvKMNolcP2qjnxRSEuWTA== X-UI-Out-Filterresults: notjunk:1;V03:K0:W/kEIK3arAk=:6pCyQDBm4qn5sliOKIm1uu +j6YQAn0pzUDn4NN80JbKIjHDkuTrGg2jnbxTrYvfgj8CvY/8skRcW1c4i5EF/qOeKHa6LfsS aHkHYuL9I9EeB6kmyV2zKVrEcQBpCVzjRoHd6U8safD2a4AVjm/yhjEUfTmKa8gzG5yHWNK4w 9Uj7prsPMSzgz1poqu2rLaLbNbTFwrQLGQcr0zCdPsspRd/yjtm604iKjmajPovcapU6eFU4p TYYLrJ5jtHd+he0cLszYmJH6QSwUynG/gJ/BuymZOuKVn2JPNZDgtwLsMWRb7MuL1k7icZRyS 6nv9qhoGpGHFl9JnYxcH8E4hONM2hDugtHUl86aXPKrwafVRmrYRZ2Vb+oF2TwfgEvq0dT2J+ 1i0IgEC8onrRz4DiHpz00clCVzmqjMXqtwvlV35N7jvHqDn7amnRr2lbtkH5G+jSOYKRh+kva 7W8GhAQjtzmxz5Jh2xbHj2JldtqbtH3idYnTeVsMVb2jy3f9mhyMJLil435YGytJxemjmfiTH XUkg5zypRdQ7Vcwl/VbfmuyeJJdhP+RYh5jnlhLK+DtBhEnSaiB52vcK2/nKN9R8nO5O3BPQ7 NzrSI11QGdgQa9DVhYHIXHW0EgvI5qDTpxg7Vc84pZKK+bMJ6NbVxgN61JuXvN7viR1njM/TJ 9rEb0M8LXIl8J6G5kyoE19mN2LqSOHDkR+DnHFcaUIcGScTHz0yCyRIz5PMH9RullEIatYin8 HB51+DLslxnWJUIdXN0tJl9jPh2qWqDNsZ0dHm9QSA7OEoBf+xZW2o4uvdkqDcuuzT6BWXpz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208460 Archived-At: On Sun, 13 Jun 2021 14:21:36 +0200 Lars Ingebrigtsen wrote: > Stephen Berman writes: > >> I made a silly mistake (it was late and I was tired). Here is a >> corrected version: > > I can confirm that this patch solves the test cases here. Thanks for checking. >> With this patch, when any of the paired-bracket characters is followed >> by `'' in html-mode, there is indeed no string face fontification on the >> latter (and following characters). The following function demonstrates >> this: > > [...] > >> I wanted to turn this function into a test, and that's what the >> commented out lines are supposed to do. But when I uncomment these >> lines and call this function with the unpatched (i.e. current) version >> of sgml-mode-syntax-table, it still shows default face for `'' with all >> the paired-bracket characters. Yet when I step through the function >> with Ediff, I do see some cases with font-lock-string-face. I don't >> understand what's going on here. > > Might be a timing issue, perhaps? I tried adding sit-for at different points but it made no difference. > In any case, the patch is an improvement, so perhaps that should be > pushed anyway? Upthread Eli said "some SGML/HTML expert should say if that is TRT". I'm no such expert so I can't make that decision. FWIW, I rewrote the test using ert, and the result is as above: it passes with the patch, as expected, but also without the patch, even though in the latter case the test buffer clearly contains characters fontified with font-lock-string-face. And just as I wrote above, when stepping through the ert-deftest using the unpatched sgml-tag-syntax-table, the test does fail as expected. Here's the test, in case someone else wants to see if they can figure it out; I haven't succeeded: (ert-deftest sgml-test-brackets () "Test fontification of apostrophe preceded by paired-bracket character." (let ((buf (get-buffer-create "*sgml-test*")) brackets results) (map-char-table (lambda (key value) (setq brackets (cons (list (if (consp key) (list (car key) (cdr key)) key) value) brackets))) (unicode-property-table-internal 'paired-bracket)) (setq brackets (delete-dups (flatten-tree brackets))) (setq brackets (append brackets (list ?$ ?% ?& ?* ?+ ?/))) (with-current-buffer buf (erase-buffer) (fundamental-mode) (while brackets (let ((char (string (pop brackets)))) (insert (concat "

" char "'s

\n")))) (html-mode) (goto-char (point-min)) (while (not (eobp)) (goto-char (next-single-char-property-change (point) 'face)) (let ((val (get-text-property (point) 'face))) (when val (should-not (eq val 'font-lock-string-face)))))))) Steve Berman