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: Re: Automatically move cursor to end of shell-mode buffer on M-p / M-n Date: Wed, 25 Feb 2015 09:15:50 -0600 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1424877646 3993 80.91.229.3 (25 Feb 2015 15:20:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Feb 2015 15:20:46 +0000 (UTC) Cc: Emacs Help To: "J. David Boyd" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 25 16:20:41 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 1YQdlP-0005un-EL for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Feb 2015 16:20:39 +0100 Original-Received: from localhost ([::1]:54642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQdlO-0008DC-SH for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Feb 2015 10:20:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQdgq-0006pt-8B for help-gnu-emacs@gnu.org; Wed, 25 Feb 2015 10:16:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQdgl-0005x6-Ut for help-gnu-emacs@gnu.org; Wed, 25 Feb 2015 10:15:56 -0500 Original-Received: from mail-ig0-x232.google.com ([2607:f8b0:4001:c05::232]:62005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQdgl-0005x1-NZ for help-gnu-emacs@gnu.org; Wed, 25 Feb 2015 10:15:51 -0500 Original-Received: by mail-ig0-f178.google.com with SMTP id hl2so6486495igb.5 for ; Wed, 25 Feb 2015 07:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=y2hJF0wzNImcLQWzUc2J4w3SkWkyYssh+I1CX9pz6e8=; b=wCi4HILN6JhTBhGyn/2aiEaoA3y3Dq/8f/AUucpwJITs4xYnNuVRRwGJM5UrZtuNmV xUCaKRiZmZZz66E3NMCnsg9gzFDLdh0MhXz4cnkDJRI1HhmHXII/EdxEo21uEBPcgBxV wnetfTLbVg+K8dG2SE4Nrzdg3Izy8kpgQpKrr2JwXCVTtqFpjyUKN+QSsCLq+rbFbXCV NWkk1Wc6QyI5hXz3cIMgeJgahnndyFNJo3NGGJ7h97OlI/xzGsni3oAZxGoPU/YCPpSx 5TqSCxjvwrYslAFmelWUNvlAoQQldnLlcfubkXUQ8j4jW61nHeRi+E2hiJpdPDgrrYzG llLw== X-Received: by 10.42.113.2 with SMTP id a2mr4359616icq.30.1424877350781; Wed, 25 Feb 2015 07:15:50 -0800 (PST) Original-Received: by 10.36.122.145 with HTTP; Wed, 25 Feb 2015 07:15:50 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::232 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:102882 Archived-At: That's an interesting setting. Though most of my command line interaction is going up/down in the history and pressing enter, not sure if M-p / M-n qualifies as input. On Wed, Feb 25, 2015 at 7:51 AM, J. David Boyd wrote: > Andrew Pennebaker 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 > > > -- Cheers, Andrew Pennebaker www.yellosoft.us