]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace condition-case by ignore-errors in window.el.
authorMartin Rudalics <rudalics@gmx.at>
Fri, 5 Nov 2010 19:24:09 +0000 (20:24 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Fri, 5 Nov 2010 19:24:09 +0000 (20:24 +0100)
lisp/ChangeLog
lisp/window.el

index cdf9ec917d474079bc5de5cb12793f801a9a8e58..0019e06e717503a2863021fef221b2d44f66d4ed 100644 (file)
@@ -1,5 +1,10 @@
 2010-11-05  Martin Rudalics  <rudalics@gmx.at>
 
+       * window.el (display-buffer-even-sizes)
+       (display-buffer-adjust-height, display-buffer-adjust-width)
+       (display-buffer-in-new-window, kill-buffer-and-window): Use
+       ignore-errors instead of condition-case.
+
        * electric.el (Electric-pop-up-window): Use buffer display
        specifiers.
 
index a06ab993ccfa8acc82477886ea8da87ebba4963c..6ca959ead6eeceedf2f337ea09c06202bc540324 100644 (file)
@@ -4588,21 +4588,19 @@ larger than WINDOW."
       ;; might fail anyway if there are other windows above or below
       ;; WINDOW and the selected one.  But for a simple two windows
       ;; configuration the present behavior is good enough so why care?
-      (condition-case nil
-         (resize-window
-          window (/ (- (window-total-height) (window-total-height window))
-                    2))
-       (error nil)))
+      (ignore-errors
+       (resize-window
+       window (/ (- (window-total-height) (window-total-height window))
+                 2))))
      ((and (window-iso-combined-p window t)
           ;; Resize iff the selected window is wider than WINDOW.
           (> (window-total-width) (window-total-width window)))
       ;; Don't throw an error if we can't even window widths, see
       ;; comment above.
-      (condition-case nil
-         (resize-window
-          window (/ (- (window-total-width) (window-total-width window))
-                    2) t)
-         (error nil))))))
+      (ignore-errors
+       (resize-window
+       window (/ (- (window-total-width) (window-total-width window))
+                 2) t))))))
 
 (defun display-buffer-adjust-height (window specifiers)
   "Adjust height of WINDOW according to SPECIFIERS.
@@ -4620,9 +4618,7 @@ documentation of `display-buffer-names' for a description."
                   (window-iso-combined-p window))
          (resize-window window delta))))
      ((functionp adjust-height)
-      (condition-case nil
-         (funcall adjust-height window)
-       (error nil))))))
+      (ignore-errors (funcall adjust-height window))))))
 
 (defun display-buffer-adjust-width (window specifiers)
   "Adjust width of WINDOW according to SPECIFIERS.
@@ -4640,9 +4636,7 @@ documentation of `display-buffer-names' for a description."
                   (window-iso-combined-p window t))
          (resize-window window delta t))))
      ((functionp adjust-width)
-      (condition-case nil
-         (funcall adjust-width window)
-       (error nil))))))
+      (ignore-errors (funcall adjust-width window))))))
 
 (defun display-buffer-select-window (window &optional norecord)
   "Select WINDOW  and make sure it's frame is risen."
@@ -4949,10 +4943,8 @@ documentation of `display-buffer-names' for a description."
                           (display-buffer-split-window
                            window side-specifier specifiers))
                          ((functionp side-specifier)
-                          (condition-case nil
-                              (funcall
-                               side-specifier window (cdr specifiers))
-                            (error nil)))))
+                          (ignore-errors
+                           (funcall side-specifier window (cdr specifiers))))))
                   (throw 'done window))))))
       (when window
        ;; Adjust sizes if asked for.
@@ -6011,10 +6003,7 @@ Return non-nil if the window was shrunk, nil otherwise."
   (interactive)
   (let ((window-to-delete (selected-window))
        (buffer-to-kill (current-buffer))
-       (delete-window-hook (lambda ()
-                             (condition-case nil
-                                 (delete-window)
-                               (error nil)))))
+       (delete-window-hook (lambda () (ignore-errors (delete-window)))))
     (unwind-protect
        (progn
          (add-hook 'kill-buffer-hook delete-window-hook t t)
@@ -6025,10 +6014,9 @@ Return non-nil if the window was shrunk, nil otherwise."
                (delete-window))))
       ;; If the buffer is not dead for some reason (probably because
       ;; of a `quit' signal), remove the hook again.
-      (condition-case nil
-         (with-current-buffer buffer-to-kill
-           (remove-hook 'kill-buffer-hook delete-window-hook t))
-       (error nil)))))
+      (ignore-errors
+       (with-current-buffer buffer-to-kill
+        (remove-hook 'kill-buffer-hook delete-window-hook t))))))
 
 (defun quit-window (&optional kill window)
   "Quit WINDOW and bury its buffer.