diff options
author | Yuchen Pei <id@ypei.org> | 2024-06-04 08:09:47 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2024-06-04 08:09:47 +1000 |
commit | bad6d8532b3cc36ecf083287db0603d56018e2bf (patch) | |
tree | 1f58b338808fa50956dbf7665389282a8f744a7b /emacs | |
parent | 39bcc45813e0330b7d2321430716614f3653bb9f (diff) |
[emacs] the comint history write hook should be added to gud only
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init/ycp-prog.el | 4 |
1 files changed, 3 insertions, 1 deletions
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-<return>" #'my-comint-send-input-and-return-prompt) (add-to-list 'my-buffer-create-functions |