From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pete Beardmore Newsgroups: gmane.emacs.bugs Subject: bug#7575: gdb command history saving Date: Thu, 2 Jun 2011 18:58:41 +0100 Message-ID: References: <8f8w02qsks.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; delsp=Yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1307038186 4245 80.91.229.12 (2 Jun 2011 18:09:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Jun 2011 18:09:46 +0000 (UTC) To: 7575@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 02 20:09:42 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QSCL0-0001Eo-9o for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Jun 2011 20:09:42 +0200 Original-Received: from localhost ([::1]:37761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSCKz-0006sT-9Z for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Jun 2011 14:09:41 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSCHU-000688-GK for bug-gnu-emacs@gnu.org; Thu, 02 Jun 2011 14:06:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QSCHT-0000qF-0R for bug-gnu-emacs@gnu.org; Thu, 02 Jun 2011 14:06:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSCHS-0000q8-PG for bug-gnu-emacs@gnu.org; Thu, 02 Jun 2011 14:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QSCHR-0005T2-Tl; Thu, 02 Jun 2011 14:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pete Beardmore Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Jun 2011 18:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7575 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7575-submit@debbugs.gnu.org id=B7575.130703794220987 (code B ref 7575); Thu, 02 Jun 2011 18:06:01 +0000 Original-Received: (at 7575) by debbugs.gnu.org; 2 Jun 2011 18:05:42 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QSCH7-0005SQ-Pq for submit@debbugs.gnu.org; Thu, 02 Jun 2011 14:05:42 -0400 Original-Received: from blu0-omc2-s5.blu0.hotmail.com ([65.55.111.80]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QSCH5-0005SF-FN for 7575@debbugs.gnu.org; Thu, 02 Jun 2011 14:05:40 -0400 Original-Received: from BLU0-SMTP126 ([65.55.111.71]) by blu0-omc2-s5.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 2 Jun 2011 11:05:34 -0700 X-Originating-IP: [78.86.149.244] X-Originating-Email: [pete.beardmore@msn.com] Original-Received: from elservo.localdomain ([78.86.149.244]) by BLU0-SMTP126.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 2 Jun 2011 11:05:33 -0700 Original-Received: by elservo.localdomain (Postfix, from userid 80) id C337EADAB0; Thu, 2 Jun 2011 18:58:41 +0100 (BST) Original-Received: from elbeardo.lemondedelabarbe (elbeardo.lemondedelabarbe [10.0.0.5]) by elservo.lemondedelabarbe (Horde Framework) with HTTP; Thu, 02 Jun 2011 18:58:41 +0100 In-Reply-To: <8f8w02qsks.fsf@fencepost.gnu.org> Content-Disposition: inline User-Agent: Internet Messaging Program (IMP) H3 (4.3.6) X-OriginalArrivalTime: 02 Jun 2011 18:05:33.0341 (UTC) FILETIME=[AA7DDCD0:01CC214F] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 02 Jun 2011 14:06:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46899 Archived-At: > Glen Morris wrote: > >> Glen Morris wrote: >> >> You could add something like the following to gdb-mode-hook: >> >> (setq comint-input-ring-file-name "~/.gdbhist") >> (comint-read-input-ring t) >> >> shell-mode tries to do this by default; perhaps gdb-mode should do >> similar. > > I've added this to M-x gdb. Hi, sorry for the late come back and thank you for the comments. Could i ask whether you tested a w32 emacs version evoked from a MinGW/Msys bash prompt? My GNU/Linux emacs gdb history works out of the box so i still think this is a bug, possibly to do with file encodings?! As a workaround, i started with the gdb-mode-hook you provided (thank you) and added a few more comint settings.. (add-hook 'gdb-mode-hook '(lambda() (setq comint-input-ring-file-name "~/.gdbhist") (comint-read-input-ring t) (setq comint-input-ring-size 1000) (setq comint-input-ignoredups t) )) ..but obviously this wouldn't solve the problem of not writing the commands back to the file after the session. (add-hook 'kill-buffer-hook 'comint-write-input-ring) ..took care of the buffer being killed, but I also defined this advice to take care of quitting.. (defadvice gdb-send-item (before gdb-save-history first nil activate) "write input ring on quit" (if (equal (type-of item) 'string) ; avoid problems with some horrible, seemingly unprintable structures sent to this function.. (if (string-match "^q\\(u\\|ui\\|uit\\)?$" item) (progn (comint-write-input-ring) (message "history file '%s' written" comint-input-ring-file-name))))) Thanks, Pete