unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: maierh@myself.com
Subject: Re: key binding question
Date: Sun, 06 Apr 2003 13:14:03 +0200	[thread overview]
Message-ID: <uy92nev44.fsf@myself.com> (raw)
In-Reply-To: 6AOja.383118$sf5.707842@rwcrnsc52.ops.asp.att.net

Kevin Reeder <avail@uponrequest.org> writes:

> When using the python interpreter within emacs, I'd like to have the
> up/down arrows echo previous commands. Can anyone give me the code for
> this?

The common philosophy on this subject is to use M-p and M-n because
with down and up or C-n and C-p you might move in the buffer. Anyway,
I don't know the python interpreter mode, but if it's derived from
comint then you can set in the interpreter mode hook the function
'comint-previous-input' and 'comint-next-input' to your favorite keys.

Here an example that sets in general for all comint modes new function
keys. But you can set this too only for a special mode such as
'shell-mode-hook' or maybe 'py-mode-hook' (?).

(add-hook 
 'comint-mode-hook 
 (lambda () 
   (interactive)
   (define-key comint-mode-map [up]   'comint-previous-input)
   (define-key comint-mode-map [down] 'comint-next-input)
   ))


Harald

  reply	other threads:[~2003-04-06 11:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-06  5:05 key binding question Kevin Reeder
2003-04-06 11:14 ` maierh [this message]
2003-04-07 10:10 ` Jerome Besnard
2003-04-08  4:09   ` Kevin Reeder
  -- strict thread matches above, loose matches on Subject: below --
2007-02-10 13:00 Hadron
2007-02-12  4:42 ` Kevin Rodgers
     [not found] ` <mailman.4372.1171255378.2155.help-gnu-emacs@gnu.org>
2007-02-12  9:11   ` Hadron
2007-02-13  6:36     ` Kevin Rodgers

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=uy92nev44.fsf@myself.com \
    --to=maierh@myself.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).