]> git.eshelyaron.com Git - emacs.git/commitdiff
New newline minor mode visualization.
authorVinicius Jose Latorre <viniciusjl@ig.com.br>
Thu, 24 Jul 2008 04:12:27 +0000 (04:12 +0000)
committerVinicius Jose Latorre <viniciusjl@ig.com.br>
Thu, 24 Jul 2008 04:12:27 +0000 (04:12 +0000)
lisp/ChangeLog
lisp/whitespace.el

index 034cbb8e33ef0db6097c7fb6a78cc65a6ac0c4ea..4739b53947912d09b07e824d6f3afddbfd6b5e46 100644 (file)
@@ -1,3 +1,9 @@
+2008-07-24  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * whitespace.el: New version 11.2.
+       (whitespace-newline-mode, global-whitespace-newline-mode): New newline
+       minor mode visualization.
+
 2008-07-24  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * progmodes/cc-mode.el (auto-mode-alist): Add .i and .ii files.
index 8053483b70d3f0800819d292536f6b1d7b4d4fdc..d30933fdca30603d27f22da709f751e05d5162b9 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: data, wp
-;; Version: 11.1
+;; Version: 11.2
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
 ;; This file is part of GNU Emacs.
 ;;
 ;; There are also the following useful commands:
 ;;
+;; `whitespace-newline-mode'
+;;    Toggle newline minor mode visualization ("nl" on modeline).
+;;
+;; `global-whitespace-newline-mode'
+;;    Toggle newline global minor mode visualization ("NL" on modeline).
+;;
 ;; `whitespace-report'
 ;;    Report some blank problems in buffer.
 ;;
@@ -1016,6 +1022,26 @@ Only useful with a windowing system."
    (t                                  ; whitespace-mode off
     (whitespace-turn-off))))
 
+
+;;;###autoload
+(define-minor-mode whitespace-newline-mode
+  "Toggle newline minor mode visualization (\"nl\" on modeline).
+
+If ARG is null, toggle newline visualization.
+If ARG is a number greater than zero, turn on visualization;
+otherwise, turn off visualization.
+Only useful with a windowing system.
+
+See also `whitespace-newline'."
+  :lighter    " nl"
+  :init-value nil
+  :global     nil
+  :group      'whitespace
+  (let ((whitespace-style '(newline-mark newline)))
+    (whitespace-mode whitespace-newline-mode)
+    ;; sync states (running a batch job)
+    (setq whitespace-newline-mode whitespace-mode)))
+
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;; User commands - Global mode
@@ -1074,6 +1100,26 @@ Only useful with a windowing system."
        ;; Otherwise, turn on whitespace mode.
        (whitespace-turn-on)))))
 
+
+;;;###autoload
+(define-minor-mode global-whitespace-newline-mode
+  "Toggle newline global minor mode visualization (\"NL\" on modeline).
+
+If ARG is null, toggle newline visualization.
+If ARG is a number greater than zero, turn on visualization;
+otherwise, turn off visualization.
+Only useful with a windowing system.
+
+See also `whitespace-newline'."
+  :lighter    " NL"
+  :init-value nil
+  :global     t
+  :group      'whitespace
+  (let ((whitespace-style '(newline-mark newline)))
+    (global-whitespace-mode global-whitespace-newline-mode)
+    ;; sync states (running a batch job)
+    (setq global-whitespace-newline-mode global-whitespace-mode)))
+
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;; User commands - Toggle