summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLuc Teirlinck <teirllm@auburn.edu>2003-10-19 03:58:43 +0000
committerLuc Teirlinck <teirllm@auburn.edu>2003-10-19 03:58:43 +0000
commit040b2fa358d70e6013a6e6e1dcacdf435c9369dd (patch)
tree3ec151f116996fa94a0bcf2f1782e11a2efe5e9c /lisp
parenta4a6aad0df5b7a6cafc34bc3a5418180e508a79f (diff)
downloademacs-040b2fa358d70e6013a6e6e1dcacdf435c9369dd.tar.gz
emacs-040b2fa358d70e6013a6e6e1dcacdf435c9369dd.tar.bz2
emacs-040b2fa358d70e6013a6e6e1dcacdf435c9369dd.zip
(help-xref-symbol-regexp): Treat newlines as whitespace.
(help-make-xrefs): Only make cross-references for faces if preceded or followed by the word `face'. Do not make a cross-reference for variables without variable documentation, unless preceded by the word `variable'. Update doc string accordingly.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/help-mode.el32
1 files changed, 20 insertions, 12 deletions
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 4ef3072ca53..8e33b08bd42 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -213,7 +213,8 @@ Commands:
"\\(function\\|command\\)\\|"
"\\(face\\)\\|"
"\\(symbol\\)\\|"
- "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)\\s-+\\)?"
+ "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)"
+ "[ \t\n]+\\)?"
;; Note starting with word-syntax character:
"`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'"))
"Regexp matching doc string references to symbols.
@@ -278,7 +279,10 @@ Find cross-reference information in a buffer and activate such cross
references for selection with `help-follow'. Cross-references have
the canonical form `...' and the type of reference may be
disambiguated by the preceding word(s) used in
-`help-xref-symbol-regexp'.
+`help-xref-symbol-regexp'. Faces only get cross-referenced if
+preceded or followed by the word `face'. Variables without
+variable documentation do not get cross-referenced, unless
+preceded by the word `variable'.
If the variable `help-xref-mule-regexp' is non-nil, find also
cross-reference information related to multilingual environment
@@ -342,11 +346,11 @@ that."
(sym (intern-soft data)))
(if sym
(cond
- ((match-string 3) ; `variable' &c
+ ((match-string 3) ; `variable' &c
(and (boundp sym) ; `variable' doesn't ensure
; it's actually bound
(help-xref-button 8 'help-variable sym)))
- ((match-string 4) ; `function' &c
+ ((match-string 4) ; `function' &c
(and (fboundp sym) ; similarly
(help-xref-button 8 'help-function sym)))
((match-string 5) ; `face'
@@ -354,23 +358,27 @@ that."
(help-xref-button 8 'help-face sym)))
((match-string 6)) ; nothing for `symbol'
((match-string 7)
-;; this used:
-;; #'(lambda (arg)
-;; (let ((location
-;; (find-function-noselect arg)))
-;; (pop-to-buffer (car location))
-;; (goto-char (cdr location))))
+;;; this used:
+;;; #'(lambda (arg)
+;;; (let ((location
+;;; (find-function-noselect arg)))
+;;; (pop-to-buffer (car location))
+;;; (goto-char (cdr location))))
(help-xref-button 8 'help-function-def sym))
((and (boundp sym) (fboundp sym))
;; We can't intuit whether to use the
;; variable or function doc -- supply both.
(help-xref-button 8 'help-symbol sym))
- ((boundp sym)
+ ((and
+ (boundp sym)
+ (documentation-property sym
+ 'variable-documentation))
(help-xref-button 8 'help-variable sym))
((fboundp sym)
(help-xref-button 8 'help-function sym))
((facep sym)
- (help-xref-button 8 'help-face sym)))))))
+ (if (save-match-data (looking-at "[ \t\n]+face\\W"))
+ (help-xref-button 8 'help-face sym))))))))
;; An obvious case of a key substitution:
(save-excursion
(while (re-search-forward