Move some functions to viewing library
This commit is contained in:
parent
83b0c62b49
commit
bdf984607e
2 changed files with 16 additions and 13 deletions
|
@ -141,16 +141,6 @@ MODE1 is enabled and vice-versa."
|
||||||
"Set the `disabled' property for each item in FUNCTIONS to nil."
|
"Set the `disabled' property for each item in FUNCTIONS to nil."
|
||||||
(mapc #'(lambda (f) (put f 'disabled nil)) functions))
|
(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)
|
(defun oni:mini-fix-timestamp-string (date-string)
|
||||||
"A minimal version of Xah Lee's `fix-timestamp-string'.
|
"A minimal version of Xah Lee's `fix-timestamp-string'.
|
||||||
Turn DATE-STRING into something else that can be worked with in
|
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)))))
|
(gnus-summary-next-subject 1)))))
|
||||||
|
|
||||||
(oni:add-hooks 'html-mode-hook
|
(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)
|
#'turn-off-auto-fill)
|
||||||
|
|
||||||
(oni:add-hooks 'hy-mode-hook
|
(oni:add-hooks 'hy-mode-hook
|
||||||
|
@ -1038,8 +1028,8 @@ If no direction is given, don't split."
|
||||||
#'oni:php-mode-func)
|
#'oni:php-mode-func)
|
||||||
|
|
||||||
(oni:add-hooks 'prog-mode-hook
|
(oni:add-hooks 'prog-mode-hook
|
||||||
#'oni:prog-mode-func #'oni:maybe-fci-mode #'rainbow-delimiters-mode
|
#'oni:prog-mode-func 'oni:maybe-fci-mode #'rainbow-delimiters-mode
|
||||||
#'oni:maybe-prettify-symbols-mode)
|
'oni:maybe-prettify-symbols-mode)
|
||||||
|
|
||||||
(oni:add-hooks 'python-mode-hook
|
(oni:add-hooks 'python-mode-hook
|
||||||
(lambda () (setq ac-sources '(ac-source-jedi-direct)))
|
(lambda () (setq ac-sources '(ac-source-jedi-direct)))
|
||||||
|
|
|
@ -26,12 +26,25 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'whitespace)
|
(require 'whitespace)
|
||||||
|
(require 'fill-column-indicator)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun oni:make-readable ()
|
(defun oni:make-readable ()
|
||||||
"Make non-programming buffers a little more readable."
|
"Make non-programming buffers a little more readable."
|
||||||
(setq line-spacing .2))
|
(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
|
;;;###autoload
|
||||||
(defun oni:show-trailing-whitespace ()
|
(defun oni:show-trailing-whitespace ()
|
||||||
"Function for `markdown-mode-hook'."
|
"Function for `markdown-mode-hook'."
|
||||||
|
|
Loading…
Reference in a new issue