From: Vinicius Jose Latorre Date: Sat, 30 Apr 2011 15:15:07 +0000 (-0300) Subject: keep highlight when switching between major modes on a file. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~164 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cb79b8c0517a92f93539db030db694b293fd8706;p=emacs.git keep highlight when switching between major modes on a file. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0817515d8cd..71c7eedb335 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 + + * whitespace.el: New version 13.2.1. + +2011-04-20 felix (tiny change) + + * whitespace.el (global-whitespace-mode): keep highlight when + switching between major modes on a file. + 2011-04-19 Stefan Monnier * progmodes/octave-mod.el (octave-in-comment-p, octave-in-string-p) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 955c417ee54..f5788eb1ee2 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -5,7 +5,7 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; 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 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