Browse Source

Maintenance: Better implementation of `fit-window-to-buffer'.

This function now uses `window-full-width-p' to check if the window
has the full width.
Carsten Dominik 16 years ago
parent
commit
703be2056c
2 changed files with 6 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 3 1
      lisp/org-compat.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-01-09  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-compat.el (org-fit-window-to-buffer): Use
+	`window-full-width-p'.
+
 	* org-export-latex.el (org-export-latex-fixed-width): Enforce the
 	space after the colon in short examples.
 

+ 3 - 1
lisp/org-compat.el

@@ -157,7 +157,9 @@ WINDOW defaults to the selected window.  MAX-HEIGHT and MIN-HEIGHT are
 passed through to `fit-window-to-buffer'.  If SHRINK-ONLY is set, call
 `shrink-window-if-larger-than-buffer' instead, the hight limit are
 ignored in this case."
-  (cond ((> (frame-width) (window-width window))
+  (cond ((if (fboundp 'window-full-width-p)
+	     (window-full-width-p window)
+	   (> (frame-width) (window-width window)))
 	 ;; do nothing if another window would suffer
 	 )
 	((and (fboundp 'fit-window-to-buffer) (not shrink-only))