From d35275797e2c05c186aa72c30c8c405e12a40479 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 8 Apr 2016 11:20:59 -0400 Subject: [PATCH] Improve comint/term/gud config - move comint config to its own use-package and setq-default its variables - Pmove variables to hooks where necessary --- .emacs.d/init.el | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 7d95a73..23f12b6 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -87,24 +87,35 @@ :defer :config (add-to-list 'tramp-remote-path 'tramp-own-remote-path) - (add-to-list 'tramp-remote-path '"/home/adam/asgoldsmith/install/bin/")) + (add-to-list 'tramp-remote-path '"/home/adam/asgoldsmith/install/bin/") + (setq tramp-default-method "ssh")) + +(use-package comint + :config + (setq-default comint-scroll-to-bottom-on-input t ; always insert at the bottom + comint-scroll-to-bottom-on-output nil ; always add output at the bottom + comint-scroll-show-maximum-output t ; scroll to show max possible output + ;; comint-completion-autolist t ; show completion list when ambiguous + comint-input-ignoredups t ; no duplicates in command history + comint-completion-addsuffix t ; insert space/slash after file completion + comint-buffer-maximum-size 20000 ; max length of the buffer in lines + comint-get-old-input (lambda () "") ; what to run when i press enter on a + ; line above the current prompt + comint-input-ring-size 500) ; max shell history size + (add-hook 'comint-mode-hook + '(lambda () (setq-local show-trailing-whitespace nil)))) (use-package term :config - (setq tramp-default-method "ssh" ; uses ControlMaster - comint-scroll-to-bottom-on-input t ; always insert at the bottom - comint-scroll-to-bottom-on-output nil ; always add output at the bottom - comint-scroll-show-maximum-output t ; scroll to show max possible output - ;; comint-completion-autolist t ; show completion list when ambiguous - comint-input-ignoredups t ; no duplicates in command history - comint-completion-addsuffix t ; insert space/slash after file completion - comint-buffer-maximum-size 20000 ; max length of the buffer in lines - comint-prompt-read-only nil ; if this is t, it breaks shell-command - comint-get-old-input (lambda () "") ; what to run when i press enter on a - ; line above the current prompt - comint-input-ring-size 500 ; max shell history size - protect-buffer-bury-p nil) - (add-hook 'term-mode-hook'(lambda () (setq-local show-trailing-whitespace nil)))) + (add-hook 'term-mode-hook + '(lambda () (setq-local + ;if this is t, it breaks shell-command + comint-prompt-read-only nil)))) + +(use-package gud + :config + (add-hook 'gud-mode-hook + '(lambda () (setq-local comint-prompt-read-only t)))) ;;;; external packages (required) (use-package company :quelpa