all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: dboyd2@mmm.com (J. David Boyd)
To: help-gnu-emacs@gnu.org
Subject: Re: Automatically move cursor to end of shell-mode buffer on M-p / M-n
Date: Wed, 25 Feb 2015 08:51:13 -0500	[thread overview]
Message-ID: <gjubioeqje0e.fsf@W0144758.usac.mmm.com> (raw)
In-Reply-To: CAHXt_SUHc+M9sHKFP7P9q+fZRanfJ1ERnO=KU3XizKsqtYnA0g@mail.gmail.com

Andrew Pennebaker <andrew.pennebaker@gmail.com> writes:

> As a shell user, I want shell-mode M-p / M-n to automatically move my
> cursor to the shell prompt, so that shell-mode behaves more intuitively.
>
> Currently, attempting to use M-p / M-n when the cursor is not at the
> prompt, results in a warning message. I think we can make shell-mode behave
> more intuitively.
>
> I have a workaround for this in my .emacs:
>
> ;; Automatically move cursor to prompt on shell up/down
> (add-hook 'shell-mode-hook
>           (lambda ()
>             (define-key comint-mode-map (kbd "M-p")
>               (lambda (arg)
>                 (interactive "*p")
>                 (goto-char (point-max))
>                 (comint-previous-input arg)))
>             (define-key comint-mode-map (kbd "M-n")
>               (lambda (arg)
>                 (interactive "*p")
>                 (goto-char (point-max))
>                 (comint-next-input arg)))))
>
> In the next version of Emacs, could we bake this behavior in, so that
> shell-mode behaves more intuitively?

What about setting comint-scroll-to-bottom-on-input to true?  ()I have that set
when I am in a shell buffer, and any keystrokes move me right to the bottom
and the prompt.)

Documentation:
Controls whether input to interpreter causes window to scroll.
If nil, then do not scroll.  If t or `all', scroll all windows showing buffer.
If `this', scroll only the selected window.

The default is nil.


Dave




  parent reply	other threads:[~2015-02-25 13:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 15:50 Automatically move cursor to end of shell-mode buffer on M-p / M-n Andrew Pennebaker
2015-02-25  1:30 ` Robert Thorpe
2015-02-25  3:04   ` John Mastro
2015-02-25 13:51 ` J. David Boyd [this message]
2015-02-25 15:15   ` Andrew Pennebaker

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gjubioeqje0e.fsf@W0144758.usac.mmm.com \
    --to=dboyd2@mmm.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.