emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toggling buffer-local variables from Options menu on menu bar


From: Nick Roberts
Subject: Re: Toggling buffer-local variables from Options menu on menu bar
Date: Sun, 3 Dec 2006 21:01:16 +1300

 >  > Could you fix the doc string of the command that sets truncate-lines
 >  > in the current buffer, so that it clearly says it applies
 >  > to the current buffer?
 > 
 > Currently the menu item name is more clear than the doc/help string.  I could
 > duplicate them but this makes the help string a bit pointless.  However my
 > original point was that buffer-local options shouldn't be on the menu bar.
 > I think this arrangement is confusing even with clear doc strings.

I think the fix below is a good one.  With it, Truncate Long Lines on the menu
bar sets the default value just like Case Insensitive Search currently does.
I'm posting it here first as it changes behaviour from Emacs 21. 


-- 
Nick                                           http://www.inet.net.nz/~nickrob


*** menu-bar.el 02 Dec 2006 10:37:27 +1300      1.298
--- menu-bar.el 03 Dec 2006 20:52:03 +1300      
***************
*** 1037,1048 ****
                :button (:toggle . (if (listp text-mode-hook)
                                     (member 'turn-on-auto-fill text-mode-hook)
                                   (eq 'turn-on-auto-fill text-mode-hook)))))
  (define-key menu-bar-options-menu [truncate-lines]
!   '(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)))
  
  (define-key menu-bar-options-menu [highlight-separator]
    '("--"))
--- 1037,1048 ----
                :button (:toggle . (if (listp text-mode-hook)
                                     (member 'turn-on-auto-fill text-mode-hook)
                                   (eq 'turn-on-auto-fill text-mode-hook)))))
+ 
  (define-key menu-bar-options-menu [truncate-lines]
!   (menu-bar-make-toggle toggle-default-truncate-lines truncate-lines
!           "Truncate Long Lines"
!           "Truncate Long Lines %s for buffers without local setting"
!           "Truncate Long Lines for buffers without local setting"))
  
  (define-key menu-bar-options-menu [highlight-separator]
    '("--"))

*** simple.el   28 Nov 2006 19:15:58 +1300      1.836
--- simple.el   03 Dec 2006 20:45:47 +1300      
***************
*** 4329,4335 ****
  (defvaralias 'default-indicate-unused-lines 'default-indicate-empty-lines)
  
  (defun toggle-truncate-lines (&optional arg)
!   "Toggle whether to fold or truncate long lines on the screen.
  With arg, truncate long lines iff arg is positive.
  Note that in side-by-side windows, truncation is always enabled."
    (interactive "P")
--- 4329,4335 ----
  (defvaralias 'default-indicate-unused-lines 'default-indicate-empty-lines)
  
  (defun toggle-truncate-lines (&optional arg)
!   "Toggle whether to fold or truncate long lines for the current buffer.
  With arg, truncate long lines iff arg is positive.
  Note that in side-by-side windows, truncation is always enabled."
    (interactive "P")





reply via email to

[Prev in Thread] Current Thread [Next in Thread]