unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Undocumented hyperlinks in doc strings.
Date: Mon, 13 Oct 2003 22:23:45 -0500 (CDT)	[thread overview]
Message-ID: <200310140323.h9E3Njf05047@raven.dms.auburn.edu> (raw)
In-Reply-To: <E1A8urJ-0006ua-3s@fencepost.gnu.org> (message from Richard Stallman on Mon, 13 Oct 2003 01:03:05 -0400)

Richard Stallman wrote:

       In as far as the first one goes, one could replace the occurrences of
       [ \t\n]+ and [ \t\n]* (the latter probably would have to be changed to
       [ \t\n]+ anyway, for consistency) in my patch by [ \n].  (If one does
       not allow multiple spaces, it seems consistent not to allow tab
       either.)  That would mean that the author would have to be careful
       about "space related sloppiness" like trailing whitespace or an
       inadvertent inappropriate double space inside a sentence.

   That is true.  I am not sure which approach would actually do a better job
   in practice.

I would be leaning toward keeping [ \t\n]+, although this is a close
call and I am not really sure either.

There is some more strange behavior in connection with these
hyperlinks.  Evaluate

(defvar sillyvar nil
  "Documents the strange behavior of `button'.
Also, the symbol `tool-bar-mode' and dynamic `use-mouse-action'.")

and do C-h v sillyvar.  Then in the *Help* buffer click with mouse-2 on
`button'.

The behavior in the next paragraph seems deliberate.  I just describe
it in detail, in case it would not be.

In spite of my patch, we now see the face documentation of `button'.
That is because, in the absence of a hyperlink, mouse-2 is bound to
`help-follow-mouse' which will follow and list all available
documentation regardless of any convention.  `help-make-xrefs' is not
involved here.  Mouse-2 also will follow `tool-bar-mode' in spite of
the `symbol' in front of it.  (The `symbol' prevents the making of a
hyperlink for the following symbol, but does not actually prevent
mouse-2 from listing all available documentation for that symbol.)
Mouse-2 will also follow the following `and', viewing it as the lisp
special form.

All the above is probably deliberate, but now things get more
"exotic".  In the face documentation of `button' click on [back].  Of
course, we get the doc string of sillyvar back, but it has changed.
Previously, `button' and `use-mouse-action' were not underlined,
because they were not hyperlinks, but now they are underlined.  One
can check that neither `button' not `use-mouse-action' are defined as
variables, before clicking once more on `button' with mouse-2 and
getting:

button's value is 
#<marker
(moves after insertion)
at 20 in *Help*>

Not documented as a variable.

[back]

What happens is that button is not defined as a global variable.
However, when clicking on a hyperlink, mouse-2 is bound to
`push-button', whose code contains:

    (let ((button (button-at (or pos (point)))))
      (if (not button)
        nil
	(button-activate button use-mouse-action)
	t))))

`button' and `use-mouse-action' now are dynamically bound.  When we
clicked on `back' in the face documentation `button' and
`use-mouse-action' were dynamically `boundp' when `help-make-xrefs'
was deciding whether a hyperlink should be made for them.  In the
*Help* buffer they were not boundp any more, but once we actually
clicked on the hyperlink, `button' was boundp again, and its dynamic
binding got displayed.

`button' being a text property, we can not just avoid to use it in
documentation strings.  What about replacing:

                      ((boundp sym)
	               (help-xref-button 8 'help-variable sym))

by:

                      ((and (boundp sym)
                            (not (string= sym "button")))
		       (help-xref-button 8 'help-variable sym))

That would still make a hyperlink for: the variable `button' 
but not for a mere: `button'.

`button' appears to be the only real problem.  I do not believe that
`use-mouse-action' is likely to actually occur in hyperlinks.  Hence,
it might not be worth worrying about.

Out of curiosity one can click on the `use-mouse-action' hyperlink
anyway and get:

use-mouse-action's value is t

Not documented as a variable.

[back]

Sincerely,

Luc.

  reply	other threads:[~2003-10-14  3:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-09  0:50 Undocumented hyperlinks in doc strings Luc Teirlinck
2003-10-09 21:16 ` Richard Stallman
2003-10-10  3:27   ` Luc Teirlinck
2003-10-10 14:14     ` Stefan Monnier
2003-10-10 15:31       ` Luc Teirlinck
2003-10-10 16:29         ` Luc Teirlinck
2003-10-10 17:23         ` Stefan Monnier
2003-10-10 18:21           ` Luc Teirlinck
2003-10-10 19:24             ` Stefan Monnier
2003-10-11 17:12       ` Richard Stallman
2003-10-14 21:03         ` Stefan Monnier
2003-10-15  1:38           ` Luc Teirlinck
2003-10-15 20:00             ` Richard Stallman
2003-10-15 23:52               ` Luc Teirlinck
2003-10-16 23:06                 ` Richard Stallman
2003-10-16 14:06             ` Richard Stallman
2003-10-17  3:32               ` Luc Teirlinck
2003-10-17 13:47                 ` Stefan Monnier
2003-10-18 23:06                   ` Richard Stallman
2003-10-19  1:14                     ` Luc Teirlinck
2003-10-20  1:48                       ` Richard Stallman
2003-10-20  2:24                         ` Luc Teirlinck
2003-10-20 14:44                           ` Stefan Monnier
2003-10-20 15:22                             ` Luc Teirlinck
2003-10-21 14:47                             ` Richard Stallman
2003-10-11  5:36     ` Richard Stallman
2003-10-12  3:34       ` Luc Teirlinck
2003-10-13  5:03         ` Richard Stallman
2003-10-14  3:23           ` Luc Teirlinck [this message]
2003-10-17 20:46             ` Richard Stallman
2003-10-17 23:30               ` Luc Teirlinck

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=200310140323.h9E3Njf05047@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@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).