From: Juri Linkov <juri@jurta.org>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 14717@debbugs.gnu.org
Subject: bug#14717: 24.3.50; Info-try-follow-nearest-node misses some footnotes
Date: Sat, 29 Jun 2013 00:50:51 +0300 [thread overview]
Message-ID: <871u7laogo.fsf@mail.jurta.org> (raw)
In-Reply-To: <87d2r7vqr7.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Thu, 27 Jun 2013 11:37:16 +0200")
>> 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)
prev parent reply other threads:[~2013-06-28 21:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 18:34 bug#14717: 24.3.50; Info-try-follow-nearest-node misses some footnotes Stephen Berman
2013-06-26 23:39 ` Juri Linkov
2013-06-27 9:37 ` Stephen Berman
2013-06-28 21:50 ` Juri Linkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871u7laogo.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=14717@debbugs.gnu.org \
--cc=stephen.berman@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.