Yoshiki Hayashi <yoshiki(a)xemacs.org> writes:
1. FSF Emacs has nice [back] button when you followd xref.
2. FSF Emacs shows both function and variable documentation
if symbol is both boundp and fboundp.
I don't think we need 1. since XEmacs has multiple help buffer. I
just don't know the best way to handle 2, so it describes function
part only. Perhaps it should prompt for user to choose function or
variable. Or it should do the same with FSF Emacs.
The latter would be quite acceptable.
You might consider implementing a context-sensitive menu that enables
the user to choose between function and variable documentation. Also
note that the same symbol can denote a face, a charset, etc. More
stuff for the context menu.
This patch will make C-h b a bit slower but more useful.
How much slower?
2000-01-25 Yoshiki Hayashi <yoshiki(a)xemacs.org>
* help.el: Import xref stuff from FSF 20.5.
(with-displaying-help-buffer): Call help-make-xrefs.
Try to make xref for alias and loaded place.
(help-highlight-p): New variable.
(help-highlight-face): Ditto.
(help-xref-symbol-regexp): Ditto.
(help-xref-info-regexp): Ditto.
(help-make-xrefs): New function.
(help-xref-button): Ditto.
(help-follow-mouse): Ditto.
(help-follow): Ditto.
(help-next-ref): Ditto.
(help-previous-ref): Ditto.
+ ;; #### This relies heavily on current output format.
+ ;; When it's changed, this won't work.
You could fix this by having the help.el functions attach
context-sensitive extents to important parts of the text. Then you
could add highlighting and stuff by mapping over those extents. This
would be less error-prone and would survive gettextization.
I've used this technique to handle multi-line messages in log-message
and view-lossage, and it worked nicely.
+(defcustom help-highlight-p t
+ "*If non-nil, `help-make-xrefs' highlight cross-references.
+Under a window system it highlights them with face defined by
+`help-highlight-face'. On a character terminal highlighted
+references look like cross-references in info mode."
+ :group 'help
+ :type 'boolean)
+
+(defcustom help-highlight-face 'underline
+ "Face used by `help-make-xrefs' to highlight cross-references.
+Must be previously-defined."
+ :group 'help
+ :type 'face)
Umm, no, please don't do this. It's a bit nicer to just define the
face you want to use with the right properties, like this:
; assuming that defface now works for dumped code.
(defface help-highlight-face '((t (:underline t)))
"..."
:group ...)
If you want compatibility with FSF Emacs, you can create a
`help-highlight-face' variable that points to the face. You could
also suggest the same change to the FSF developers.
The patch is vetoed in its current form, until further discussion.