unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24842: 24.5; `help-make-xrefs': False link-type determinations
@ 2016-10-31 23:00 Drew Adams
  2016-10-31 23:55 ` npostavs
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Drew Adams @ 2016-10-31 23:00 UTC (permalink / raw)
  To: 24842

`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'





^ permalink raw reply	[flat|nested] 23+ messages in thread
[parent not found: <<919e40a4-f6c4-492d-b50f-b0671e13cb60@default>]

end of thread, other threads:[~2022-02-15 19:33 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-31 23:00 bug#24842: 24.5; `help-make-xrefs': False link-type determinations Drew Adams
2016-10-31 23:55 ` 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>

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).