turns out using a mode in a hook always enables it so the turn on
functions were not actually needed
This commit is contained in:
parent
e62feee6e0
commit
d5c1edc297
2 changed files with 3 additions and 28 deletions
|
@ -231,23 +231,6 @@ there's a region, all lines that region covers will be duplicated."
|
|||
(cond ((search-forward "<?xml" nil t) (xml-mode))
|
||||
((search-forward "<html" nil t) (html-mode)))))
|
||||
|
||||
;; We have a number of turn-on-* functions since it's advised that lambda
|
||||
;; functions not go in hooks. Repeatedly evaluating an add-to-list with a
|
||||
;; hook value will repeatedly add it since there's no way to ensure
|
||||
;; that a lambda doesn't already exist in the list.
|
||||
|
||||
(defun prelude-turn-on-whitespace ()
|
||||
(whitespace-mode +1))
|
||||
|
||||
(defun prelude-turn-off-whitespace ()
|
||||
(whitespace-mode -1))
|
||||
|
||||
(defun prelude-turn-on-abbrev ()
|
||||
(abbrev-mode +1))
|
||||
|
||||
(defun prelude-turn-off-abbrev ()
|
||||
(abbrev-mode -1))
|
||||
|
||||
(defun prelude-untabify-buffer ()
|
||||
(interactive)
|
||||
(untabify (point-min) (point-max)))
|
||||
|
|
|
@ -168,13 +168,8 @@
|
|||
ispell-extra-args '("--sug-mode=ultra"))
|
||||
(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
|
||||
|
||||
(defun prelude-turn-on-flyspell ()
|
||||
"Force flyspell-mode on using a positive argument. For use in hooks."
|
||||
(interactive)
|
||||
(flyspell-mode +1))
|
||||
|
||||
(add-hook 'message-mode-hook 'prelude-turn-on-flyspell)
|
||||
(add-hook 'text-mode-hook 'prelude-turn-on-flyspell)
|
||||
(add-hook 'message-mode-hook 'flyspell-mode)
|
||||
(add-hook 'text-mode-hook 'flyspell-mode)
|
||||
|
||||
;; enable narrowing commands
|
||||
(put 'narrow-to-region 'disabled nil)
|
||||
|
@ -191,9 +186,6 @@
|
|||
(setq bookmark-default-file (concat prelude-savefile-dir "bookmarks")
|
||||
bookmark-save-flag 1)
|
||||
|
||||
;; enabled auto-fill mode in text-mode and all related modes
|
||||
(add-hook 'text-mode-hook 'turn-on-auto-fill)
|
||||
|
||||
;; load yasnippet
|
||||
(require 'yasnippet)
|
||||
(add-to-list 'yas/snippet-dirs prelude-snippets-dir)
|
||||
|
@ -267,7 +259,7 @@ indent yanked text (with prefix arg don't indent)."
|
|||
(yank-advised-indent-function (region-beginning) (region-end)))))
|
||||
|
||||
;; abbrev config
|
||||
(add-hook 'text-mode-hook 'prelude-turn-on-abbrev)
|
||||
(add-hook 'text-mode-hook 'abbrev-mode)
|
||||
|
||||
;; make a shell script executable automatically on save
|
||||
(add-hook 'after-save-hook
|
||||
|
|
Loading…
Reference in a new issue