changeset 93962:a505b9f92df3

(menu-bar-options-menu) <truncate-lines>: Respect truncate-partial-width-windows in non-full windows, with regards to :toggle and :enable state.
author Glenn Morris <rgm@gnu.org>
date Thu, 10 Apr 2008 07:51:56 +0000
parents e03345b7622b
children a482aa798185
files lisp/menu-bar.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Thu Apr 10 07:49:07 2008 +0000
+++ b/lisp/menu-bar.el	Thu Apr 10 07:51:56 2008 +0000
@@ -1050,8 +1050,13 @@
   '(menu-item "Truncate Long Lines in this Buffer"
 	      toggle-truncate-lines
 	      :help "Truncate long lines on the screen"
-	      :button (:toggle . truncate-lines)
-	      :enable (menu-bar-menu-frame-live-and-visible-p)))
+	      :button (:toggle . (if (or (window-full-width-p)
+					 (not truncate-partial-width-windows))
+				     truncate-lines
+				   truncate-partial-width-windows))
+	      :enable (and (menu-bar-menu-frame-live-and-visible-p)
+			   (or (window-full-width-p)
+			       (not truncate-partial-width-windows)))))
 
 (define-key menu-bar-options-menu [highlight-separator]
   '("--"))