[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Show/Hide menu
From: |
Pavel Janík |
Subject: |
[PATCH] Show/Hide menu |
Date: |
Sat, 19 Jan 2002 23:07:47 +0100 |
User-agent: |
Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.2.50 (i386-suse-linux-gnu) |
Hi,
a few days ago, we discussed a Show/Hide menu (submenu of Options). Here
is the implementation. If you turn the menu-bar off now, you are lost (M-x
menu-bar-mode helps). Do you have an idea where the GUI possibility for
turning the menu-bar on again should be?
Any comments?
BTW - anyone willing to implement radio button for menus? That would be
better here for scroll-bars.
--- menu-bar.el.~1.189.~ Mon Dec 10 22:31:42 2001
+++ menu-bar.el Sat Jan 19 16:10:18 2002
@@ -1,6 +1,6 @@
;;; menu-bar.el --- define a default menu bar
-;; Copyright (C) 1993, 1994, 1995, 2000, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 1995, 2000, 2001, 2002 Free Software Foundation,
Inc.
;; Author: RMS
;; Maintainer: FSF
@@ -655,6 +655,61 @@
"Global Font Lock mode %s"
"Colorize text based on language syntax"
(global-font-lock-mode)))
+
+(define-key menu-bar-options-menu [showhide-separator]
+ '("--"))
+
+(defvar menu-bar-showhide-menu (make-sparse-keymap "Show/Hide"))
+(defvar menu-bar-showhide-scroll-bar-menu (make-sparse-keymap "Scroll-Bar"))
+
+(defun menu-bar-scroll-bar-right ()
+ "Turn on the scroll-bar on the right side."
+ (interactive)
+ (set-scroll-bar-mode 'right))
+
+(defun menu-bar-scroll-bar-left ()
+ "Turn on the scroll-bar on the left side."
+ (interactive)
+ (set-scroll-bar-mode 'left))
+
+(defun menu-bar-scroll-bar-none ()
+ "Turn off the scroll-bar."
+ (interactive)
+ (set-scroll-bar-mode nil))
+
+(define-key menu-bar-showhide-scroll-bar-menu [right]
+ '(menu-item "Right" menu-bar-scroll-bar-right
+ :help "Scroll-Bar on the right side"))
+
+(define-key menu-bar-showhide-scroll-bar-menu [left]
+ '(menu-item "Left" menu-bar-scroll-bar-left
+ :help "Scroll-Bar on the left side"))
+
+(define-key menu-bar-showhide-scroll-bar-menu [none]
+ '(menu-item "None" menu-bar-scroll-bar-none
+ :help "Turn Off Scroll-Bar"))
+
+(define-key menu-bar-showhide-menu [showhide-scroll-bar]
+ (list 'menu-item "Scroll-Bar" menu-bar-showhide-scroll-bar-menu
+ :help "Choose Scroll-Bar"))
+
+(define-key menu-bar-showhide-menu [showhide-menu-bar]
+ (menu-bar-make-toggle showhide-menu-bar menu-bar-mode
+ "Menu-bar"
+ "Menu-bar mode %s"
+ "Toggle Menu-Bar On/Off"
+ (menu-bar-mode)))
+
+(define-key menu-bar-showhide-menu [showhide-tool-bar]
+ (menu-bar-make-toggle showhide-tool-bar tool-bar-mode
+ "Tool-bar"
+ "Tool-bar mode %s"
+ "Toggle Tool-Bar On/Off"
+ (tool-bar-mode)))
+
+(define-key menu-bar-options-menu [showhide]
+ (list 'menu-item "Show/Hide" menu-bar-showhide-menu
+ :help "Toggle on/off various display features"))
;; The "Tools" menu items
--
Pavel Janík
Q: Why are we hiding from the police daddy?
A: Because we use vi son, they use emacs.
-- Thinkgeek.com T-Shirt
- [PATCH] Show/Hide menu,
Pavel Janík <=
- Re: [PATCH] Show/Hide menu, Eli Zaretskii, 2002/01/20
- Re: [PATCH] Show/Hide menu, Pavel Janík, 2002/01/20
- Re: [PATCH] Show/Hide menu, Karl Eichwalder, 2002/01/20
- Re: [PATCH] Show/Hide menu, Eli Zaretskii, 2002/01/21
- Re: [PATCH] Show/Hide menu, Karl Eichwalder, 2002/01/21