From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: supreet Newsgroups: gmane.emacs.help Subject: RE: New menu creation Date: Tue, 1 Jun 2010 13:09:31 -0700 (PDT) Message-ID: <28746877.post@talk.nabble.com> References: <28685978.post@talk.nabble.com> <5D11D6FCAED84077867BBFADD477A806@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1275423009 12348 80.91.229.12 (1 Jun 2010 20:10:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Jun 2010 20:10:09 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 01 22:10:08 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OJXmp-0006Z2-Cq for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jun 2010 22:10:07 +0200 Original-Received: from localhost ([127.0.0.1]:56833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJXmo-0007H7-Qu for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jun 2010 16:10:06 -0400 Original-Received: from [140.186.70.92] (port=43485 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJXmI-0007D9-9s for Help-gnu-emacs@gnu.org; Tue, 01 Jun 2010 16:09:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJXmG-0005uT-V4 for Help-gnu-emacs@gnu.org; Tue, 01 Jun 2010 16:09:34 -0400 Original-Received: from kuber.nabble.com ([216.139.236.158]:59713) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJXmG-0005uA-NU for Help-gnu-emacs@gnu.org; Tue, 01 Jun 2010 16:09:32 -0400 Original-Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OJXmF-0000mo-NN for Help-gnu-emacs@gnu.org; Tue, 01 Jun 2010 13:09:31 -0700 In-Reply-To: <5D11D6FCAED84077867BBFADD477A806@us.oracle.com> X-Nabble-From: supreet.prasad@gmail.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73806 Archived-At: Hi, Thank you very much for all the info. It really helped. the answers to my questions were so precise. Thanks once again for taking your time. Supreet Drew Adams wrote: > >> I am very new to Emacs. I am trying to create a new menu in >> the menu bar. How do I proceed? > > Here is one way. Paste this text in a new file `mine.el', save it, and do > `M-x > load-file RET mine.el'. (`M-x' means `ALT-x'.) > > ;; 1. Define a keymap variable: > (defvar my-menu (make-sparse-keymap "My Great Menu")) > > ;; 2. Put it on the menu bar: > (define-key global-map [menu-bar mine] (cons "Mine" my-menu)) > > ;; 3. Add menu items: > (define-key my-menu [my-cmd1] > '(menu-item "Command Uno" my-cmd1 :help "My first command")) > (define-key my-menu [forward-char] > '(menu-item "Command Duo" my-cmd1 :help "Move forward one char")) > > ... > > Alternatively, skip defining a variable (step #1) and just define > everything > directly wrt the `global-map': > > (define-key global-map [menu-bar mine] > (cons "Mine" (make-sparse-keymap "My Great Menu"))) > > (define-key global-map [menu-bar mine my-cmd1] > '(menu-item "Command Uno" my-cmd1 :help "My first command")) > > ... > >> I downloaded the source and I see a lot of .el files under the lisp >> directory. Do I create a new file there? How do I link it? > > No. Put the file in any directory you like, then add that directory to > your > `load-path': > > (add-to-list 'load-path "/my/directory/for/my/lisp/") > >> Please let me know if there are any links or info that I can follow. > > * `C-h i', then choose Elisp, for the Emacs-Lisp manual. Then `i', type > `menu', > and hit `TAB'. You'll see the manual pages about the menus. Choose the > completion candidate `menu bar' by typing ` bar' and hitting `RET'. That > takes > you to the manual page (node) `Menu Bar'. Read. > > * Google `emacs wiki' and pick the first search hit: `EmacsWiki: Site > Map'. > Search there for `menu bar'. Pick the first search hit: `EmacsWiki: Menu > Bar'. > You are here: http://www.emacswiki.org/emacs/MenuBar. Read. Explore the > wiki for > more. > > HTH. > > > > > -- View this message in context: http://old.nabble.com/New-menu-creation-tp28685978p28746877.html Sent from the Emacs - Help mailing list archive at Nabble.com.