keep highlight when switching between major modes on a file.

This commit is contained in:
Vinicius Jose Latorre 2011-04-30 12:15:07 -03:00
parent 8db90b7394
commit cb79b8c051
2 changed files with 15 additions and 1 deletions

View file

@ -485,6 +485,15 @@
Use the longitude argument rather than `calendar-longitude'.
(solar-date-next-longitude): Remove unused locals.
2011-04-20 Vinicius Jose Latorre <viniciusjl@ig.com.br>
* whitespace.el: New version 13.2.1.
2011-04-20 felix <EmacsWiki> (tiny change)
* whitespace.el (global-whitespace-mode): keep highlight when
switching between major modes on a file.
2011-04-19 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/octave-mod.el (octave-in-comment-p, octave-in-string-p)

View file

@ -5,7 +5,7 @@
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Keywords: data, wp
;; Version: 13.2
;; Version: 13.2.1
;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
;; This file is part of GNU Emacs.
@ -312,6 +312,9 @@
;; Acknowledgements
;; ----------------
;;
;; Thanks to felix (EmacsWiki) for keeping highlight when switching between
;; major modes on a file.
;;
;; Thanks to David Reitter <david.reitter@gmail.com> for suggesting a
;; `whitespace-newline' initialization with low contrast relative to
;; the background color.
@ -1132,6 +1135,7 @@ See also `whitespace-style', `whitespace-newline' and
(global-whitespace-mode ; global-whitespace-mode on
(save-excursion
(add-hook 'find-file-hook 'whitespace-turn-on-if-enabled)
(add-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled)
(dolist (buffer (buffer-list)) ; adjust all local mode
(set-buffer buffer)
(unless whitespace-mode
@ -1139,6 +1143,7 @@ See also `whitespace-style', `whitespace-newline' and
(t ; global-whitespace-mode off
(save-excursion
(remove-hook 'find-file-hook 'whitespace-turn-on-if-enabled)
(remove-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled)
(dolist (buffer (buffer-list)) ; adjust all local mode
(set-buffer buffer)
(unless whitespace-mode