From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier " Newsgroups: gmane.emacs.help Subject: Re: Disabling all keybindings - How? Date: 12 Oct 2002 14:45:29 -0400 Organization: Yale University Sender: help-gnu-emacs-admin@gnu.org Message-ID: <5lvg47ebsm.fsf@rum.cs.yale.edu> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034449107 21736 127.0.0.1 (12 Oct 2002 18:58:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 12 Oct 2002 18:58:27 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 180RT0-0005eN-00 for ; Sat, 12 Oct 2002 20:58:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 180RQr-0004jI-00; Sat, 12 Oct 2002 14:56:13 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!news-hog.berkeley.edu!ucberkeley!news.ycc.yale.edu!rum.cs.yale.edu!rum.cs.yale.edu Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: rum.cs.yale.edu User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-Original-NNTP-Posting-Host: rum.cs.yale.edu X-Original-Trace: 12 Oct 2002 14:45:30 -0400, rum.cs.yale.edu Original-Xref: shelby.stanford.edu gnu.emacs.help:105979 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2526 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2526 >>>>> "Klaus" == Klaus Berndl writes: > I want to write a very small major-mode with only very few senseful > keybindings (e.g.: v, h, c, q, s). I want to disable all other keybindings of > Emacs because they make really no sense (A new frame is started with a new > buffer in this major-mode, some actions have to be performed by the user > (e.g.: hitting v or h), stuff is saved by hitting s and then we quit by > hitting q (which deletes the new frame) - That's all. You can try (defvar bla-mode-map (let ((map (make-sparse-keymap))) (define-key map "v" 'bla-v-command) ... (define-key map "s" 'bla-s-command) ;; `t' is a special "default" binding. (define-key map [t] 'undefined) map)) it will prevent function-key-map from doing its job, tho since all keys will be considered bound to `undefined'. You might also have some problems with the fact that frame switches (with the mouse) go through a `switch-frame' event, so you might want to explicitly bind it to nil to make sure that its binding in the global map is used. Stefan