comparison lisp/emacs-lisp/lmenu.el @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 67b464da13ec
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 ;;; lmenu.el --- emulate Lucid's menubar support 1 ;;; lmenu.el --- emulate Lucid's menubar support
2 2
3 ;; Copyright (C) 1992, 1993, 1994, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992, 1993, 1994, 1997, 2002, 2003, 2004,
4 ;; 2005 Free Software Foundation, Inc.
4 5
5 ;; Keywords: emulations obsolete 6 ;; Keywords: emulations obsolete
6 7
7 ;; This file is part of GNU Emacs. 8 ;; This file is part of GNU Emacs.
8 9
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details. 18 ;; GNU General Public License for more details.
18 19
19 ;; You should have received a copy of the GNU General Public License 20 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02111-1307, USA. 23 ;; Boston, MA 02110-1301, USA.
23 24
24 ;;; Commentary: 25 ;;; Commentary:
25 26
26 ;;; Code: 27 ;;; Code:
27 28
29 ;; First, emulate the Lucid menubar support in GNU Emacs 19. 30 ;; First, emulate the Lucid menubar support in GNU Emacs 19.
30 31
31 ;; Arrange to use current-menubar to set up part of the menu bar. 32 ;; Arrange to use current-menubar to set up part of the menu bar.
32 33
33 (defvar current-menubar) 34 (defvar current-menubar)
34 35 (defvar lucid-menubar-map)
35 (setq recompute-lucid-menubar 'recompute-lucid-menubar) 36 (defvar lucid-failing-menubar)
37
38 (defvar recompute-lucid-menubar 'recompute-lucid-menubar)
36 (defun recompute-lucid-menubar () 39 (defun recompute-lucid-menubar ()
37 (define-key lucid-menubar-map [menu-bar] 40 (define-key lucid-menubar-map [menu-bar]
38 (condition-case nil 41 (condition-case nil
39 (make-lucid-menu-keymap "menu-bar" current-menubar) 42 (make-lucid-menu-keymap "menu-bar" current-menubar)
40 (error (message "Invalid data in current-menubar moved to lucid-failing-menubar") 43 (error (message "Invalid data in current-menubar moved to lucid-failing-menubar")
141 144
142 If the `callback' of a button is a symbol, then it must name a command. 145 If the `callback' of a button is a symbol, then it must name a command.
143 It will be invoked with `call-interactively'. If it is a list, then it is 146 It will be invoked with `call-interactively'. If it is a list, then it is
144 evaluated with `eval'. 147 evaluated with `eval'.
145 148
146 One (and only one) of the buttons may be `nil'. This marker means that all 149 One (and only one) of the buttons may be nil. This marker means that all
147 following buttons should be flushright instead of flushleft. 150 following buttons should be flushright instead of flushleft.
148 151
149 The syntax, more precisely: 152 The syntax, more precisely:
150 153
151 form := <something to pass to `eval'> 154 form := <something to pass to `eval'>
434 437
435 (set-menubar default-menubar) 438 (set-menubar default-menubar)
436 439
437 (provide 'lmenu) 440 (provide 'lmenu)
438 441
442 ;;; arch-tag: 7051c396-2837-435a-ae11-b2d2e2af8fc1
439 ;;; lmenu.el ends here 443 ;;; lmenu.el ends here