From 9f3b09b5b1d1fc46bbdcf29d04513ce06e087169 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 18 Dec 2015 21:28:31 +0100 Subject: [PATCH] Move term-mode-func to display library --- emacs/.emacs.d/init.el | 13 +++++++------ emacs/.emacs.d/site-lisp/oni-display.el | 5 +++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index b8f459f..43c307d 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -141,10 +141,6 @@ MODE1 is enabled and vice-versa." "Set the `disabled' property for each item in FUNCTIONS to nil." (mapc #'(lambda (f) (put f 'disabled nil)) functions)) -(defun oni:term-mode-func () - "Function for `term-mode-hook'." - (setq truncate-lines nil)) - (defun oni:vala-mode-func () "Function for `vala-mode-hook'." (setq indent-tabs-mode nil)) @@ -561,11 +557,16 @@ MODE1 is enabled and vice-versa." ;; Support the prompt from MariaDB (add-hook 'sql-interactive-mode-hook 'oni:augment-sql-prompt) -(add-hook 'term-mode-hook 'oni:term-mode-func) +;; Disable line truncation in term-mode. +(add-hook 'term-mode-hook 'oni:disable-line-truncation) + (add-hook 'vala-mode-hook #'oni:vala-mode-func) (add-hook 'write-file-hooks 'oni:write-file-func) (add-hook 'yas-global-mode-hook 'oni:yas-minor-mode-func) -(add-hook 'ert-results-mode-hook (lambda () (setq truncate-lines nil))) + +;; Disable line truncation in ERT results. +(add-hook 'ert-results-mode-hook 'oni:disable-line-truncation) + (add-hook 'ruby-mode-hook (lambda () (setq-local fci-rule-column 80))) (add-hook 'projectile-rails-mode-hook (lambda () (define-key projectile-rails-mode-map (kbd "C-c r") 'hydra-projectile-rails/body))) (add-hook 'projectile-mode-hook 'projectile-rails-on) diff --git a/emacs/.emacs.d/site-lisp/oni-display.el b/emacs/.emacs.d/site-lisp/oni-display.el index 8335126..fc154cb 100644 --- a/emacs/.emacs.d/site-lisp/oni-display.el +++ b/emacs/.emacs.d/site-lisp/oni-display.el @@ -24,6 +24,11 @@ ;;; Code: +;;;###autoload +(defun oni:disable-line-truncation () + "Function for `term-mode-hook'." + (setq truncate-lines nil)) + ;;;###autoload (defun oni:pop-to-buffer-in-side-window (buffer alist) "Display and select BUFFER in a side window."