(vc-svn-admin-directory): New var.
[bpt/emacs.git] / lisp / descr-text.el
index 663ec8d..6200be6 100644 (file)
@@ -1,7 +1,7 @@
 ;;; descr-text.el --- describe text mode
 
 ;; Copyright (C) 1994, 1995, 1996, 2001, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Boris Goldowsky <boris@gnu.org>
 ;; Maintainer: FSF
@@ -60,7 +60,7 @@
              (t t))
        (insert pp)
       (insert-text-button
-       "show" 'action `(lambda (&rest ignore)
+       "[Show]" 'action `(lambda (&rest ignore)
                        (with-output-to-temp-buffer
                            "*Pp Eval Output*"
                          (princ ',pp)))
@@ -90,7 +90,9 @@ into help buttons that call `describe-text-category' or
                         (describe-text-category ',value))
              'help-echo "mouse-2, RET: describe this category"))
             ((memq key '(face font-lock-face mouse-face))
-            (insert (concat "`" (format "%S" value) "'")))
+            (insert-text-button
+             (format "%S" value)
+             'type 'help-face 'help-args (list value)))
             ((widgetp value)
             (describe-text-widget value))
            (t
@@ -161,8 +163,8 @@ otherwise."
       ;; Buttons
       (when (and button (not (widgetp wid-button)))
        (newline)
-       (insert "Here is a " (format "%S" button-type)
-               " button labeled `" button-label "'.\n\n"))
+       (insert "Here is a `" (format "%S" button-type)
+               "' button labeled `" button-label "'.\n\n"))
       ;; Overlays
       (when overlays
        (newline)
@@ -404,15 +406,13 @@ character)")
 
 \f
 ;;;###autoload
-(defun describe-char (pos &optional buf)
+(defun describe-char (pos)
   "Describe the character after POS (interactively, the character after point).
 The information includes character code, charset and code points in it,
 syntax, category, how the character is encoded in a file,
 character composition information (if relevant),
 as well as widgets, buttons, overlays, and text properties."
   (interactive "d")
-  (let ((help-buffer (help-buffer)))
-  (with-current-buffer  (if buf buf (current-buffer))
   (if (>= pos (point-max))
       (error "No character follows specified position"))
   (let* ((char (char-after pos))
@@ -464,8 +464,8 @@ as well as widgets, buttons, overlays, and text properties."
             ,(let ((split (split-char char)))
                `(insert-text-button
                  ,(if (= (charset-dimension charset) 1)
-                      (format "%d" (nth 1 split))
-                    (format "%d %d" (nth 1 split)
+                      (format "#x%02X" (nth 1 split))
+                    (format "#x%02X #x%02X" (nth 1 split)
                             (nth 2 split)))
                  'action (lambda (&rest ignore)
                            (list-charset-chars ',charset)
@@ -507,7 +507,7 @@ as well as widgets, buttons, overlays, and text properties."
                                      key-list " or ")
                           "with"
                           `(insert-text-button
-                            ,(symbol-name current-input-method)
+                            ,current-input-method
                             'type 'help-input-method
                             'help-args '(,current-input-method))))))
            ("buffer code"
@@ -578,7 +578,9 @@ as well as widgets, buttons, overlays, and text properties."
                          ((and (< char 32) (not (memq char '(9 10))))
                           'escape-glyph)))))
                (if face (list (list "hardcoded face"
-                                    (concat "`" (symbol-name face) "'")))))
+                                    `(insert-text-button
+                                      ,(symbol-name face)
+                                      'type 'help-face 'help-args '(,face))))))
            ,@(let ((unicodedata (and unicode
                                      (describe-char-unicode-data unicode))))
                (if unicodedata
@@ -586,10 +588,8 @@ as well as widgets, buttons, overlays, and text properties."
     (setq max-width (apply #'max (mapcar #'(lambda (x)
                                             (if (cadr x) (length (car x)) 0))
                                         item-list)))
-    (help-setup-xref
-     (list #'describe-char pos (if buf buf (current-buffer)))
-     (interactive-p))
-    (with-output-to-temp-buffer help-buffer
+    (help-setup-xref nil (interactive-p))
+    (with-output-to-temp-buffer (help-buffer)
       (with-current-buffer standard-output
        (set-buffer-multibyte multibyte-p)
        (let ((formatter (format "%%%ds:" max-width)))
@@ -691,8 +691,9 @@ as well as widgets, buttons, overlays, and text properties."
                  "the meaning of the rule.\n"))
 
         (if text-props-desc (insert text-props-desc))
+       (setq help-xref-stack-item (list 'help-insert-string (buffer-string)))
        (toggle-read-only 1)
-        (print-help-return-message)))))))
+       (print-help-return-message)))))
 
 (defalias 'describe-char-after 'describe-char)
 (make-obsolete 'describe-char-after 'describe-char "22.1")