[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New menu creation
From: |
Tassilo Horn |
Subject: |
Re: New menu creation |
Date: |
Thu, 27 May 2010 16:47:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
supreet <supreet.prasad@gmail.com> writes:
Hi!
> I am very new to Emacs. I am trying to create a new menu in the menu bar.
> How do I proceed?
> I downloaded the source and I see a lot of .el files under the lisp
> directory. Do I create a new file there?
No, you can do that by placing some code into your ~/.emacs file. No
need to modify the emacs source code.
> Please let me know if there are any links or info that I can follow.
Have a look at the documentation:
,----[ (info "(elisp)Menu Bar") ]
| ;; Make a menu keymap (with a prompt string)
| ;; and make it the menu bar item's definition.
| (define-key global-map [menu-bar words]
| (cons "Words" (make-sparse-keymap "Words")))
|
| ;; Define specific subcommands in this menu.
| (define-key global-map
| [menu-bar words forward]
| '("Forward word" . forward-word))
| (define-key global-map
| [menu-bar words backward]
| '("Backward word" . backward-word))
`----
To jump to this documentation page inside emacs, put the boxquote
heading
(info "(elisp)Menu Bar")
into emacs' *scratch* buffer and hit `C-x C-e' after the last closing
paren.
Bye,
Tassilo