]> git.eshelyaron.com Git - emacs.git/commitdiff
More conversions to buffer display specifiers
authorMartin Rudalics <rudalics@gmx.at>
Fri, 5 Nov 2010 07:20:33 +0000 (08:20 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Fri, 5 Nov 2010 07:20:33 +0000 (08:20 +0100)
lisp/ChangeLog
lisp/cus-edit.el
lisp/ehelp.el
lisp/play/decipher.el
lisp/vc/ediff-util.el

index be489c74df7a48af747a5aab19e06363af2db06c..cc6aa6d10ab43be64232ed49c5d1b097d8ef3935 100644 (file)
        * buff-menu.el (Buffer-menu-switch-other-window)
        (Buffer-menu-2-window): Use buffer display specifiers.
 
+       * cus-edit.el (top-level): Remove autoloaded add-hook for
+       same-window-regexps.
+       (customize-group, customize-face): New optional argument
+       OTHER-WINDOW.  Use buffer display specifiers.  Call
+       custom-buffer-create with OTHER-WINDOW argument t.
+       (customize-group-other-window): Call customize-group with
+       OTHER-WINDOW argument t.
+       (customize-face-other-window): Call customize-face with
+       OTHER-WINDOW argument t.
+       (custom-buffer-create): New optional argument OTHER-WINDOW.
+       (custom-buffer-create-other-window): Call
+       pop-to-buffer-other-window.
+       (customize-browse): Call pop-to-buffer-same-window.
+
+       * play/decipher.el (decipher-display-range): Use
+       pop-to-buffer-other-window.
+       (decipher-display-stats-buffer): Use
+       display-buffer-other-window.
+
+       * vc/ediff-util.el (ediff-clone-buffer-for-region-comparison):
+       Use pop-to-buffer-other-window.
+
+       * ehelp.el (with-electric-help): Use pop-to-buffer-other-window.
+
 2010-11-02  Martin Rudalics  <rudalics@gmx.at>
 
        * window.el (display-buffer-names): Describe `not-this-window' and
index 61e6881139afef16d56704875d004c5b3eb66c45..bcb70c6cc60b05ca6b61d5e0fca7a22cfa796e32 100644 (file)
@@ -700,8 +700,6 @@ If `last', order groups after non-groups."
                 (const :tag "none" nil))
   :group 'custom-menu)
 
