aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong2010-07-05 13:54:13 -0400
committerChong Yidong2010-07-05 13:54:13 -0400
commit4ad11f8ccbec3bda22e53f867e8ed7de0de1a085 (patch)
tree726800cb1c61402f1494cd51a89625f419b43d2f /lisp
parent81133808b8232266ce6244eae6b14ffc7dc92cbc (diff)
downloademacs-4ad11f8ccbec3bda22e53f867e8ed7de0de1a085.tar.gz
emacs-4ad11f8ccbec3bda22e53f867e8ed7de0de1a085.zip
Set default-frame-alist, if necessary, in menu/tool-bar-mode.
* menu-bar.el (menu-bar-mode): * tool-bar.el (tool-bar-mode): Replace default-frame-alist element if it has been set.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/menu-bar.el13
-rw-r--r--lisp/tool-bar.el16
3 files changed, 24 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8e75e6634fe..b2332cdd349 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12010-07-05 Chong Yidong <cyd@stupidchicken.com> 12010-07-05 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * menu-bar.el (menu-bar-mode):
4 * tool-bar.el (tool-bar-mode): Replace default-frame-alist element
5 if it has been set.
6
3 * mouse.el (mouse-drag-track): Call mouse-start-end to handle 7 * mouse.el (mouse-drag-track): Call mouse-start-end to handle
4 word/line selection (Bug#6565). 8 word/line selection (Bug#6565).
5 9
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 20ad50c9048..f94b67a6e89 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1937,15 +1937,20 @@ turn on menu bars; otherwise, turn off menu bars."
1937 ;; Turn the menu-bars on all frames on or off. 1937 ;; Turn the menu-bars on all frames on or off.
1938 (let ((val (if menu-bar-mode 1 0))) 1938 (let ((val (if menu-bar-mode 1 0)))
1939 (dolist (frame (frame-list)) 1939 (dolist (frame (frame-list))
1940 (set-frame-parameter frame 'menu-bar-lines val))) 1940 (set-frame-parameter frame 'menu-bar-lines val))
1941 1941 ;; If the user has given `default-frame-alist' a `menu-bar-lines'
1942 ;; parameter, replace it.
1943 (if (assq 'menu-bar-lines default-frame-alist)
1944 (setq default-frame-alist
1945 (cons (cons 'menu-bar-lines val)
1946 (assq-delete-all 'menu-bar-lines
1947 default-frame-alist)))))
1942 ;; Make the message appear when Emacs is idle. We can not call message 1948 ;; Make the message appear when Emacs is idle. We can not call message
1943 ;; directly. The minor-mode message "Menu-bar mode disabled" comes 1949 ;; directly. The minor-mode message "Menu-bar mode disabled" comes
1944 ;; after this function returns, overwriting any message we do here. 1950 ;; after this function returns, overwriting any message we do here.
1945 (when (and (called-interactively-p 'interactive) (not menu-bar-mode)) 1951 (when (and (called-interactively-p 'interactive) (not menu-bar-mode))
1946 (run-with-idle-timer 0 nil 'message 1952 (run-with-idle-timer 0 nil 'message
1947 "Menu-bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear.")) 1953 "Menu-bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear.")))
1948 menu-bar-mode)
1949 1954
1950(defun toggle-menu-bar-mode-from-frame (&optional arg) 1955(defun toggle-menu-bar-mode-from-frame (&optional arg)
1951 "Toggle menu bar on or off, based on the status of the current frame. 1956 "Toggle menu bar on or off, based on the status of the current frame.
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index eaa8551b019..4b83b07754d 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -52,13 +52,19 @@ conveniently adding tool bar items."
52 :global t 52 :global t
53 :group 'mouse 53 :group 'mouse
54 :group 'frames 54 :group 'frames
55 ;; Make tool-bar even if terminal is non-graphical (Bug#1754).
56 (let ((val (if tool-bar-mode 1 0))) 55 (let ((val (if tool-bar-mode 1 0)))
57 (dolist (frame (frame-list)) 56 (dolist (frame (frame-list))
58 (set-frame-parameter frame 'tool-bar-lines val))) 57 (set-frame-parameter frame 'tool-bar-lines val))
59 (when tool-bar-mode 58 ;; If the user has given `default-frame-alist' a `tool-bar-lines'
60 (if (= 1 (length (default-value 'tool-bar-map))) ; not yet setup 59 ;; parameter, replace it.
61 (tool-bar-setup)))) 60 (if (assq 'tool-bar-lines default-frame-alist)
61 (setq default-frame-alist
62 (cons (cons 'tool-bar-lines val)
63 (assq-delete-all 'tool-bar-lines
64 default-frame-alist)))))
65 (and tool-bar-mode
66 (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
67 (tool-bar-setup)))
62 68
63;;;###autoload 69;;;###autoload
64;; Used in the Show/Hide menu, to have the toggle reflect the current frame. 70;; Used in the Show/Hide menu, to have the toggle reflect the current frame.