emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103444: * lisp/facemenu.el (list-col


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103444: * lisp/facemenu.el (list-colors-display): Use with-help-window (Bug#8048).
Date: Sun, 27 Feb 2011 18:53:41 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103444
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2011-02-27 18:53:41 -0500
message:
  * lisp/facemenu.el (list-colors-display): Use with-help-window (Bug#8048).
modified:
  lisp/ChangeLog
  lisp/facemenu.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-02-27 21:26:22 +0000
+++ b/lisp/ChangeLog    2011-02-27 23:53:41 +0000
@@ -1,3 +1,7 @@
+2011-02-27  Chong Yidong  <address@hidden>
+
+       * facemenu.el (list-colors-display): Use with-help-window (Bug#8048).
+
 2011-02-27  Prestoo Ten  <address@hidden>
 
        * term/screen.el: New file (Bug#2650).

=== modified file 'lisp/facemenu.el'
--- a/lisp/facemenu.el  2011-02-21 06:03:36 +0000
+++ b/lisp/facemenu.el  2011-02-27 23:53:41 +0000
@@ -562,17 +562,23 @@
       (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]