From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: p.gardner@stanleyassociates.com (Paul G. Gardner) Newsgroups: gmane.emacs.help Subject: Adding a popup menu option to close the current buffer Date: 22 Jan 2004 18:10:19 -0800 Organization: http://groups.google.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1074824278 30330 80.91.224.253 (23 Jan 2004 02:17:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2004 02:17:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 23 03:17:50 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AjqtJ-0006WX-00 for ; Fri, 23 Jan 2004 03:17:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AjqrD-00056F-2s for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Jan 2004 21:15:39 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!newsfeed.mathworks.com!news.maxwell.syr.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 53 Original-NNTP-Posting-Host: 12.172.51.130 Original-X-Trace: posting.google.com 1074823820 25519 127.0.0.1 (23 Jan 2004 02:10:20 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 23 Jan 2004 02:10:20 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:120353 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16297 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16297 I've got EMACS v21.3.1 and I've added EMacro to the start up. Everything is fine until I tried to add a menu item to the default popup menu. For some reason, I am unable to do so, and I'm not sure why. I'm not very familiar with ELisp (used it in college for a year, but that's it) so I'm assuming that's the problem. Here is the code: In EMacro, here is the relavant parts of the definition of the popup menu. ;;_________________________________________________________________________(defvar right-popup-menu (let ((menu (make-sparse-keymap "Commands"))) (define-key menu [dabbrev-expand] (cons "Complete word" 'dabbrev-expand)) (define-key menu [undo] (cons "Undo" 'undo)) (define-key menu [redo] (cons "Redo" 'redo)) (define-key menu [--] (cons "--" 'nil)) ;separator (define-key menu [menu-paste] (cons "Paste" 'yank)) (define-key menu [menu-copy] (cons "Copy" 'copy-region-as-kill)) (define-key menu [menu-cut] (cons "Cut" 'kill-region)) (define-key menu [-] (cons "-" 'nil)) ;separator (define-key menu [emacro-help] (cons (concat (concat "EMacro v" emacro-version) " help") 'emacro-help)) menu)) (defun right-popup() "Run the command selected from `right-popup-menu'." (interactive) (call-interactively (or (car (x-popup-menu t right-popup-menu)) 'ignore))) (global-set-key [mouse-3] 'right-popup) ;;_________________________________________________________________________ I've tried to add the following: (define-key menu [menu-close-buffer] ( cons "Close-buffer" 'kill-this-buffer)) both in the the original definition, and separately ('menu' replaced by 'right-popup-menu'). However, while I don't receive any errors, when I select the option, which does show up, all I get is a beep, and the buffer stays open. Can someone point me in the right direction? I've tried to read the manuals, but keep getting stumped. Thanks! Paul