From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: VanL Newsgroups: gmane.emacs.bugs Subject: bug#36927: 26.2.90; include stdarg.h is without hyperlinking on vfprintf's manpage Date: Sat, 10 Aug 2019 15:05:16 +1000 Message-ID: References: <83imrbd24r.fsf@gnu.org> <83ftmaa1av.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="204727"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36927@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 10 07:06:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hwJZx-000rAQ-HX for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Aug 2019 07:06:09 +0200 Original-Received: from localhost ([::1]:35076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hwJZw-0003Hd-Gn for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Aug 2019 01:06:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39201) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hwJZs-0003HT-4P for bug-gnu-emacs@gnu.org; Sat, 10 Aug 2019 01:06:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hwJZq-0002ke-SY for bug-gnu-emacs@gnu.org; Sat, 10 Aug 2019 01:06:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34565) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hwJZq-0002kY-Pt for bug-gnu-emacs@gnu.org; Sat, 10 Aug 2019 01:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hwJZq-0008MC-J6 for bug-gnu-emacs@gnu.org; Sat, 10 Aug 2019 01:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: VanL Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Aug 2019 05:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36927 X-GNU-PR-Package: emacs Original-Received: via spool by 36927-submit@debbugs.gnu.org id=B36927.156541352832084 (code B ref 36927); Sat, 10 Aug 2019 05:06:02 +0000 Original-Received: (at 36927) by debbugs.gnu.org; 10 Aug 2019 05:05:28 +0000 Original-Received: from localhost ([127.0.0.1]:43386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hwJZG-0008LM-2X for submit@debbugs.gnu.org; Sat, 10 Aug 2019 01:05:28 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:40739) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hwJZD-0008LE-Pw for 36927@debbugs.gnu.org; Sat, 10 Aug 2019 01:05:25 -0400 X-Originating-IP: 193.119.112.173 Original-Received: from epi.local (193-119-112-173.tpgi.com.au [193.119.112.173]) (Authenticated sender: van@scratch.space) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 5CDD51BF208; Sat, 10 Aug 2019 05:05:20 +0000 (UTC) In-Reply-To: <83ftmaa1av.fsf@gnu.org> X-Mailer: Apple Mail (2.3124) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164820 Archived-At: > On 9 Aug 2019, at 23:58, Eli Zaretskii wrote: >=20 >> Date: Mon, 05 Aug 2019 19:10:28 +0300 >> From: Eli Zaretskii >> Cc: 36927@debbugs.gnu.org >>=20 >>> From: VanL >>> Date: Mon, 5 Aug 2019 11:51:56 +1000 >>>=20 >>> See manpage for vfprintf(). >>>=20 >>> Unlike the first instance of the #include preprocessing directive >>>=20 >>> #include >>>=20 >>> at approximately line 12 of printf(3), which is underlined and >>> hyperlinked, the second instance at approximately line 32, is not >>> underlined and not hyperlinked. >>>=20 >>> 1. M-x man RET vfprintf >>> 2. on line 32 see #include which is without hyperlinking >>=20 >> For some reason, we don't put a button on the second #include. >=20 > The logic in Man-highlight-references0 was flawed: it assumed that a > section ("SYNOPSIS", "FILES", "SEE ALSO", etc.) is always received > entirely in a single chunk of text that is read from the subprocess, > which is, of course, not guaranteed, and depends on factors such as > the size of each section, buffering, how busy is the system, etc. > (Those reasons also made this a bitch to debug, because a bug comes > and goes unpredictably, and never shows when one steps with Edebug.) Thanks. That sounds really convoluted and this is what I can see diff --git a/lisp/man.el b/lisp/man.el index d52ca2156d..8858451b38 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1288,8 +1288,23 @@ Man-highlight-references =20 (defun Man-highlight-references0 (start-section regexp button-pos = target type) ;; Based on `Man-build-references-alist' - (when (or (null start-section) - (Man-find-section start-section)) + (when (or (null start-section) ;; Search regardless of = sections. + ;; Section header is in this chunk. + (Man-find-section start-section) + ;; Section header was in one of the previous chunks. + (save-excursion + (save-restriction + (let ((orig-pos (point))) + (widen) + (if (Man-find-section start-section) + ;; We are in the right section of the next + ;; section is either not yet in the buffer, or + ;; it starts after the position where we should + ;; start highlighting. + (progn + (forward-line 1) + (or (null (re-search-forward Man-heading-regexp = nil t)) + (> (point) orig-pos)))))))) (let ((end (if start-section (progn (forward-line 1) > I think I made it much better on master, although I still see a rare > case where one or the other "include" is not buttonized. But I've run > out of time, so someone else will have to find and fix what I missed. >=20 > I'm leaving this bug open because I don't think it's 100% fixed. A possible way is to wait for all the subprocess sections to be done and = to post-process on the fully collected buffer having lines like line 11: .In stdio.h line 24: .In stdarg.h with buttonization transformation in theory like [1] -- [1]=20 8.4 Computing with Lists = https://htdp.org/2019-02-24/part_two.html#%28part._sec~3aeval-list%29