From: Kenichi Handa Date: Thu, 8 Dec 2005 01:39:37 +0000 (+0000) Subject: (describe-char): Use *Help-2* buffer if the X-Git-Tag: emacs-pretest-22.0.90~5457 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=086c5b2bca8f99211068d6a5d22c4306db916ef2;p=emacs.git (describe-char): Use *Help-2* buffer if the current buffer is *Help*. Call describe-text-properties while setting the original buffer. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f5ba9ceee7d..84232e0a2be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-12-08 Kenichi Handa + + * descr-text.el (describe-char): Use *Help-2* buffer if the + current buffer is *Help*. Call describe-text-properties while + setting the original buffer. + 2005-12-07 Bill Wohler * files.el (auto-mode-alist): Remove mh-letter-mode. Unnecessary, diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 547970a585b..25c81555ee8 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -464,6 +464,9 @@ 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*")) item-list max-width unicode) (if (or (< char 256) @@ -616,7 +619,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*" + (with-output-to-temp-buffer help-buf (with-current-buffer standard-output (set-buffer-multibyte multibyte-p) (let ((formatter (format "%%%ds:" max-width))) @@ -636,18 +639,17 @@ as well as widgets, buttons, overlays, and text properties." (insert " " clm))) (insert "\n")))) - (save-excursion - (goto-char (point-min)) - (re-search-forward "character:[ \t\n]+") - (setq pos (point))) - (let ((end (+ pos (length char-description)))) - (if overlays + (when overlays + (save-excursion + (goto-char (point-min)) + (re-search-forward "character:[ \t\n]+") + (let* ((end (+ (point) (length char-description)))) (mapc #'(lambda (props) - (let ((o (make-overlay pos end))) + (let ((o (make-overlay (point) end))) (while props (overlay-put o (car props) (nth 1 props)) (setq props (cddr props))))) - overlays))) + overlays)))) (when disp-vector (insert @@ -720,7 +722,9 @@ as well as widgets, buttons, overlays, and text properties." (insert "\nSee the variable `reference-point-alist' for " "the meaning of the rule.\n")) - (describe-text-properties pos (current-buffer)) + (save-excursion + (set-buffer orig-buf) + (describe-text-properties pos help-buf)) (describe-text-mode))))) (defalias 'describe-char-after 'describe-char)