aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-09-09 20:04:26 -0700
committerGlenn Morris2010-09-09 20:04:26 -0700
commit639b9d87d2121d3c4b25b6dae18b3a3e4e7de5ef (patch)
tree7dcd5cc6992161f3dc5e6c3e9ac699e79a81f2de
parentc4ae64d106173b3e63581a42e5ffb9ea76b5441d (diff)
downloademacs-639b9d87d2121d3c4b25b6dae18b3a3e4e7de5ef.tar.gz
emacs-639b9d87d2121d3c4b25b6dae18b3a3e4e7de5ef.zip
Close bug#6211.
* lisp/menu-bar.el (menu-bar-options-save): Fix handling of menu-bar and tool-bar modes. (Bug#6211) (menu-bar-mode): Move setting of standard-value after the minor-mode definition, otherwise it seems to have no effect.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/menu-bar.el33
2 files changed, 29 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 20f10b25a83..ec00a671799 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12010-09-10 Glenn Morris <rgm@gnu.org>
2
3 * menu-bar.el (menu-bar-options-save): Fix handling of menu-bar
4 and tool-bar modes. (Bug#6211)
5 (menu-bar-mode): Move setting of standard-value after the
6 minor-mode definition, otherwise it seems to have no effect.
7
12010-09-08 Masatake YAMATO <yamato@redhat.com> 82010-09-08 Masatake YAMATO <yamato@redhat.com>
2 9
3 * progmodes/antlr-mode.el (antlr-font-lock-additional-keywords): 10 * progmodes/antlr-mode.el (antlr-font-lock-additional-keywords):
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 2424647a73f..941ede03996 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -674,13 +674,23 @@ by \"Save Options\" in Custom buffers.")
674 ;; put on a customized-value property. 674 ;; put on a customized-value property.
675 (dolist (elt '(line-number-mode column-number-mode size-indication-mode 675 (dolist (elt '(line-number-mode column-number-mode size-indication-mode
676 cua-mode show-paren-mode transient-mark-mode 676 cua-mode show-paren-mode transient-mark-mode
677 blink-cursor-mode display-time-mode display-battery-mode)) 677 blink-cursor-mode display-time-mode display-battery-mode
678 ;; These are set by other functions that don't set
679 ;; the customized state. Having them here has the
680 ;; side-effect that turning them off via X
681 ;; resources acts like having customized them, but
682 ;; that seems harmless.
683 menu-bar-mode tool-bar-mode))
684 ;; FIXME ? It's a little annoying that running this command
685 ;; always loads cua-base, paren, time, and battery, even if they
686 ;; have not been customized in any way. (Due to custom-load-symbol.)
678 (and (customize-mark-to-save elt) 687 (and (customize-mark-to-save elt)
679 (setq need-save t))) 688 (setq need-save t)))
680 ;; These are set with `customize-set-variable'. 689 ;; These are set with `customize-set-variable'.
681 (dolist (elt '(scroll-bar-mode 690 (dolist (elt '(scroll-bar-mode
682 debug-on-quit debug-on-error 691 debug-on-quit debug-on-error
683 tooltip-mode menu-bar-mode tool-bar-mode 692 ;; Somehow this works, when tool-bar and menu-bar don't.
693 tooltip-mode
684 save-place uniquify-buffer-name-style fringe-mode 694 save-place uniquify-buffer-name-style fringe-mode
685 indicate-empty-lines indicate-buffer-boundaries 695 indicate-empty-lines indicate-buffer-boundaries
686 case-fold-search font-use-system-font 696 case-fold-search font-use-system-font
@@ -1923,15 +1933,6 @@ Buffers menu is regenerated."
1923 `(menu-item ,(purecopy "Previous History Item") previous-history-element 1933 `(menu-item ,(purecopy "Previous History Item") previous-history-element
1924 :help ,(purecopy "Put previous minibuffer history element in the minibuffer")))) 1934 :help ,(purecopy "Put previous minibuffer history element in the minibuffer"))))
1925 1935
1926;;;###autoload
1927;; This comment is taken from tool-bar.el near
1928;; (put 'tool-bar-mode ...)
1929;; We want to pretend the menu bar by standard is on, as this will make
1930;; customize consider disabling the menu bar a customization, and save
1931;; that. We could do this for real by setting :init-value below, but
1932;; that would overwrite disabling the tool bar from X resources.
1933(put 'menu-bar-mode 'standard-value '(t))
1934
1935(define-minor-mode menu-bar-mode 1936(define-minor-mode menu-bar-mode
1936 "Toggle display of a menu bar on each frame. 1937 "Toggle display of a menu bar on each frame.
1937This command applies to all frames that exist and frames to be 1938This command applies to all frames that exist and frames to be
@@ -1954,6 +1955,16 @@ turn on menu bars; otherwise, turn off menu bars."
1954 "Menu-bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear.")) 1955 "Menu-bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear."))
1955 menu-bar-mode) 1956 menu-bar-mode)
1956 1957
1958;;;###autoload
1959;; (This does not work right unless it comes after the above definition.)
1960;; This comment is taken from tool-bar.el near
1961;; (put 'tool-bar-mode ...)
1962;; We want to pretend the menu bar by standard is on, as this will make
1963;; customize consider disabling the menu bar a customization, and save
1964;; that. We could do this for real by setting :init-value above, but
1965;; that would overwrite disabling the menu bar from X resources.
1966(put 'menu-bar-mode 'standard-value '(t))
1967
1957(defun toggle-menu-bar-mode-from-frame (&optional arg) 1968(defun toggle-menu-bar-mode-from-frame (&optional arg)
1958 "Toggle menu bar on or off, based on the status of the current frame. 1969 "Toggle menu bar on or off, based on the status of the current frame.
1959See `menu-bar-mode' for more information." 1970See `menu-bar-mode' for more information."