当時はもう少し掘り下げて自分の質問に答えることができたと思いますが、最初のgdbソリューションは、古い学習の最前線でそれを取り除いてくれました。回復したので..
ChbCsメジャー
少しスクロールした後、「comint-send-input」をキー「enter」にバインドされた関数として識別できます。この関数のソースを見ると、comint.el:1765は「run-hook-with-args」の呼び出しです。これは、特に「pdb」が必要なことを実行する場所がないことを認識している場所です。
gudは、外部デバッグプロセスを呼び出して結果を返すための汎用ラッパーです。したがって、コントロールはelispにはありません。これはgdbでも同じでしたが、外部呼び出しの周りに優れた(既存の)ラッパーがあり、その関数に「クリーン」な感じを与えるようにアドバイスしていました。
したがって、ハック..「comint-send-input」のすぐ上に「comint-add-to-input-history」があります。
;;save command history
(defadvice comint-add-to-input-history (before pdb-save-history activate compile)
"write input ring on exit"
(message "%s" cmd)
(if (string-match "^e\\(x\\|xi\\|xit\\)?$" cmd)
(progn (comint-write-input-ring)
(message "history file '%s' written" comint-input-ring-file-name)))
)
fyi、デバッグセッションの入力リングを開始するためにこれらを持っています
;#debugger history
(defun debug-history-ring (file)
(comint-read-input-ring t)
(setq comint-input-ring-file-name file)
(setq comint-input-ring-size 1000)
(setq comint-input-ignoredups t))
(let ((hooks '((gdb-mode-hook . (lambda () (debug-history-ring "~/.gdbhist")))
(pdb-mode-hook . (lambda () (debug-history-ring "~/.pythonhist"))))))
(dolist (hook hooks) (print (cdr hook)) (add-hook (car hook) (cdr hook))))
..そして、デバッグバッファが強制終了された場合に履歴ファイルに書き込む
(add-hook 'kill-buffer-hook 'comint-write-input-ring)
乾杯。