From: Pete Beardmore <pete.beardmore@msn.com>
To: 7575@debbugs.gnu.org
Subject: bug#7575: gdb command history saving
Date: Thu, 2 Jun 2011 18:58:41 +0100 [thread overview]
Message-ID: <BLU0-SMTP126369606486DBF9F8A498B8A7C0@phx.gbl> (raw)
In-Reply-To: <8f8w02qsks.fsf@fencepost.gnu.org>
> 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
next prev parent reply other threads:[~2011-06-02 17:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-06 16:49 bug#7575: gdb command history saving Pete Beardmore
2010-12-07 1:28 ` Glenn Morris
2011-03-09 9:02 ` Glenn Morris
2011-06-02 17:58 ` Pete Beardmore [this message]
2011-06-02 21:50 ` Glenn Morris
2022-01-31 16:51 ` Lars Ingebrigtsen
2022-03-01 15:46 ` Lars Ingebrigtsen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BLU0-SMTP126369606486DBF9F8A498B8A7C0@phx.gbl \
--to=pete.beardmore@msn.com \
--cc=7575@debbugs.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).