-;;;###autoload (add-hook 'same-window-regexps (purecopy "\\`\\*Customiz.*\\*\\'"))
-
 (defun custom-sort-items (items sort-alphabetically order-groups)
   "Return a sorted copy of ITEMS.
 ITEMS should be a `custom-group' property.
@@ -1074,8 +1072,9 @@ then prompt for the MODE to customize."
                      t)))
 
 ;;;###autoload
-(defun customize-group (&optional group)
-  "Customize GROUP, which must be a customization group."
+(defun customize-group (&optional group other-window)
+  "Customize GROUP, which must be a customization group.
+OTHER-WINDOW non-nil means do this in another window."
   (interactive (list (customize-read-group)))
   (when (stringp group)
     (if (string-equal "" group)
@@ -1084,21 +1083,21 @@ then prompt for the MODE to customize."
   (let ((name (format "*Customize Group: %s*"
                      (custom-unlispify-tag-name group))))
     (if (get-buffer name)
-        (pop-to-buffer name)
+        (if other-window
+           (pop-to-buffer-other-window name)
+         (pop-to-buffer-same-window name))
       (custom-buffer-create
        (list (list group 'custom-group))
        name
        (concat " for group "
-               (custom-unlispify-tag-name group))))))
+               (custom-unlispify-tag-name group))
+       other-window))))
 
 ;;;###autoload
 (defun customize-group-other-window (&optional group)
   "Customize GROUP, which must be a customization group, in another window."
   (interactive (list (customize-read-group)))
-  (let ((pop-up-windows t)
-        (same-window-buffer-names nil)
-        (same-window-regexps nil))
-    (customize-group group)))
+  (customize-group group t))
 
 ;;;###autoload
 (defalias 'customize-variable 'customize-option)
@@ -1279,8 +1278,10 @@ Emacs that is associated with version VERSION of PACKAGE."
             (< minor1 minor2)))))
 
 ;;;###autoload
-(defun customize-face (&optional face)
+(defun customize-face (&optional face other-window)
   "Customize FACE, which should be a face name or nil.
+OTHER-WINDOW non-nil means do this in another window.
+
 If FACE is nil, customize all faces.  If FACE is actually a
 face-alias, customize the face it is aliased to.
 
@@ -1296,7 +1297,7 @@ suggest to customize that face, if it's customizable."
        (custom-sort-items
         (mapcar (lambda (s) (list s 'custom-face)) face)
         t nil)
-       "*Customize Faces*")
+       "*Customize Faces*" other-window)
     ;; If FACE is actually an alias, customize the face it is aliased to.
     (if (get face 'face-alias)
         (setq face (get face 'face-alias)))
@@ -1305,7 +1306,8 @@ suggest to customize that face, if it's customizable."
     (custom-buffer-create
      (list (list face 'custom-face))
      (format "*Customize Face: %s*"
-             (custom-unlispify-tag-name face)))))
+             (custom-unlispify-tag-name face))
+     nil other-window)))
 
 ;;;###autoload
 (defun customize-face-other-window (&optional face)
@@ -1315,10 +1317,7 @@ If FACE is actually a face-alias, customize the face it is aliased to.
 Interactively, when point is on text which has a face specified,
 suggest to customize that face, if it's customizable."
   (interactive (list (read-face-name "Customize face" "all faces" t)))
-  (let ((pop-up-windows t)
-        (same-window-buffer-names nil)
-        (same-window-regexps nil))
-    (customize-face face)))
+  (customize-face face t))
 
 (defalias 'customize-customized 'customize-unsaved)
 
@@ -1498,13 +1497,17 @@ not for everybody."
        buf))))
 
 ;;;###autoload
-(defun custom-buffer-create (options &optional name description)
+(defun custom-buffer-create (options &optional name description other-window)
   "Create a buffer containing OPTIONS.
 Optional NAME is the name of the buffer.
 OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where
 SYMBOL is a customization option, and WIDGET is a widget for editing
 that option."
-  (pop-to-buffer (custom-get-fresh-buffer (or name "*Customization*")))
+  (if other-window
+      (pop-to-buffer-other-window
+       (custom-get-fresh-buffer (or name "*Customization*")))
+    (pop-to-buffer-same-window
+     (custom-get-fresh-buffer (or name "*Customization*"))))
   (custom-buffer-create-internal options description))
 
 ;;;###autoload
@@ -1516,11 +1519,8 @@ OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where
 SYMBOL is a customization option, and WIDGET is a widget for editing
 that option."
   (unless name (setq name "*Customization*"))
-  (let ((pop-up-windows t)
-       (same-window-buffer-names nil)
-       (same-window-regexps nil))
-    (pop-to-buffer (custom-get-fresh-buffer name))
-    (custom-buffer-create-internal options description)))
+  (pop-to-buffer-other-window (custom-get-fresh-buffer name))
+  (custom-buffer-create-internal options description))
 
 (defcustom custom-reset-button-menu nil
   "If non-nil, only show a single reset button in customize buffers.
@@ -1695,7 +1695,7 @@ Otherwise use brackets."
   (unless group
     (setq group 'emacs))
   (let ((name "*Customize Browser*"))
-    (pop-to-buffer (custom-get-fresh-buffer name)))
+    (pop-to-buffer-same-window (custom-get-fresh-buffer name)))
   (Custom-mode)
   (widget-insert (format "\
 %s buttons; type RET or click mouse-1
index 63ec3838d327ad64bc79ddb758a8ccb8f063b2e5..e1978fd995df49d32894491aaadf5ebc1f998970 100644 (file)
@@ -145,8 +145,7 @@ BUFFER is put back into its original major mode."
          (save-excursion
            (when one
             (goto-char (window-start (selected-window))))
-           (let ((pop-up-windows t))
-             (pop-to-buffer buffer))
+          (pop-to-buffer-other-window buffer)
            (with-current-buffer buffer
              (when (and minheight (< (window-height) minheight))
               (enlarge-window (- minheight (window-height))))
index 34119a77a7551869a27c26e7b1784f318cf9278e..aec370d267cf2ef9cf68350cbc65f18a4fd54ab2 100644 (file)
@@ -711,10 +711,9 @@ START and END are positions in the statistics buffer.  Makes the
 statistics buffer visible and sizes the window to just fit the
 displayed text, but leaves the current window selected."
   (let ((stats-buffer (decipher-stats-buffer))
-        (current-window (selected-window))
-        (pop-up-windows t))
+        (current-window (selected-window)))
     (or (eq (current-buffer) stats-buffer)
-        (pop-to-buffer stats-buffer))
+        (pop-to-buffer-other-window stats-buffer))
     (goto-char start)
     (or (one-window-p t)
         (enlarge-window (- (1+ (count-lines start end)) (window-height))))
@@ -1001,12 +1000,9 @@ Creates the statistics buffer if it doesn't exist."
 
 (defun decipher-display-stats-buffer ()
   "Make the statistics buffer visible, but do not select it."
-  (let ((stats-buffer (decipher-stats-buffer))
-        (current-window (selected-window)))
+  (let ((stats-buffer (decipher-stats-buffer)))
     (or (eq (current-buffer) stats-buffer)
-        (progn
-          (pop-to-buffer stats-buffer)
-          (select-window current-window)))))
+        (display-buffer-other-window stats-buffer))))
 
 (defun decipher-stats-buffer (&optional create)
   "Return the buffer used for decipher statistics.
index b36599249a5e713ce47baf48578bc3f9dd1b36a2..a211c773efd095c77b6ee8e70230a54a81612d12 100644 (file)
@@ -3334,13 +3334,12 @@ Without an argument, it saves customized diff argument, if available
 ;; idea suggested by Hannu Koivisto <azure@iki.fi>
 (defun ediff-clone-buffer-for-region-comparison (buff region-name)
   (let ((cloned-buff (ediff-make-cloned-buffer buff region-name))
-       (pop-up-windows t)
        wind
        other-wind
        msg-buf)
     (ediff-with-current-buffer cloned-buff
       (setq ediff-temp-indirect-buffer t))
-    (pop-to-buffer cloned-buff)
+    (pop-to-buffer-other-window cloned-buff)
     (setq wind (ediff-get-visible-buffer-window cloned-buff))
     (select-window wind)
     (delete-other-windows)