From 8420af71903a54aec980ee25c035584887c08a9f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 17 Dec 2015 01:41:58 +0100 Subject: [PATCH] Move markdown-mode-func to viewing library --- emacs/.emacs.d/init.el | 6 +----- emacs/.emacs.d/site-lisp/oni-viewing.el | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index bbbaf9d..6794388 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:markdown-mode-func () - "Function for `markdown-mode-hook'." - (setq-local whitespace-style '(face trailing))) - (defun oni:maybe-fci-mode () "Turn on `fci-mode' if there is a filename for the buffer." (when (buffer-file-name) @@ -1036,7 +1032,7 @@ If no direction is given, don't split." (oni:add-hooks 'lua-mode-hook 'oni:set-keys-for-lua) (oni:add-hooks 'markdown-mode-hook - #'whitespace-mode #'oni:markdown-mode-func) + #'whitespace-mode 'oni:show-trailing-whitespace) (oni:add-hooks 'php-mode-hook #'oni:php-mode-func) diff --git a/emacs/.emacs.d/site-lisp/oni-viewing.el b/emacs/.emacs.d/site-lisp/oni-viewing.el index 5f426ec..9af6a2f 100644 --- a/emacs/.emacs.d/site-lisp/oni-viewing.el +++ b/emacs/.emacs.d/site-lisp/oni-viewing.el @@ -25,10 +25,17 @@ ;;; Code: +(require 'whitespace) + ;;;###autoload (defun oni:make-readable () "Make non-programming buffers a little more readable." (setq line-spacing .2)) +;;;###autoload +(defun oni:show-trailing-whitespace () + "Function for `markdown-mode-hook'." + (setq-local whitespace-style '(face trailing))) + (provide 'oni-viewing) ;;; oni-viewing.el ends here