From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#14717: 24.3.50; Info-try-follow-nearest-node misses some footnotes Date: Sat, 29 Jun 2013 00:50:51 +0300 Organization: JURTA Message-ID: <871u7laogo.fsf@mail.jurta.org> References: <87vc52599u.fsf@rosalinde.fritz.box> <8738s4jvc4.fsf@mail.jurta.org> <87d2r7vqr7.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372456990 21925 80.91.229.3 (28 Jun 2013 22:03:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Jun 2013 22:03:10 +0000 (UTC) Cc: 14717@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 29 00:03:10 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Usgl3-0002BB-IF for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2013 00:03:09 +0200 Original-Received: from localhost ([::1]:37636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usgl2-0005T2-Qa for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 18:03:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usgkx-0005St-Sd for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2013 18:03:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Usgkw-0000UI-M1 for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2013 18:03:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usgkw-0000UC-JE for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2013 18:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Usgkv-0007TI-U5 for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2013 18:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jun 2013 22:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14717 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14717-submit@debbugs.gnu.org id=B14717.137245696928686 (code B ref 14717); Fri, 28 Jun 2013 22:03:01 +0000 Original-Received: (at 14717) by debbugs.gnu.org; 28 Jun 2013 22:02:49 +0000 Original-Received: from localhost ([127.0.0.1]:47373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Usgkh-0007SU-Ma for submit@debbugs.gnu.org; Fri, 28 Jun 2013 18:02:48 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:42999 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Usgke-0007SG-MN for 14717@debbugs.gnu.org; Fri, 28 Jun 2013 18:02:45 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 4B356258B9E915; Fri, 28 Jun 2013 15:02:43 -0700 (PDT) In-Reply-To: <87d2r7vqr7.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Thu, 27 Jun 2013 11:37:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:75693 Archived-At: >> BTW, if you are interested what I'm trying to do in bug#14670 >> where I renamed the text property of footnotes from `link' to `shr-url' >> is to support shr-url links in Info. The value of the text properly >> `shr-url' is the target of the link. The problem is how to address >> a footnote? Maybe add a function that finds a footnote. But I'm afraid >> that supporting an arbitrary function on the text properly `shr-url' >> is too unsafe. So `shr-url' should contain only a string. The question >> is in what format to specify a link to a footnote. Currently it has >> the value `t'. Perhaps as a string it could contain a line number >> of the footnote like "(elisp) Using Interactive (line 42)". > > Would that mean the link would have to be manually updated whenever the > line number of the footnote in the file changes? If so, it seems > error-prone. But I don't know the implementation, maybe that's not an > issue. Otherwise, seems like an interesting idea. `Info-fontify-node' could calculate the line number dynamically before putting it to the text property `link', but since I have no idea in what format to put line numbers in links, I'll leave it unchanged for now. The main point for bug#14670 is to put a new condition that checks general links to `Info-try-follow-nearest-node' either after checking for footnotes, or before checking for footnotes but with an additional condition `(not (eq node t))' because for footnotes `Info-fontify-node' puts the text property `link' with the value `t' that should be skipped when the current link is a link to footnote and not a general link, so another existing `cond' branch will check whether text at point contains a link for footnote. I see no problems for footnotes after adding processing of general links with this patch: === modified file 'lisp/info.el' --- lisp/info.el 2013-06-27 09:20:04 +0000 +++ lisp/info.el 2013-06-27 23:31:27 +0000 @@ -3863,6 +3919,8 @@ (defun Info-try-follow-nearest-node (&op If FORK is non-nil, it is passed to `Info-goto-node'." (let (node) (cond + ((and (setq node (get-text-property (point) 'link)) (not (eq node t))) + (Info-goto-node node fork)) ((setq node (Info-get-token (point) "[hf]t?tps?://" "\\([hf]t?tps?://[^ \t\n\"`({<>})']+\\)")) (browse-url node)