aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2024-05-23 21:16:09 +1000
committerYuchen Pei <id@ypei.org>2024-05-23 21:16:09 +1000
commit24facac76e1b32248e4fde00d9418efa55f77886 (patch)
treecde83bf0a85d010045eb1008873a2ea716cb067d /emacs/.emacs.d/lisp
parentba0adb67f9a96ea34042ab55e2823868b15ef6ee (diff)
[emacs] more smooth experience in gud
- auto confirm debuginfod - write to history on kill
Diffstat (limited to 'emacs/.emacs.d/lisp')
-rw-r--r--emacs/.emacs.d/lisp/my/my-prog.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-prog.el b/emacs/.emacs.d/lisp/my/my-prog.el
index 9d6a778..900adaf 100644
--- a/emacs/.emacs.d/lisp/my/my-prog.el
+++ b/emacs/.emacs.d/lisp/my/my-prog.el
@@ -54,6 +54,13 @@
(sleep-for .1)
(my-comint-revive))
+(defun my-comint-add-write-history-hook ()
+ "Add `comint-write-input-ring' to `kill-buffer-hook'.
+
+To use as a hook to comint mode, so that history is updated on
+buffer kill."
+ (add-hook 'kill-buffer-hook 'comint-write-input-ring 0 t))
+
(defvar my-comint-revive-commands
'((shell-mode . my-shell-revive)
(inferior-emacs-lisp-mode . ielm))
@@ -329,12 +336,9 @@ left and the source buffer on the right.
(defun my-gdb-quit ()
(interactive)
- (let ((old-window (selected-window)))
- (select-window (get-buffer-window gud-comint-buffer))
- (goto-char (point-max))
- (gdb-delchar-or-quit 0)
- (my-toggle-lock-current-window-to-buffer)
- (when (window-live-p old-window) (select-window old-window))))
+ (let ((kill-buffer-query-functions nil))
+ (kill-buffer gud-comint-buffer))
+ )
(defun my-gdb-frames-add-breakpoint ()
(interactive)