From 02f32cf00f49b2c031935ddcec4a50f2b91792ea Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 21 Apr 2004 01:27:39 +0000 Subject: [PATCH] (describe-char): Make it work on *Help* buffer. --- lisp/ChangeLog | 4 ++++ lisp/descr-text.el | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0dd96b68b3..fe4eaccabfc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-04-21 Kenichi Handa + + * descr-text.el (describe-char): Make it work on *Help* buffer. + 2004-04-21 Kim F. Storm * image.el (insert-image): Add optional SLICE arg. diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 30ef3dcf05e..c73cfeb02c3 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -474,6 +474,7 @@ as well as widgets, buttons, overlays, and text properties." 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 @@ as well as widgets, buttons, overlays, and text properties." (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 @@ as well as widgets, buttons, overlays, and text properties." (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") -- 2.39.2