From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Newsgroups: gmane.emacs.devel Subject: Shell history is not saved when the shell is exited then restarted Date: Sat, 30 Oct 2010 20:29:32 +0000 (UTC) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1288470596 30026 80.91.229.12 (30 Oct 2010 20:29:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 30 Oct 2010 20:29:56 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 30 22:29:52 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PCI3j-0006xd-TB for ged-emacs-devel@m.gmane.org; Sat, 30 Oct 2010 22:29:52 +0200 Original-Received: from localhost ([127.0.0.1]:47441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCI3j-00017X-Cb for ged-emacs-devel@m.gmane.org; Sat, 30 Oct 2010 16:29:51 -0400 Original-Received: from [140.186.70.92] (port=34735 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCI3e-00017S-9T for emacs-devel@gnu.org; Sat, 30 Oct 2010 16:29:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCI3d-0007DG-9i for emacs-devel@gnu.org; Sat, 30 Oct 2010 16:29:46 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:47190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCI3c-0007Ah-W3 for emacs-devel@gnu.org; Sat, 30 Oct 2010 16:29:45 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PCI3a-0006tN-Tx for emacs-devel@gnu.org; Sat, 30 Oct 2010 22:29:43 +0200 Original-Received: from 94-21-240-191.pool.digikabel.hu ([94.21.240.191]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Oct 2010 22:29:42 +0200 Original-Received: from levelhalom by 94-21-240-191.pool.digikabel.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Oct 2010 22:29:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.21.240.191 (Opera/9.80 (Windows NT 6.1; U; en) Presto/2.6.30 Version/10.63) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:132197 Archived-At: I was wondering why my shell input history is not saved sometimes, so I checked the code and found this condition in shell-mode: (when (ring-empty-p comint-input-ring) ... ;; Arrange to write out the input ring on exit, if the shell doesn't ;; do this itself. ... http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/shell.el#n448 My current shell is the Windows command prompt which needs that arranging and that ring-empty-p check means if I exit from the shell for some reason and then restart it with M-x shell then the inputs of the second session are not saved, because the comint-input-ring already has items from the previous shell invocation. Is there a compelling reason for that check? Why can't the inputs be saved if the comint-input-ring is not empty when the shell is started?