Emacs: whitespace mode config and set on by default
parent
3e021512e0
commit
7fcc4cc0ba
|
@ -319,9 +319,16 @@ region. Output result at the end after an ' = ' separtor."
|
|||
(beginning-of-line)
|
||||
(point)))
|
||||
|
||||
|
||||
(defun toggle-trailing-whitespace ()
|
||||
(interactive)
|
||||
(if show-trailing-whitespace
|
||||
(setq show-trailing-whitespace nil)
|
||||
(setq show-trailing-whitespace t)))
|
||||
|
||||
(defun toggle-indent-tabs ()
|
||||
(interactive)
|
||||
(if indent-tabs-mode
|
||||
(setq indent-tabs-mode nil)
|
||||
(setq indent-tabs-mode t)))
|
||||
|
||||
(define-key my-keys-minor-mode-map (kbd "C-c C-i") 'toggle-indent-tabs)
|
||||
|
|
|
@ -88,11 +88,7 @@
|
|||
;; Highlight selections -- not activated by default on old Emacs.
|
||||
(transient-mark-mode 1)
|
||||
|
||||
;; No trailing whitespace
|
||||
;; WARNING: this can break some configuration files needing whitespaces at the
|
||||
;; end.
|
||||
;; (add-hook 'before-save-hook 'delete-trailing-whitespace)
|
||||
|
||||
;; Whitespace, tabs, and other frivolities.
|
||||
;; Highlight trailing whitespaces. For programming languages only, so that it
|
||||
;; does not affect buffer like calendar and so on. There is no prog-mode-hook on
|
||||
;; Emacs<24.
|
||||
|
@ -100,9 +96,16 @@
|
|||
(lambda (mode-hook)
|
||||
(add-hook
|
||||
mode-hook
|
||||
(lambda () (interactive)
|
||||
(setq show-trailing-whitespace t))))
|
||||
(lambda ()
|
||||
;; (setq show-trailing-whitespace t)
|
||||
(whitespace-mode))))
|
||||
'(prog-mode-hook lua-mode-hook))
|
||||
;; WARNING: this can break some configuration files needing whitespaces at the
|
||||
;; end.
|
||||
; (add-hook 'before-save-hook 'delete-trailing-whitespace)
|
||||
(setq whitespace-style (quote (face empty trailing tab-mark)))
|
||||
;; Does not seem to work properly.
|
||||
; (setq whitespace-action '(report-on-bogus))
|
||||
|
||||
;; Remove whitespaces on region, or whole file.
|
||||
(define-key my-keys-minor-mode-map (kbd "C-\\") 'delete-trailing-whitespace)
|
||||
|
|
Loading…
Reference in New Issue