From 25a3c9d12e40f4f5fa273d566251935ebcc8a7f9 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 12 Dec 2005 16:50:39 +0000 Subject: [PATCH] (describe-char): Rework last fix to solve the problem is the same way it's solved for everything else in that function (i.e. by extracting the info before setting up the *Help* buffer). --- lisp/ChangeLog | 6 ++++++ lisp/descr-text.el | 16 +++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2a6818dc99c..57af777b7f0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-12-12 Stefan Monnier + + * descr-text.el (describe-char): Rework last fix to solve the problem + is the same way it's solved for everything else in that function + (i.e. by extracting the info before setting up the *Help* buffer). + 2005-12-12 Kim F. Storm * subr.el (version-regexp-alist): Allow space as separator before diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 25c81555ee8..f646a470ef4 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -464,9 +464,13 @@ as well as widgets, buttons, overlays, and text properties." (single-key-description char) (string-to-multibyte (char-to-string char))))) - (orig-buf (current-buffer)) - (help-buf (if (eq orig-buf (get-buffer "*Help*")) - "*Help-2*" "*Help*")) + (text-props-desc + (let ((tmp-buf (generate-new-buffer " *text-props*"))) + (unwind-protect + (progn + (describe-text-properties pos tmp-buf) + (with-current-buffer tmp-buf (buffer-string))) + (kill-buffer tmp-buf)))) item-list max-width unicode) (if (or (< char 256) @@ -619,7 +623,7 @@ 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))) - (with-output-to-temp-buffer help-buf + (with-output-to-temp-buffer "*Help*" (with-current-buffer standard-output (set-buffer-multibyte multibyte-p) (let ((formatter (format "%%%ds:" max-width))) @@ -722,9 +726,7 @@ as well as widgets, buttons, overlays, and text properties." (insert "\nSee the variable `reference-point-alist' for " "the meaning of the rule.\n")) - (save-excursion - (set-buffer orig-buf) - (describe-text-properties pos help-buf)) + (if text-props-desc (insert text-props-desc)) (describe-text-mode))))) (defalias 'describe-char-after 'describe-char) -- 2.39.2