From: Drew Adams <drew.adams@oracle.com>
To: 24842@debbugs.gnu.org
Subject: bug#24842: 24.5; `help-make-xrefs': False link-type determinations
Date: Mon, 31 Oct 2016 16:00:14 -0700 (PDT) [thread overview]
Message-ID: <919e40a4-f6c4-492d-b50f-b0671e13cb60@default> (raw)
`help-make-xrefs' tries to guess the type of a symbol that is enclosed
in `...', in help.
This determination needs to to be improved, or else programmers need
some way to inhibit it when it turns out to be inappropriate.
Example: This is part of a doc string I have:
`isearchp-movement-unit-alist'\t- units and their movement functions
`isearchp-on-demand-action-function'\t- on-demand action function
`isearchp-prompt-for-filter-name'\t- when to ask for filter name
Those symbols are all variables (in fact, user options), not functions.
but the word "function" at the end of the second line causes the quoted
symbol that follows it to be considered as a function name. And then,
because it is not `fboundp', it gets no link. It should instead get a
variable-name link to its definition.
1. One possible approach is to improve the behavior. I have not tested
this generally, but changing the `cond' clauses to include the test
for type and for documentation as part of the `cond' test, instead of
being part of the result clause after the test, fixes at least the
immediate problem of the above example.
For example, instead of:
((match-string 4) ; `function' &c
(and (fboundp sym) ; similarly
(help-xref-button 8 'help-function sym)))
use this:
((and (match-string 4) ; `function' &c
(fboundp sym)) ; similarly
(help-xref-button 8 'help-function sym))
Similarly for the other clauses.
Possibly this does not DTRT generally, since it lets subsequent
`cond' clauses get tested if the code cannot determine that the
symbol is a variable, function, etc.
But that's the point of those clauses. If they cannot find that some
symbol is a variable, etc., then shouldn't the subsequent clauses be
tried? (The tests might need to be improved. Dunno.)
Again, I have not tested this, so I don't propose an exact code fix.
I'm reporting the bug.
2. An alternative, if you don't find that #1 is reasonable, could be to
explicitly provide for (and document) some way for a programmer to
"escape" a given quoted symbol from a "determiner" such as "function"
that immediately precedes it.
The regexp used now looks for whitespace after the "determiner": any
combination of space, tab, and newline chars.
I can insert a NULL char, x00, after "function", and that "fixes"
things, but that char then appears in the output, as "^@". Another
Unicode whitespace char could be used instead, etc. But that still
means another character that gets rendered, increasing the line
length, etc.
If #2 is chosen, the solution should hopefully be more robust and
cleaner that such a hack.
I hope you will consider fixing this in some way.
In GNU Emacs 24.5.1 (i686-pc-mingw32)
of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --prefix=/c/usr --host=i686-pc-mingw32'
next reply other threads:[~2016-10-31 23:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-31 23:00 Drew Adams [this message]
2016-10-31 23:55 ` bug#24842: 24.5; `help-make-xrefs': False link-type determinations npostavs
2016-11-01 4:35 ` Drew Adams
2016-11-01 15:20 ` Eli Zaretskii
2016-11-01 15:34 ` Noam Postavsky
2016-11-01 16:16 ` Eli Zaretskii
[not found] ` <<83wpgnns4x.fsf@gnu.org>
2016-11-01 16:15 ` Drew Adams
2016-11-01 16:25 ` Eli Zaretskii
[not found] ` <<CAM-tV-_+-Ewzh_vMpi65cc5ukD+T+WHNPGk0dooqQCaJAvmTaQ@mail.gmail.com>
[not found] ` <<83r36vnpjw.fsf@gnu.org>
2016-11-01 16:29 ` Drew Adams
2016-11-01 16:50 ` Eli Zaretskii
2017-02-05 19:27 ` Drew Adams
2018-01-01 21:20 ` Drew Adams
2021-09-07 18:00 ` bug#24842: bug#9445: 24.0.50; `help-make-xrefs' has bad logic Lars Ingebrigtsen
2021-09-07 19:24 ` bug#24842: [External] : " Drew Adams
2021-09-07 19:28 ` Lars Ingebrigtsen
2021-09-07 19:44 ` bug#9445: bug#24842: " Stephen Berman
2021-09-07 19:55 ` Lars Ingebrigtsen
2022-02-15 10:43 ` bug#24842: 24.5; `help-make-xrefs': False link-type determinations Lars Ingebrigtsen
2022-02-15 16:58 ` bug#24842: [External] : " Drew Adams
2022-02-15 19:12 ` Eli Zaretskii
2022-02-15 19:22 ` Drew Adams
2022-02-15 19:33 ` Eli Zaretskii
2021-09-07 20:13 ` bug#24842: [External] : Re: bug#24842: bug#9445: 24.0.50; `help-make-xrefs' has bad logic Drew Adams
[not found] <<919e40a4-f6c4-492d-b50f-b0671e13cb60@default>
[not found] ` <<878tt4qdjq.fsf@users.sourceforge.net>
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=919e40a4-f6c4-492d-b50f-b0671e13cb60@default \
--to=drew.adams@oracle.com \
--cc=24842@debbugs.gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).