Move some functions to viewing library

This commit is contained in:
Tom Willemse 2015-12-17 01:45:13 +01:00
parent 83b0c62b49
commit bdf984607e
2 changed files with 16 additions and 13 deletions

View file

@ -141,16 +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:maybe-fci-mode ()
"Turn on `fci-mode' if there is a filename for the buffer."
(when (buffer-file-name)
(fci-mode)))
(defun oni:maybe-prettify-symbols-mode (&optional arg)
"See of `prettify-symbols-mode' is bound and call it if so."
(when (fboundp 'prettify-symbols-mode)
(prettify-symbols-mode arg)))
(defun oni:mini-fix-timestamp-string (date-string)
"A minimal version of Xah Lee's `fix-timestamp-string'.
Turn DATE-STRING into something else that can be worked with in
@ -1009,7 +999,7 @@ If no direction is given, don't split."
(gnus-summary-next-subject 1)))))
(oni:add-hooks 'html-mode-hook
#'oni:maybe-fci-mode #'tagedit-mode #'turn-off-flyspell
'oni:maybe-fci-mode #'tagedit-mode #'turn-off-flyspell
#'turn-off-auto-fill)
(oni:add-hooks 'hy-mode-hook
@ -1038,8 +1028,8 @@ If no direction is given, don't split."
#'oni:php-mode-func)
(oni:add-hooks 'prog-mode-hook
#'oni:prog-mode-func #'oni:maybe-fci-mode #'rainbow-delimiters-mode
#'oni:maybe-prettify-symbols-mode)
#'oni:prog-mode-func 'oni:maybe-fci-mode #'rainbow-delimiters-mode
'oni:maybe-prettify-symbols-mode)
(oni:add-hooks 'python-mode-hook
(lambda () (setq ac-sources '(ac-source-jedi-direct)))

View file

@ -26,12 +26,25 @@
;;; Code:
(require 'whitespace)
(require 'fill-column-indicator)
;;;###autoload
(defun oni:make-readable ()
"Make non-programming buffers a little more readable."
(setq line-spacing .2))
;;;###autoload
(defun oni:maybe-fci-mode ()
"Turn on `fci-mode' if there is a filename for the buffer."
(when (buffer-file-name)
(fci-mode)))
;;;###autoload
(defun oni:maybe-prettify-symbols-mode (&optional arg)
"See of `prettify-symbols-mode' is bound and call it if so."
(when (fboundp 'prettify-symbols-mode)
(prettify-symbols-mode arg)))
;;;###autoload
(defun oni:show-trailing-whitespace ()
"Function for `markdown-mode-hook'."