From bad6d8532b3cc36ecf083287db0603d56018e2bf Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 4 Jun 2024 08:09:47 +1000 Subject: [emacs] the comint history write hook should be added to gud only --- emacs/.emacs.d/init/ycp-prog.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs.d/init/ycp-prog.el b/emacs/.emacs.d/init/ycp-prog.el index b1d0634..f77a8bd 100644 --- a/emacs/.emacs.d/init/ycp-prog.el +++ b/emacs/.emacs.d/init/ycp-prog.el @@ -109,13 +109,15 @@ "C-c C-n" 'comint-next-prompt) (add-hook 'gud-mode-hook 'my-gud-comint-set-prompt-regexp) (add-hook 'gud-mode-hook 'company-mode) + ;; Don't make this a general comint-mode hook, as it will overwrite + ;; bash history rather than append to it. + (add-hook 'gud-mode-hook 'my-comint-add-write-history-hook) ) (my-package my-prog (:delay 10) ;; tab-width 8 for ls etc. (add-hook 'shell-mode-hook 'my-set-tab-width-to-8) - (add-hook 'comint-mode-hook 'my-comint-add-write-history-hook) (my-keybind comint-mode-map "C-" #'my-comint-send-input-and-return-prompt) (add-to-list 'my-buffer-create-functions -- cgit v1.2.3