(menu-bar-options-menu) <truncate-lines>:
authorGlenn Morris <rgm@gnu.org>
Thu, 10 Apr 2008 07:52:10 +0000 (07:52 +0000)
committerGlenn Morris <rgm@gnu.org>
Thu, 10 Apr 2008 07:52:10 +0000 (07:52 +0000)
Respect truncate-partial-width-windows in non-full windows, with regards to
:toggle and :enable state.

lisp/ChangeLog
lisp/menu-bar.el

index 6f7c05c..84fa0a0 100644 (file)
 
 2008-04-10  Glenn Morris  <rgm@gnu.org>
 
+       * menu-bar.el (menu-bar-options-menu) <truncate-lines>:
+       Respect truncate-partial-width-windows in non-full windows,
+       with regards to :toggle and :enable state.
+
        * simple.el (toggle-truncate-lines): Doc fix.
 
        * Makefile.in (MH_E_DIR): New variable.
index 2eaed4c..00f7678 100644 (file)
@@ -1050,8 +1050,13 @@ mail status in mode line"))
   '(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]
   '("--"))