changeset 55036:eec7e5483b20

(describe-char): Make it work on *Help* buffer.
author Kenichi Handa <handa@m17n.org>
date Wed, 21 Apr 2004 01:25:17 +0000
parents 2391f8a5bebc
children 05cf719ab007
files lisp/descr-text.el
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/descr-text.el	Tue Apr 20 23:16:57 2004 +0000
+++ b/lisp/descr-text.el	Wed Apr 21 01:25:17 2004 +0000
@@ -474,6 +474,7 @@
 			    standard-display-table))
 	 (disp-vector (and display-table (aref display-table char)))
 	 (multibyte-p enable-multibyte-characters)
+	 text-prop-description
 	 item-list max-width unicode)
     (if (eq charset 'unknown)
 	(setq item-list
@@ -582,8 +583,14 @@
 		      (cons (list "Unicode data" " ") unicodedata))))))
     (setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x)))
 					 item-list)))
-    (when (eq (current-buffer) (get-buffer "*Help*"))
-      (error "Can't describe char in Help buffer"))
+    (setq text-prop-description
+	  (with-temp-buffer
+	    (let ((buf (current-buffer)))
+	      (save-excursion
+		(set-buffer buffer)
+		(describe-text-properties pos buf)))
+	    (buffer-string)))
+
     (with-output-to-temp-buffer "*Help*"
       (with-current-buffer standard-output
 	(set-buffer-multibyte multibyte-p)
@@ -658,10 +665,8 @@
 	  (insert "\nSee the variable `reference-point-alist' for "
 		  "the meaning of the rule.\n"))
 
-	(let ((output (current-buffer)))
-	  (with-current-buffer buffer
-	    (describe-text-properties pos output))
-	  (describe-text-mode))))))
+	(insert text-prop-description)
+	(describe-text-mode)))))
 
 (defalias 'describe-char-after 'describe-char)
 (make-obsolete 'describe-char-after 'describe-char "21.5")