aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-07-10 04:27:32 +0000
committerChong Yidong2008-07-10 04:27:32 +0000
commitcf37ed4f2308302d08aba5735ef99fa4ad6689f3 (patch)
tree800abe9a1664de9fa2ce04942b07aa3df6ef1eb7
parent815776895dc9e73e1ff456c1d3c25cc174682c82 (diff)
downloademacs-cf37ed4f2308302d08aba5735ef99fa4ad6689f3.tar.gz
emacs-cf37ed4f2308302d08aba5735ef99fa4ad6689f3.zip
(truncated-partial-width-window-p): New function.
-rw-r--r--lisp/window.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 5eafb2a1ac9..5490f7bd293 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1617,6 +1617,22 @@ This may be a useful alternative binding for \\[delete-other-windows]
1617 (push w delenda)))) 1617 (push w delenda))))
1618 (mapc 'delete-window delenda))) 1618 (mapc 'delete-window delenda)))
1619 1619
1620(defun truncated-partial-width-window-p (&optional window)
1621 "Non-nil if lines in WINDOW are specifically truncated due to its width.
1622This returns nil if WINDOW is not a partial-width window
1623 (regardless of the value of `truncate-lines').
1624Otherwise, consult the value of `truncate-partial-width-windows'
1625 for the buffer shown in WINDOW.
1626If WINDOW is nil, use the selected window."
1627 (unless window
1628 (setq window (selected-window)))
1629 (unless (window-full-width-p window)
1630 (let ((t-p-w-w (buffer-local-value 'truncate-partial-width-windows
1631 (window-buffer window))))
1632 (if (integerp t-p-w-w)
1633 (< (window-width window) t-p-w-w)
1634 t-p-w-w))))
1635
1620(define-key ctl-x-map "2" 'split-window-vertically) 1636(define-key ctl-x-map "2" 'split-window-vertically)
1621(define-key ctl-x-map "3" 'split-window-horizontally) 1637(define-key ctl-x-map "3" 'split-window-horizontally)
1622(define-key ctl-x-map "}" 'enlarge-window-horizontally) 1638(define-key ctl-x-map "}" 'enlarge-window-horizontally)