;;; help-fns.el --- Complex help functions
;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001,
-;; 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+;; 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: help, internal
(setq val (completing-read (if fn
(format "Describe function (default %s): " fn)
"Describe function: ")
- obarray 'fboundp t nil nil (symbol-name fn)))
+ obarray 'fboundp t nil nil
+ (and fn (symbol-name fn))))
(list (if (equal val "")
fn (intern val)))))
(if (null function)
(concat "src/" file)
file)))))
-;;;###autoload
(defface help-argument-name '((((supports :slant italic)) :inherit italic))
"Face to highlight argument names in *Help* buffers."
:group 'help)
"\\)"
"\\(?:es\\|s\\|th\\)?" ; for ARGth, ARGs
"\\(?:-[a-z0-9-]+\\)?" ; for ARG-xxx, ARG-n
+ "\\(?:-[{([<`\"].*?\\)?"; for ARG-{x}, (x), <x>, [x], `x'
"\\>") ; end of word
(help-default-arg-highlight arg)
doc t t 1)))))
(format "\nMacro: %s" (format-kbd-macro def)))
(t "[Missing arglist. Please make a bug report.]")))
(high (help-highlight-arguments use doc)))
- (insert (car high) "\n")
+ (let ((fill-begin (point)))
+ (insert (car high) "\n")
+ (fill-region fill-begin (point)))
(setq doc (cdr high))))
(let ((obsolete (and
;; function might be a lambda construct.
(format
"Describe variable (default %s): " v)
"Describe variable: ")
- obarray 'boundp t nil nil
+ obarray
+ '(lambda (vv)
+ (or (boundp vv)
+ (get vv 'variable-documentation)))
+ t nil nil
(if (symbolp v) (symbol-name v))))
(list (if (equal val "")
v (intern val)))))
(help-xref-button 1 'help-variable-def
variable file-name)))
(if valvoid
- (princ "It is void as a variable.\n")
+ (princ "It is void as a variable.")
(princ "Its ")))
(if valvoid
- (princ " is void as a variable.\n")
+ (princ " is void as a variable.")
(princ "'s "))))
(if valvoid
nil
(indirect-variable variable)
(error variable)))
(obsolete (get variable 'byte-obsolete-variable))
+ (safe-var (get variable 'safe-local-variable))
(doc (or (documentation-property variable 'variable-documentation)
(documentation-property alias 'variable-documentation))))
(unless (eq alias variable)
(princ (if (stringp (car obsolete)) (car obsolete)
(format "use `%s' instead." (car obsolete))))
(terpri))
+ (when safe-var
+ (princ "This variable is safe as a file local variable ")
+ (princ "if its value\nsatisfies the predicate ")
+ (princ (if (byte-code-function-p safe-var)
+ "which is byte-compiled expression.\n"
+ (format "`%s'.\n" safe-var)))
+ (terpri))
(princ "Documentation:\n")
(princ (or doc "Not documented as a variable.")))
;; Make a link to customize if this variable can be customized.