(U+6215): Apply new conventions for glyph granularity.
[chise/xemacs-chise.git.1] / lisp / help.el
index a764234..1ac1780 100644 (file)
@@ -433,11 +433,7 @@ You should never set this directory, only let-bind it.")
        (format "*%s*" name))
     (format "*%s*" help-buffer-prefix-string)))
 
-;; Use this function for displaying help when C-h something is pressed
-;; or in similar situations.  Do *not* use it when you are displaying
-;; a help message and then prompting for input in the minibuffer --
-;; this macro usually selects the help buffer, which is not what you
-;; want in those situations.
+;; with-displaying-help-buffer
 
 ;; #### Should really be a macro to eliminate the requirement of
 ;; caller to code a lambda form in THUNK -- mrb
@@ -464,7 +460,13 @@ You should never set this directory, only let-bind it.")
 
 (defun with-displaying-help-buffer (thunk &optional name)
   "Form which makes a help buffer with given NAME and evaluates BODY there.
-The actual name of the buffer is generated by the function `help-buffer-name'."
+The actual name of the buffer is generated by the function `help-buffer-name'.
+
+Use this function for displaying help when C-h something is pressed or
+in similar situations.  Do *not* use it when you are displaying a help
+message and then prompting for input in the minibuffer -- this macro
+usually selects the help buffer, which is not what you want in those
+situations."
   (let* ((winconfig (current-window-configuration))
         (was-one-window (one-window-p))
         (buffer-name (help-buffer-name name))
@@ -579,8 +581,11 @@ describes the minor mode."
                   (setq indicator (cdr indicator)))
                 (while (and indicator (symbolp indicator))
                   (setq indicator (symbol-value indicator)))
-                (princ (format "%s minor mode (indicator%s):\n"
-                               pretty-minor-mode indicator))
+                (princ (format "%s minor mode (%s):\n"
+                               pretty-minor-mode
+                               (if indicator
+                                   (format "indicator%s" indicator)
+                                 "no indicator")))
                 (princ (documentation minor-mode))
                 (princ "\n\n----\n\n"))))
         (setq minor-modes (cdr minor-modes)))))
@@ -731,7 +736,7 @@ of the key sequence that ran this command."
 (defun view-emacs-news ()
   "Display info on recent changes to XEmacs."
   (interactive)
-  (Help-find-file (locate-data-file "NEWS")))
+  (Help-find-file (expand-file-name "NEWS" data-directory)))
 
 (defun xemacs-www-page ()
   "Go to the XEmacs World Wide Web page."
@@ -1070,7 +1075,8 @@ part of the documentation of internal subroutines."
   (let ((doc (condition-case nil
                 (or (documentation function)
                     (gettext "not documented"))
-              (void-function ""))))
+              (void-function "(alias for undefined function)")
+              (error "(unexpected error from `documention')"))))
     (if (and strip-arglist
             (string-match "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'" doc))
        (setq doc (substring doc 0 (match-beginning 0))))
@@ -1090,7 +1096,7 @@ part of the documentation of internal subroutines."
           (princ object)
           (put-nonduplicable-text-property
            pos (marker-position standard-output) 'face face buf)))
-       (t princ object)))
+       (t (princ object))))
 
 ;; replacement for `prin1' that puts the text in the specified face,
 ;; if possible
@@ -1106,7 +1112,7 @@ part of the documentation of internal subroutines."
           (prin1 object)
           (put-nonduplicable-text-property
            pos (marker-position standard-output) 'face face buf)))
-       (t prin1 object)))
+       (t (prin1 object))))
 
 (defvar help-symbol-regexp
   (let ((sym-char "[+a-zA-Z0-9_:*]")
@@ -1180,9 +1186,13 @@ part of the documentation of internal subroutines."
                         (documentation-property sym
                                                 'variable-documentation t)))
               (fun (and sym (fboundp sym)
-                        (documentation sym t))))
+                        (condition-case nil
+                            (documentation sym t)
+                          (void-function "(alias for undefined function)")
+                          (error "(unexpected error from `documention')")))))
          (when (or var fun)
            (let ((ex (make-extent b e)))
+             (require 'hyper-apropos)
              (set-extent-property ex 'mouse-face 'highlight)
              (set-extent-property ex 'help-symbol sym)
              (set-extent-property ex 'face 'hyper-apropos-hyperlink)