summaryrefslogtreecommitdiff
path: root/lisp/whitespace.el
diff options
context:
space:
mode:
authorVinicius Jose Latorre <viniciusjl@ig.com.br>2008-07-24 04:12:27 +0000
committerVinicius Jose Latorre <viniciusjl@ig.com.br>2008-07-24 04:12:27 +0000
commit8b40bb55873806a68ea74c774c7e067114355341 (patch)
treec450c03956ea5f53087cc5c4fb2db2108db61e8a /lisp/whitespace.el
parent2f56f788e1e3a6328aa2d1ae09c7a1a59d9329c8 (diff)
downloademacs-8b40bb55873806a68ea74c774c7e067114355341.tar.gz
New newline minor mode visualization.
Diffstat (limited to 'lisp/whitespace.el')
-rw-r--r--lisp/whitespace.el48
1 files changed, 47 insertions, 1 deletions
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 8053483b70d..d30933fdca3 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -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.
@@ -160,6 +160,12 @@
;;
;; 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)))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; 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)))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; User commands - Toggle