aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2024-06-04 08:09:47 +1000
committerYuchen Pei <id@ypei.org>2024-06-04 08:09:47 +1000
commitbad6d8532b3cc36ecf083287db0603d56018e2bf (patch)
tree1f58b338808fa50956dbf7665389282a8f744a7b
parent39bcc45813e0330b7d2321430716614f3653bb9f (diff)
[emacs] the comint history write hook should be added to gud only
-rw-r--r--emacs/.emacs.d/init/ycp-prog.el4
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