diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2011-02-27 18:53:41 -0500 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-02-27 18:53:41 -0500 |
commit | df7f0d0b10ce31a6f1a8b7e979e120c695699d5a (patch) | |
tree | abf96304067fe460bfde6e5c841034a4114e4033 /lisp/facemenu.el | |
parent | 52eb77a6ad5df5980bc8c6d7ad7ee802feb8add3 (diff) | |
download | emacs-df7f0d0b10ce31a6f1a8b7e979e120c695699d5a.tar.gz |
* lisp/facemenu.el (list-colors-display): Use with-help-window (Bug#8048).
Diffstat (limited to 'lisp/facemenu.el')
-rw-r--r-- | lisp/facemenu.el | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 360383aa32b..97862afb678 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -562,17 +562,23 @@ You can change the color sort order by customizing `list-colors-sort'." (let ((lc (nthcdr (1- (display-color-cells)) list))) (if lc (setcdr lc nil))))) - (let ((buf (get-buffer-create "*Colors*"))) - (with-current-buffer buf + (unless buffer-name + (setq buffer-name "*Colors*")) + (with-help-window buffer-name + (with-current-buffer standard-output (erase-buffer) - (setq truncate-lines t) - ;; Display buffer before generating content to allow - ;; `list-colors-print' to get the right window-width. + (setq truncate-lines t))) + (let ((buf (get-buffer buffer-name)) + (inhibit-read-only t)) + ;; Display buffer before generating content, to allow + ;; `list-colors-print' to get the right window-width. + (with-selected-window (or (get-buffer-window buf t) (selected-window)) + (with-current-buffer buf + (list-colors-print list callback) + (set-buffer-modified-p nil))) + (when callback (pop-to-buffer buf) - (list-colors-print list callback) - (set-buffer-modified-p nil))) - (if callback - (message "Click on a color to select it."))) + (message "Click on a color to select it.")))) (defun list-colors-print (list &optional callback) (let ((callback-fn |