From: Kevin Rodgers <kevin.rodgers@ihs.com>
Subject: Re: Howto change [enter] behaviour?
Date: Fri, 14 Feb 2003 11:46:07 -0700 [thread overview]
Message-ID: <3E4D396F.10806@ihs.com> (raw)
In-Reply-To: 87fzqr1dww.fsf@noos.fr
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)
>
> )
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
next prev parent reply other threads:[~2003-02-14 18:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-14 8:09 Howto change [enter] behaviour? François Fleuret
2003-02-14 18:46 ` Kevin Rodgers [this message]
2003-02-15 5:24 ` Pascal Bourguignon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E4D396F.10806@ihs.com \
--to=kevin.rodgers@ihs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).