From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Newsgroups: gmane.emacs.bugs Subject: bug#70382: 29.3; Info-fontify-node renders cross-references misleadingly Date: Sun, 14 Apr 2024 16:35:41 +0200 Message-ID: <18edd090d56.b4d9f833651238.7754717828208203833@excalamus.com> Reply-To: matt@excalamus.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2106971_28527971.1713105341782" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14426"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Zoho Mail To: 70382@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 14 16:37:19 2024 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 1rw0yt-0003Ww-J6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Apr 2024 16:37:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rw0yV-0003FV-Rl; Sun, 14 Apr 2024 10:36:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rw0yU-0003F9-6f for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 10:36:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rw0yT-0005x8-UL for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 10:36:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rw0ye-0000Y9-SX for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 10:37:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Apr 2024 14:37:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70382 X-GNU-PR-Package: emacs X-Debbugs-Original-To: "bug-gnu-emacs" Original-Received: via spool by submit@debbugs.gnu.org id=B.17131053751645 (code B ref -1); Sun, 14 Apr 2024 14:37:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Apr 2024 14:36:15 +0000 Original-Received: from localhost ([127.0.0.1]:35947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw0xo-0000Q3-TU for submit@debbugs.gnu.org; Sun, 14 Apr 2024 10:36:14 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:40824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw0xm-0000Oe-FF for submit@debbugs.gnu.org; Sun, 14 Apr 2024 10:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rw0xV-00038r-VW for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 10:35:53 -0400 Original-Received: from sender4-pp-f112.zoho.com ([136.143.188.112]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rw0xT-0005t3-VD for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 10:35:53 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1713105344; cv=none; d=zohomail.com; s=zohoarc; b=GPusQMgw63v+6NQXKnC2Tp2KkZ6kgq8zzl3LlcnShRV0xerQZbQPAA3ez2V+u+PppKAe+uBqShtcOMo5JcUkamPaPH41lrCw+coJ7KHtjloEur/GIiKU+aTkiKO+lHhTOX1QWVJ3m3xJg9yMFrFvkTKaKoLLuFbNSQsqejB3hZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713105344; h=Content-Type:Date:Date:From:From:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=5TNLI5gVg0l+KK2K6ROQosvLnhoCkdi1YLgC6BG/qEk=; b=CFATulF2EY9QGVr1p6RjOqDWH/ORH7Tx9nDDNOj8kw7CnLZ0XFbRQmoEVQepe4Qfr9pDLfDgZkIZYh2K4tHE1KwdJtGDJswlgEs6dzejVXRckgy5GvuAmfYej1+2rnpUMuuMUzO2OuD+TLlxAUk2tIa+oQw+Yg1pY9nX8qiG9WI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=excalamus.com; spf=pass smtp.mailfrom=matt@excalamus.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1713105344; s=zmail; d=excalamus.com; i=matt@excalamus.com; h=Date:Date:From:From:Reply-To:Reply-To:To:To:Message-Id:Message-Id:In-Reply-To:Subject:Subject:MIME-Version:Content-Type:Cc; bh=5TNLI5gVg0l+KK2K6ROQosvLnhoCkdi1YLgC6BG/qEk=; b=Qo6/bOM/I37hzHKHRrEzlUlZRfCB8ASCOyIZD0SpuTOklo0rW48mOntoCIaSS/sE l39RfBKIhl8Xkzdpj4Zl/xeYzOyZI4Rx/NB46t293LFX1FfSD6JoO90gt+dekGVSRkB moXkl+u5FBpSdseFXICBVUyQjXhZ1B9wZfx1KHBc= Original-Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1713105341879407.45958537511024; Sun, 14 Apr 2024 07:35:41 -0700 (PDT) Importance: 3 X-Mailer: Zoho Mail X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-1.1.0/213.57.70 Received-SPF: pass client-ip=136.143.188.112; envelope-from=matt@excalamus.com; helo=sender4-pp-f112.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283282 Archived-At: ------=_Part_2106971_28527971.1713105341782 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Authors of GNU documentation who use Emacs to read the Texinfo info manual = are misled by the default settings into using the wrong Texinfo commands. The following uses: - info (GNU texinfo) 7.1 - tar 1. Download the latest version of the texinfo info manual (version 7.1, 18 = October 2023): https://www.gnu.org/software/texinfo/manual/texinfo/ 2. Extract 'texinfo.info' from the tarball: tar xzvf texinfo.info.tar.gz 3. Open 'texinfo.info' in the Info reader: info ./texinfo.info 4. Press 6 1 to navigate to "5.1 Different Cross-reference Commands" 5. Observe that @xref uses (capital 'N') "*Note" and @ref uses (lowercase '= n') "*note": =E2=80=98@xref=E2=80=99 Used to start a sentence with an Info cross-reference saying =E2= =80=98*Note NAME: NODE.=E2=80=99 or with 'See ...' in other output formats. =E2=80=98@ref=E2=80=99 Used within or, more often, at the end of a sentence; produces an Info cross-reference saying =E2=80=98*note NAME: NODE.=E2=80=99, a= nd just the reference in other output formats, without the preceding 'See'. 6. Open 'texinfo.info' in Emacs: emacs -Q texinfo.info 7. Go to line 3570 (M-g M-g 3570) 8. Observe that the texinfo source matches the command-line info reader: =E2=80=98@xref=E2=80=99 Used to start a sentence with an Info cross-reference saying =E2= =80=98*Note NAME: NODE.=E2=80=99 or with 'See ...' in other output formats. =E2=80=98@ref=E2=80=99 Used within or, more often, at the end of a sentence; produces an Info cross-reference saying =E2=80=98*note NAME: NODE.=E2=80=99, a= nd just the reference in other output formats, without the preceding 'See'. 9. Open 'texinfo.info' using the Emacs info reader using 'C-u C-h i texinfo= .info' 10. Press 6 1 to navigate to "5.1 Different Cross-reference Commands" 11. Observe that both "*Note" and "*note" are rendered as lowercase "see": =E2=80=98@xref=E2=80=99 Used to start a sentence with an Info cross-reference saying =E2= =80=98see NAME.=E2=80=99 or with 'See ...' in other output formats. =E2=80=98@ref=E2=80=99 Used within or, more often, at the end of a sentence; produces an Info cross-reference saying =E2=80=98see NAME.=E2=80=99, and just = the reference in other output formats, without the preceding 'See'. This is a problem because 'makeinfo' does *not* compile texinfo to other fo= rmats as described by the Emacs rendered version of the Texinfo info manual= ! Specifically, 'makeinfo' renders @xref as (capital 'S') "See" in HTML an= d other formats. The Emacs rendering misleads readers to believe that @xre= f renders as (lowercase 's') "see" in HTML and other formats. I attempted a fix and was unsuccessful. Emacs controls the default renderi= ng of info files, in part, with 'Info-hide-note-references'. The default f= or 'Info-hide-note-references' is to "replace '*note' with 'see'." Unfortu= nately, 'Info-fontify-node', which handles the actual rendering, ignores ca= se sensitivity. This causes a match on "*Note", which corresponds to @xref= commands, to be considered as "*note" and, because of the default behavior= of 'Info-hide-note-references', to be replaced with (lowercase 's') "see "= . In the attached diff, I attempted to make the default 'Info-hide-note-refer= ences' behavior match the description in the texinfo.texi document for HTML= . That is, to replace "See" for @xref related notes (capital 'N' "*Note").= I attempted to differentiate which type of "note" pattern was matched. H= owever, I was unable to get the match to work correctly. Despite setting '= case-fold-search' to nil, lowercase "*note" was still matched and incorrect= ly replaced the same as @xref. -- Matt Trzcinski Emacs Org contributor (ob-shell) Learn more about Org mode at https://orgmode.org Support Org development at=C2=A0https://liberapay.com/org-mode ------=_Part_2106971_28527971.1713105341782 Content-Type: application/octet-stream; name=v01-make-Info-hide-note-references-render-more-like-command-line-info-reader.diff Content-Transfer-Encoding: 7bit X-ZM_AttachId: 139323981417830130 Content-Disposition: attachment; filename=v01-make-Info-hide-note-references-render-more-like-command-line-info-reader.diff diff --git a/lisp/info.el b/lisp/info.el index b459406959e..1b0fee0efac 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -5038,6 +5038,14 @@ first line or header line, and for breadcrumb links.") (save-excursion (search-forward "\n\n" start t))) "See ") + ((save-match-data (let ((case-fold-search nil)) + (save-excursion + (search-forward "*Note" next t))) + "Banana ")) + ((save-match-data (let ((case-fold-search nil)) + (save-excursion + (search-forward "*note" next t))) + "banana ")) (t "see ")))) (goto-char next) (add-text-properties ------=_Part_2106971_28527971.1713105341782--