(2C-two-columns, 2C-merge): Use window-full-width-p instead of comparing
[bpt/emacs.git] / lisp / textmodes / two-column.el
index 2568b53..eebd192 100644 (file)
@@ -347,8 +347,8 @@ When called again, restores the screen layout with the current buffer
 first and the associated buffer to its right."
   (interactive "P")
   ;; first go to full width, so that we can certainly split into two windows
-  (if (< (window-width) (frame-width))
-      (enlarge-window 99999 t))
+  (unless (window-full-width-p)
+    (enlarge-window 99999 t))
   (split-window-horizontally
    (max window-min-width (min 2C-window-width
                              (- (frame-width) window-min-width))))
@@ -533,8 +533,8 @@ off trailing spaces with \\[delete-trailing-whitespace]."
          (insert 2C-separator string))
        (next-line 1)                   ; add one if necessary
        (set-buffer b2))))
-  (if (< (window-width) (frame-width))
-      (enlarge-window 99999 t)))
+  (unless (window-full-width-p)
+    (enlarge-window 99999 t)))
 \f
 ;;;;; utility functions ;;;;;