emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104607: Have enlarge-/shrink-window


From: martin rudalics
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104607: Have enlarge-/shrink-window not report errors in most cases (bug#8862).
Date: Thu, 16 Jun 2011 16:01:46 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104607
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Thu 2011-06-16 16:01:46 +0200
message:
  Have enlarge-/shrink-window not report errors in most cases (bug#8862).
  
  * window.el (enlarge-window, shrink-window): Don't report an error
  when the window can't be resized as requested (Bug#8862).
modified:
  lisp/ChangeLog
  lisp/window.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-06-16 09:21:56 +0000
+++ b/lisp/ChangeLog    2011-06-16 14:01:46 +0000
@@ -11,6 +11,8 @@
        display-buffer-pop-up-frame.
        (display-buffer-pop-up-frame): Never pop up a frame in
        noninteractive mode (Bug#8857).
+       (enlarge-window, shrink-window): Don't report an error when the
+       window can't be resized as requested (Bug#8862).
 
 2011-06-15  Stefan Monnier  <address@hidden>
 

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2011-06-16 09:21:56 +0000
+++ b/lisp/window.el    2011-06-16 14:01:46 +0000
@@ -2044,7 +2044,18 @@
 negative, shrink selected window by -DELTA lines or columns.
 Return nil."
   (interactive "p")
-  (resize-window (selected-window) delta horizontal))
+  (cond
+   ((zerop delta))
+   ((window-size-fixed-p nil horizontal)
+    (error "Selected window has fixed size"))
+   ((window-resizable-p nil delta horizontal)
+    (resize-window nil delta horizontal))
+   (t
+    (resize-window
+     nil (if (> delta 0)
+            (window-max-delta nil horizontal)
+          (- (window-min-delta nil horizontal)))
+     horizontal))))
 
 (defun shrink-window (delta &optional horizontal)
   "Make selected window DELTA lines smaller.
@@ -2054,7 +2065,18 @@
 negative, enlarge selected window by -DELTA lines or columns.
 Return nil."
   (interactive "p")
-  (resize-window (selected-window) (- delta) horizontal))
+  (cond
+   ((zerop delta))
+   ((window-size-fixed-p nil horizontal)
+    (error "Selected window has fixed size"))
+   ((window-resizable-p nil (- delta) horizontal)
+    (resize-window nil (- delta) horizontal))
+   (t
+    (resize-window
+     nil (if (> delta 0)
+            (- (window-min-delta nil horizontal))
+          (window-max-delta nil horizontal))
+     horizontal))))
 
 (defun maximize-window (&optional window)
   "Maximize WINDOW.
@@ -4932,7 +4954,7 @@
           (setq entry (assq specifiers display-buffer-macro-specifiers)))
       ;; A macro specifier.
       (cdr entry))
-     ((memq pop-up-frames '(nil unset))
+     ((with-no-warnings (memq pop-up-frames '(nil unset)))
       ;; Pop up a new window.
       (cdr (assq 'other-window display-buffer-macro-specifiers)))
      (t


reply via email to

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