From 152546ff48b03699008104cbffc31f237e8bb133 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sun, 23 Dec 2012 11:24:55 +0200 Subject: [PATCH] reenabled whitespace-mode by default and made it a lot less intrusive --- README.md | 8 ++++---- core/prelude-editor.el | 6 +++++- modules/prelude-programming.el | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 60a97cc..262f15a 100644 --- a/README.md +++ b/README.md @@ -235,14 +235,14 @@ P.S. Solarized is not available by default - you'll have to install it from MELP Fork the official Prelude repo and add your own touch to it. You're advised to avoid changing stuff outside of the personal folder to avoid having to deal with git merge conflicts in the future. -#### Enabling whitespace-mode +#### Disabling whitespace-mode -Although `whitespace-mode` is awesome some people find it too -intrusive so it's disabled by default. You can enable it in your +Although `whitespace-mode` is awesome some people might find it too +intrusive. You can disable it in your personal config with the following bit of code: ```lisp -(setq prelude-whitespace t) +(setq prelude-whitespace nil) ``` #### Disable flyspell-mode diff --git a/core/prelude-editor.el b/core/prelude-editor.el index 3d6cd03..e9945d6 100644 --- a/core/prelude-editor.el +++ b/core/prelude-editor.el @@ -48,7 +48,7 @@ :type 'boolean :group 'prelude) -(defcustom prelude-whitespace nil +(defcustom prelude-whitespace t "Non-nil values enable Prelude's whitespace visualization." :type 'boolean :group 'prelude) @@ -321,6 +321,10 @@ indent yanked text (with prefix arg don't indent)." (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) +;; whitespace-mode config +(setq whitespace-line-column 80) ;; limit line length +(setq whitespace-style '(face tabs empty trailing lines-tail)) + ;; saner regex syntax (require 're-builder) (setq reb-re-syntax 'string) diff --git a/modules/prelude-programming.el b/modules/prelude-programming.el index 0fade14..485ff60 100644 --- a/modules/prelude-programming.el +++ b/modules/prelude-programming.el @@ -115,11 +115,11 @@ (when prelude-guru (guru-mode +1)) (when prelude-whitespace + ;; keep the whitespace decent all the time (in this buffer) + (add-hook 'before-save-hook 'whitespace-cleanup nil t) (whitespace-mode +1)) (prelude-local-comment-auto-fill) - (prelude-add-watchwords) - ;; keep the whitespace decent all the time (in this buffer) - (add-hook 'before-save-hook 'whitespace-cleanup nil t)) + (prelude-add-watchwords)) (setq prelude-prog-mode-hook 'prelude-prog-mode-defaults)