From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Pennebaker Newsgroups: gmane.emacs.help Subject: Automatically move cursor to end of shell-mode buffer on M-p / M-n Date: Tue, 24 Feb 2015 09:50:41 -0600 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1424793059 19804 80.91.229.3 (24 Feb 2015 15:50:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Feb 2015 15:50:59 +0000 (UTC) To: Emacs Help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 24 16:50:58 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YQHlC-0002QF-JX for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Feb 2015 16:50:58 +0100 Original-Received: from localhost ([::1]:49962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQHlB-0004We-OA for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Feb 2015 10:50:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQHkx-0004W1-Rn for help-gnu-emacs@gnu.org; Tue, 24 Feb 2015 10:50:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQHkw-0004Dp-RH for help-gnu-emacs@gnu.org; Tue, 24 Feb 2015 10:50:43 -0500 Original-Received: from mail-ig0-x22f.google.com ([2607:f8b0:4001:c05::22f]:53082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQHkw-0004De-KG for help-gnu-emacs@gnu.org; Tue, 24 Feb 2015 10:50:42 -0500 Original-Received: by mail-ig0-f175.google.com with SMTP id hn18so27613723igb.2 for ; Tue, 24 Feb 2015 07:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ev7ok3/BnVEwFwijhtivFlq/2vo0DnUIpIouSWPAsPs=; b=Sxv5S2Nwr47Eg2+HGSSKkr0M1KyaI0ps+/D+U9Hh7F3CEG31NN7Z860uinjIHWDt1M 4mYMSWDPzaKJ44EDJxDvai0dYBc4du+Ky8Nr9yAx3Ui9r/eSTD16ExUsvWVepOYOVquI yiMYm6gGLjQXAD2EOLp2cEF2SFl3C/rBdVnlh2qL8io84eMVyICY8Q7Iay8MprCH80Fk UgslFPRCWnq/hAK5WBFFZocIalq2eub3R/Ap7DJPZ/hxiotxbKAn6CyPuL/tJPeE2S4L P/NtykK9mnQU3gma8dWcUHAGBUt29YVfidL78AsiRYb/NxAxePWd/IYpj4BVR9vhRFDV 6Tmw== X-Received: by 10.42.113.2 with SMTP id a2mr18228151icq.30.1424793041853; Tue, 24 Feb 2015 07:50:41 -0800 (PST) Original-Received: by 10.36.122.145 with HTTP; Tue, 24 Feb 2015 07:50:41 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::22f X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102871 Archived-At: 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?