From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Howto change [enter] behaviour? Date: Fri, 14 Feb 2003 11:46:07 -0700 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3E4D396F.10806@ihs.com> References: <87fzqr1dww.fsf@noos.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1045248702 31099 80.91.224.249 (14 Feb 2003 18:51:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2003 18:51:42 +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 18jkvL-00081H-00 for ; Fri, 14 Feb 2003 19:51:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18jkur-00079D-04 for gnu-help-gnu-emacs@m.gmane.org; Fri, 14 Feb 2003 13:50:29 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: fu-berlin.de 1045248356 47073775 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Original-Xref: shelby.stanford.edu gnu.emacs.help:110210 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6713 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6713 François Fleuret wrote: > I am writing a major mode to play mp3s (I know something like this > already exists, but mine is simpler and it was more an exercice in > elisp than a real project ... anyway). My only problem so far is how > to change the behaviour of the [enter] key. How am I supposed to do > that ? Doesn't what you already have work (i.e. call next-line)? If not, what does the Enter key do in your mode? > (defun mp3play-mode () > "Major mode to play mp3s taken in various directories" > (interactive) > > (unless mp3play-mode-map > (setq mp3play-mode-map (make-keymap)) > (suppress-keymap mp3play-mode-map) > (define-key mp3play-mode-map "n" 'next-line) > (define-key mp3play-mode-map "p" 'previous-line) > (define-key mp3play-mode-map "q" 'mp3play-quit) > (define-key mp3play-mode-map "k" 'mp3play-kill) > (define-key mp3play-mode-map " " 'mp3play-play) > (define-key mp3play-mode-map "r" 'mp3play-refresh-list) > (define-key mp3play-mode-map "s" 'mp3play-stop) > (define-key mp3play-mode-map "h" 'mp3play-help) > (define-key mp3play-mode-map "?" 'mp3play-show-properties) > (define-key mp3play-mode-map "\C-m" 'next-line) > ) > > (kill-all-local-variables) > > (use-local-map mp3play-mode-map) > (setq mode-name "Mp3play") > (setq major-mode 'mp3play-mode) > (run-hooks 'mp3play-mode-hook) > > ) -- Kevin Rodgers