aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2013-03-17 21:50:32 -0400
committerStefan Monnier2013-03-17 21:50:32 -0400
commit2fcc7665107849677e6803b54cc7c668c0bcbd24 (patch)
tree702ac249cd3da6879e7e9f383f81e98f75ba6947 /lisp
parent5294599faf620fd9fdebb95d50ec4d9176ab6569 (diff)
downloademacs-2fcc7665107849677e6803b54cc7c668c0bcbd24.tar.gz
emacs-2fcc7665107849677e6803b54cc7c668c0bcbd24.zip
* lisp/whitespace.el: Fix double evaluation.
(whitespace-space, whitespace-hspace, whitespace-tab) (whitespace-newline, whitespace-trailing, whitespace-line) (whitespace-space-before-tab, whitespace-indentation) (whitespace-empty, whitespace-space-after-tab): Turn defcustoms into obsolete defvars. (whitespace-hspace-regexp): Fix regexp for emacs-unicode. (whitespace-color-on): Use a single font-lock-add-keywords call. Fix double-evaluation of face variables.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog20
-rw-r--r--lisp/whitespace.el359
2 files changed, 132 insertions, 247 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1bd0919f7c4..9026fa9f093 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,19 @@
12013-03-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * whitespace.el: Fix double evaluation.
4 (whitespace-space, whitespace-hspace, whitespace-tab)
5 (whitespace-newline, whitespace-trailing, whitespace-line)
6 (whitespace-space-before-tab, whitespace-indentation)
7 (whitespace-empty, whitespace-space-after-tab): Turn defcustoms into
8 obsolete defvars.
9 (whitespace-hspace-regexp): Fix regexp for emacs-unicode.
10 (whitespace-color-on): Use a single font-lock-add-keywords call.
11 Fix double-evaluation of face variables.
12
12013-03-17 Michael Albinus <michael.albinus@gmx.de> 132013-03-17 Michael Albinus <michael.albinus@gmx.de>
2 14
3 * net/tramp-adb.el (tramp-adb-parse-device-names): Use 15 * net/tramp-adb.el (tramp-adb-parse-device-names):
4 `start-process' instead of `call-process'. Otherwise, the 16 Use `start-process' instead of `call-process'. Otherwise, the
5 function might be blocked under MS Windows. (Bug#13299) 17 function might be blocked under MS Windows. (Bug#13299)
6 18
72013-03-17 Leo Liu <sdl.web@gmail.com> 192013-03-17 Leo Liu <sdl.web@gmail.com>
@@ -13,8 +25,8 @@
13 (eldoc-message-function): New variable. 25 (eldoc-message-function): New variable.
14 (eldoc-message): Use it. 26 (eldoc-message): Use it.
15 (eldoc-display-message-p) 27 (eldoc-display-message-p)
16 (eldoc-display-message-no-interference-p): Support 28 (eldoc-display-message-no-interference-p):
17 eldoc-post-insert-mode. 29 Support eldoc-post-insert-mode.
18 30
19 * simple.el (eval-expression-minibuffer-setup-hook): New hook. 31 * simple.el (eval-expression-minibuffer-setup-hook): New hook.
20 (eval-expression): Run it. 32 (eval-expression): Run it.
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 975b89f2fc2..b0bb610aa3a 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -554,13 +554,10 @@ See also `whitespace-display-mappings' for documentation."
554 (const :tag "(Mark) NEWLINEs" newline-mark))) 554 (const :tag "(Mark) NEWLINEs" newline-mark)))
555 :group 'whitespace) 555 :group 'whitespace)
556 556
557 557(defvar whitespace-space 'whitespace-space
558(defcustom whitespace-space 'whitespace-space
559 "Symbol face used to visualize SPACE. 558 "Symbol face used to visualize SPACE.
560 559Used when `whitespace-style' includes the value `spaces'.")
561Used when `whitespace-style' includes the value `spaces'." 560(make-obsolete-variable 'whitespace-space "use the face instead" "24.4")
562 :type 'face
563 :group 'whitespace)
564 561
565 562
566(defface whitespace-space 563(defface whitespace-space
@@ -573,13 +570,10 @@ Used when `whitespace-style' includes the value `spaces'."
573 :group 'whitespace) 570 :group 'whitespace)
574 571
575 572
576(defcustom whitespace-hspace 'whitespace-hspace 573(defvar whitespace-hspace 'whitespace-hspace
577 "Symbol face used to visualize HARD SPACE. 574 "Symbol face used to visualize HARD SPACE.
578 575Used when `whitespace-style' includes the value `spaces'.")
579Used when `whitespace-style' includes the value `spaces'." 576(make-obsolete-variable 'whitespace-hspace "use the face instead" "24.4")
580 :type 'face
581 :group 'whitespace)
582
583 577
584(defface whitespace-hspace ; 'nobreak-space 578(defface whitespace-hspace ; 'nobreak-space
585 '((((class color) (background dark)) 579 '((((class color) (background dark))
@@ -591,13 +585,10 @@ Used when `whitespace-style' includes the value `spaces'."
591 :group 'whitespace) 585 :group 'whitespace)
592 586
593 587
594(defcustom whitespace-tab 'whitespace-tab 588(defvar whitespace-tab 'whitespace-tab
595 "Symbol face used to visualize TAB. 589 "Symbol face used to visualize TAB.
596 590Used when `whitespace-style' includes the value `tabs'.")
597Used when `whitespace-style' includes the value `tabs'." 591(make-obsolete-variable 'whitespace-tab "use the face instead" "24.4")
598 :type 'face
599 :group 'whitespace)
600
601 592
602(defface whitespace-tab 593(defface whitespace-tab
603 '((((class color) (background dark)) 594 '((((class color) (background dark))
@@ -609,16 +600,12 @@ Used when `whitespace-style' includes the value `tabs'."
609 :group 'whitespace) 600 :group 'whitespace)
610 601
611 602
612(defcustom whitespace-newline 'whitespace-newline 603(defvar whitespace-newline 'whitespace-newline
613 "Symbol face used to visualize NEWLINE char mapping. 604 "Symbol face used to visualize NEWLINE char mapping.
614
615See `whitespace-display-mappings'. 605See `whitespace-display-mappings'.
616
617Used when `whitespace-style' includes the values `newline-mark' 606Used when `whitespace-style' includes the values `newline-mark'
618and `newline'." 607and `newline'.")
619 :type 'face 608(make-obsolete-variable 'whitespace-newline "use the face instead" "24.4")
620 :group 'whitespace)
621
622 609
623(defface whitespace-newline 610(defface whitespace-newline
624 '((default :weight normal) 611 '((default :weight normal)
@@ -634,13 +621,10 @@ See `whitespace-display-mappings'."
634 :group 'whitespace) 621 :group 'whitespace)
635 622
636 623
637(defcustom whitespace-trailing 'whitespace-trailing 624(defvar whitespace-trailing 'whitespace-trailing
638 "Symbol face used to visualize trailing blanks. 625 "Symbol face used to visualize trailing blanks.
639 626Used when `whitespace-style' includes the value `trailing'.")
640Used when `whitespace-style' includes the value `trailing'." 627(make-obsolete-variable 'whitespace-trailing "use the face instead" "24.4")
641 :type 'face
642 :group 'whitespace)
643
644 628
645(defface whitespace-trailing ; 'trailing-whitespace 629(defface whitespace-trailing ; 'trailing-whitespace
646 '((default :weight bold) 630 '((default :weight bold)
@@ -650,15 +634,11 @@ Used when `whitespace-style' includes the value `trailing'."
650 :group 'whitespace) 634 :group 'whitespace)
651 635
652 636
653(defcustom whitespace-line 'whitespace-line 637(defvar whitespace-line 'whitespace-line
654 "Symbol face used to visualize \"long\" lines. 638 "Symbol face used to visualize \"long\" lines.
655
656See `whitespace-line-column'. 639See `whitespace-line-column'.
657 640Used when `whitespace-style' includes the value `line'.")
658Used when `whitespace-style' includes the value `line'." 641(make-obsolete-variable 'whitespace-line "use the face instead" "24.4")
659 :type 'face
660 :group 'whitespace)
661
662 642
663(defface whitespace-line 643(defface whitespace-line
664 '((((class mono)) :inverse-video t :weight bold :underline t) 644 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -669,13 +649,11 @@ See `whitespace-line-column'."
669 :group 'whitespace) 649 :group 'whitespace)
670 650
671 651
672(defcustom whitespace-space-before-tab 'whitespace-space-before-tab 652(defvar whitespace-space-before-tab 'whitespace-space-before-tab
673 "Symbol face used to visualize SPACEs before TAB. 653 "Symbol face used to visualize SPACEs before TAB.
674 654Used when `whitespace-style' includes the value `space-before-tab'.")
675Used when `whitespace-style' includes the value `space-before-tab'." 655(make-obsolete-variable 'whitespace-space-before-tab
676 :type 'face 656 "use the face instead" "24.4")
677 :group 'whitespace)
678
679 657
680(defface whitespace-space-before-tab 658(defface whitespace-space-before-tab
681 '((((class mono)) :inverse-video t :weight bold :underline t) 659 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -684,13 +662,10 @@ Used when `whitespace-style' includes the value `space-before-tab'."
684 :group 'whitespace) 662 :group 'whitespace)
685 663
686 664
687(defcustom whitespace-indentation 'whitespace-indentation 665(defvar whitespace-indentation 'whitespace-indentation
688 "Symbol face used to visualize 8 or more SPACEs at beginning of line. 666 "Symbol face used to visualize 8 or more SPACEs at beginning of line.
689 667Used when `whitespace-style' includes the value `indentation'.")
690Used when `whitespace-style' includes the value `indentation'." 668(make-obsolete-variable 'whitespace-indentation "use the face instead" "24.4")
691 :type 'face
692 :group 'whitespace)
693
694 669
695(defface whitespace-indentation 670(defface whitespace-indentation
696 '((((class mono)) :inverse-video t :weight bold :underline t) 671 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -699,13 +674,10 @@ Used when `whitespace-style' includes the value `indentation'."
699 :group 'whitespace) 674 :group 'whitespace)
700 675
701 676
702(defcustom whitespace-empty 'whitespace-empty 677(defvar whitespace-empty 'whitespace-empty
703 "Symbol face used to visualize empty lines at beginning and/or end of buffer. 678 "Symbol face used to visualize empty lines at beginning and/or end of buffer.
704 679Used when `whitespace-style' includes the value `empty'.")
705Used when `whitespace-style' includes the value `empty'." 680(make-obsolete-variable 'whitespace-empty "use the face instead" "24.4")
706 :type 'face
707 :group 'whitespace)
708
709 681
710(defface whitespace-empty 682(defface whitespace-empty
711 '((((class mono)) :inverse-video t :weight bold :underline t) 683 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -714,13 +686,11 @@ Used when `whitespace-style' includes the value `empty'."
714 :group 'whitespace) 686 :group 'whitespace)
715 687
716 688
717(defcustom whitespace-space-after-tab 'whitespace-space-after-tab 689(defvar whitespace-space-after-tab 'whitespace-space-after-tab
718 "Symbol face used to visualize 8 or more SPACEs after TAB. 690 "Symbol face used to visualize 8 or more SPACEs after TAB.
719 691Used when `whitespace-style' includes the value `space-after-tab'.")
720Used when `whitespace-style' includes the value `space-after-tab'." 692(make-obsolete-variable 'whitespace-space-after-tab
721 :type 'face 693 "use the face instead" "24.4")
722 :group 'whitespace)
723
724 694
725(defface whitespace-space-after-tab 695(defface whitespace-space-after-tab
726 '((((class mono)) :inverse-video t :weight bold :underline t) 696 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -730,15 +700,9 @@ Used when `whitespace-style' includes the value `space-after-tab'."
730 700
731 701
732(defcustom whitespace-hspace-regexp 702(defcustom whitespace-hspace-regexp
733 "\\(\\(\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20\\)+\\)" 703 "\\(\u00A0+\\)"
734 "Specify HARD SPACE characters regexp. 704 "Specify HARD SPACE characters regexp.
735 705
736If you're using `mule' package, there may be other characters besides:
737
738 \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \"\\xF20\"
739
740that should be considered HARD SPACE.
741
742Here are some examples: 706Here are some examples:
743 707
744 \"\\\\(^\\xA0+\\\\)\" \ 708 \"\\\\(^\\xA0+\\\\)\" \
@@ -806,7 +770,7 @@ Used when `whitespace-style' includes `tabs'."
806 "\\([\t \u00A0]+\\)$" 770 "\\([\t \u00A0]+\\)$"
807 "Specify trailing characters regexp. 771 "Specify trailing characters regexp.
808 772
809If you're using `mule' package, there may be other characters besides: 773There may be other characters besides:
810 774
811 \" \" \"\\t\" \"\\u00A0\" 775 \" \" \"\\t\" \"\\u00A0\"
812 776
@@ -823,13 +787,6 @@ Used when `whitespace-style' includes `trailing'."
823(defcustom whitespace-space-before-tab-regexp "\\( +\\)\\(\t+\\)" 787(defcustom whitespace-space-before-tab-regexp "\\( +\\)\\(\t+\\)"
824 "Specify SPACEs before TAB regexp. 788 "Specify SPACEs before TAB regexp.
825 789
826If you're using `mule' package, there may be other characters besides:
827
828 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
829\"\\xF20\"
830
831that should be considered blank.
832
833Used when `whitespace-style' includes `space-before-tab', 790Used when `whitespace-style' includes `space-before-tab',
834`space-before-tab::tab' or `space-before-tab::space'." 791`space-before-tab::tab' or `space-before-tab::space'."
835 :type '(regexp :tag "SPACEs Before TAB") 792 :type '(regexp :tag "SPACEs Before TAB")
@@ -844,13 +801,6 @@ Used when `whitespace-style' includes `space-before-tab',
844It is a cons where the cons car is used for SPACEs visualization 801It is a cons where the cons car is used for SPACEs visualization
845and the cons cdr is used for TABs visualization. 802and the cons cdr is used for TABs visualization.
846 803
847If you're using `mule' package, there may be other characters besides:
848
849 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
850\"\\xF20\"
851
852that should be considered blank.
853
854Used when `whitespace-style' includes `indentation', 804Used when `whitespace-style' includes `indentation',
855`indentation::tab' or `indentation::space'." 805`indentation::tab' or `indentation::space'."
856 :type '(cons (regexp :tag "Indentation SPACEs") 806 :type '(cons (regexp :tag "Indentation SPACEs")
@@ -861,13 +811,6 @@ Used when `whitespace-style' includes `indentation',
861(defcustom whitespace-empty-at-bob-regexp "^\\(\\([ \t]*\n\\)+\\)" 811(defcustom whitespace-empty-at-bob-regexp "^\\(\\([ \t]*\n\\)+\\)"
862 "Specify regexp for empty lines at beginning of buffer. 812 "Specify regexp for empty lines at beginning of buffer.
863 813
864If you're using `mule' package, there may be other characters besides:
865
866 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
867\"\\xF20\"
868
869that should be considered blank.
870
871Used when `whitespace-style' includes `empty'." 814Used when `whitespace-style' includes `empty'."
872 :type '(regexp :tag "Empty Lines At Beginning Of Buffer") 815 :type '(regexp :tag "Empty Lines At Beginning Of Buffer")
873 :group 'whitespace) 816 :group 'whitespace)
@@ -876,13 +819,6 @@ Used when `whitespace-style' includes `empty'."
876(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)" 819(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)"
877 "Specify regexp for empty lines at end of buffer. 820 "Specify regexp for empty lines at end of buffer.
878 821
879If you're using `mule' package, there may be other characters besides:
880
881 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
882\"\\xF20\"
883
884that should be considered blank.
885
886Used when `whitespace-style' includes `empty'." 822Used when `whitespace-style' includes `empty'."
887 :type '(regexp :tag "Empty Lines At End Of Buffer") 823 :type '(regexp :tag "Empty Lines At End Of Buffer")
888 :group 'whitespace) 824 :group 'whitespace)
@@ -896,13 +832,6 @@ Used when `whitespace-style' includes `empty'."
896It is a cons where the cons car is used for SPACEs visualization 832It is a cons where the cons car is used for SPACEs visualization
897and the cons cdr is used for TABs visualization. 833and the cons cdr is used for TABs visualization.
898 834
899If you're using `mule' package, there may be other characters besides:
900
901 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
902\"\\xF20\"
903
904that should be considered blank.
905
906Used when `whitespace-style' includes `space-after-tab', 835Used when `whitespace-style' includes `space-after-tab',
907`space-after-tab::tab' or `space-after-tab::space'." 836`space-after-tab::tab' or `space-after-tab::space'."
908 :type '(regexp :tag "SPACEs After TAB") 837 :type '(regexp :tag "SPACEs After TAB")
@@ -2249,144 +2178,88 @@ resultant list will be returned."
2249 (set (make-local-variable 'whitespace-font-lock-mode) 2178 (set (make-local-variable 'whitespace-font-lock-mode)
2250 font-lock-mode) 2179 font-lock-mode)
2251 (font-lock-mode 0) 2180 (font-lock-mode 0)
2252 ;; add whitespace-mode color into font lock 2181 ;; Add whitespace-mode color into font lock.
2253 (when (memq 'spaces whitespace-active-style) 2182 (font-lock-add-keywords
2254 (font-lock-add-keywords 2183 nil
2255 nil 2184 `(
2256 (list 2185 ,@(when (memq 'spaces whitespace-active-style)
2257 ;; Show SPACEs 2186 ;; Show SPACEs.
2258 (list whitespace-space-regexp 1 whitespace-space t) 2187 `((,whitespace-space-regexp 1 whitespace-space t)
2259 ;; Show HARD SPACEs 2188 ;; Show HARD SPACEs.
2260 (list whitespace-hspace-regexp 1 whitespace-hspace t)) 2189 (,whitespace-hspace-regexp 1 whitespace-hspace t)))
2261 t)) 2190 ,@(when (memq 'tabs whitespace-active-style)
2262 (when (memq 'tabs whitespace-active-style) 2191 ;; Show TABs.
2263 (font-lock-add-keywords 2192 `((,whitespace-tab-regexp 1 whitespace-tab t)))
2264 nil 2193 ,@(when (memq 'trailing whitespace-active-style)
2265 (list 2194 ;; Show trailing blanks.
2266 ;; Show TABs 2195 `((,#'whitespace-trailing-regexp 1 whitespace-trailing t)))
2267 (list whitespace-tab-regexp 1 whitespace-tab t)) 2196 ,@(when (or (memq 'lines whitespace-active-style)
2268 t)) 2197 (memq 'lines-tail whitespace-active-style))
2269 (when (memq 'trailing whitespace-active-style) 2198 ;; Show "long" lines.
2270 (font-lock-add-keywords 2199 `((,(let ((line-column (or whitespace-line-column fill-column)))
2271 nil 2200 (format
2272 (list 2201 "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$"
2273 ;; Show trailing blanks 2202 whitespace-tab-width
2274 (list #'whitespace-trailing-regexp 1 whitespace-trailing t)) 2203 (1- whitespace-tab-width)
2275 t)) 2204 (/ line-column whitespace-tab-width)
2276 (when (or (memq 'lines whitespace-active-style) 2205 (let ((rem (% line-column whitespace-tab-width)))
2277 (memq 'lines-tail whitespace-active-style)) 2206 (if (zerop rem)
2278 (font-lock-add-keywords 2207 ""
2279 nil 2208 (format ".\\{%d\\}" rem)))))
2280 (list 2209 ,(if (memq 'lines whitespace-active-style)
2281 ;; Show "long" lines 2210 0 ; whole line
2282 (list 2211 2) ; line tail
2283 (let ((line-column (or whitespace-line-column fill-column))) 2212 whitespace-line t)))
2284 (format 2213 ,@(when (or (memq 'space-before-tab whitespace-active-style)
2285 "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$" 2214 (memq 'space-before-tab::tab whitespace-active-style)
2286 whitespace-tab-width 2215 (memq 'space-before-tab::space whitespace-active-style))
2287 (1- whitespace-tab-width) 2216 `((,whitespace-space-before-tab-regexp
2288 (/ line-column whitespace-tab-width) 2217 ,(cond
2289 (let ((rem (% line-column whitespace-tab-width))) 2218 ((memq 'space-before-tab whitespace-active-style)
2290 (if (zerop rem) 2219 ;; Show SPACEs before TAB (indent-tabs-mode).
2291 "" 2220 (if whitespace-indent-tabs-mode 1 2))
2292 (format ".\\{%d\\}" rem))))) 2221 ((memq 'space-before-tab::tab whitespace-active-style)
2293 (if (memq 'lines whitespace-active-style) 2222 1)
2294 0 ; whole line 2223 ((memq 'space-before-tab::space whitespace-active-style)
2295 2) ; line tail 2224 2))
2296 whitespace-line t)) 2225 whitespace-space-before-tab t)))
2297 t)) 2226 ,@(when (or (memq 'indentation whitespace-active-style)
2298 (cond 2227 (memq 'indentation::tab whitespace-active-style)
2299 ((memq 'space-before-tab whitespace-active-style) 2228 (memq 'indentation::space whitespace-active-style))
2300 (font-lock-add-keywords 2229 `((,(cond
2301 nil 2230 ((memq 'indentation whitespace-active-style)
2302 (list 2231 ;; Show indentation SPACEs (indent-tabs-mode).
2303 ;; Show SPACEs before TAB (indent-tabs-mode) 2232 (whitespace-indentation-regexp))
2304 (list whitespace-space-before-tab-regexp 2233 ((memq 'indentation::tab whitespace-active-style)
2305 (if whitespace-indent-tabs-mode 1 2) 2234 ;; Show indentation SPACEs (SPACEs).
2306 whitespace-space-before-tab t)) 2235 (whitespace-indentation-regexp 'tab))
2307 t)) 2236 ((memq 'indentation::space whitespace-active-style)
2308 ((memq 'space-before-tab::tab whitespace-active-style) 2237 ;; Show indentation SPACEs (TABs).
2309 (font-lock-add-keywords 2238 (whitespace-indentation-regexp 'space)))
2310 nil 2239 1 whitespace-indentation t)))
2311 (list 2240 ,@(when (memq 'empty whitespace-active-style)
2312 ;; Show SPACEs before TAB (SPACEs) 2241 ;; Show empty lines at beginning of buffer.
2313 (list whitespace-space-before-tab-regexp 2242 `((,#'whitespace-empty-at-bob-regexp
2314 1 whitespace-space-before-tab t)) 2243 1 whitespace-empty t)
2315 t)) 2244 ;; Show empty lines at end of buffer.
2316 ((memq 'space-before-tab::space whitespace-active-style) 2245 (,#'whitespace-empty-at-eob-regexp
2317 (font-lock-add-keywords 2246 1 whitespace-empty t)))
2318 nil 2247 ,@(when (or (memq 'space-after-tab whitespace-active-style)
2319 (list 2248 (memq 'space-after-tab::tab whitespace-active-style)
2320 ;; Show SPACEs before TAB (TABs) 2249 (memq 'space-after-tab::space whitespace-active-style))
2321 (list whitespace-space-before-tab-regexp 2250 `((,(cond
2322 2 whitespace-space-before-tab t)) 2251 ((memq 'space-after-tab whitespace-active-style)
2323 t))) 2252 ;; Show SPACEs after TAB (indent-tabs-mode).
2324 (cond 2253 (whitespace-space-after-tab-regexp))
2325 ((memq 'indentation whitespace-active-style) 2254 ((memq 'space-after-tab::tab whitespace-active-style)
2326 (font-lock-add-keywords 2255 ;; Show SPACEs after TAB (SPACEs).
2327 nil 2256 (whitespace-space-after-tab-regexp 'tab))
2328 (list 2257 ((memq 'space-after-tab::space whitespace-active-style)
2329 ;; Show indentation SPACEs (indent-tabs-mode) 2258 ;; Show SPACEs after TAB (TABs).
2330 (list (whitespace-indentation-regexp) 2259 (whitespace-space-after-tab-regexp 'space)))
2331 1 whitespace-indentation t)) 2260 1 whitespace-space-after-tab t))))
2332 t)) 2261 t)
2333 ((memq 'indentation::tab whitespace-active-style) 2262 ;; Now turn on font lock and highlight blanks.
2334 (font-lock-add-keywords
2335 nil
2336 (list
2337 ;; Show indentation SPACEs (SPACEs)
2338 (list (whitespace-indentation-regexp 'tab)
2339 1 whitespace-indentation t))
2340 t))
2341 ((memq 'indentation::space whitespace-active-style)
2342 (font-lock-add-keywords
2343 nil
2344 (list
2345 ;; Show indentation SPACEs (TABs)
2346 (list (whitespace-indentation-regexp 'space)
2347 1 whitespace-indentation t))
2348 t)))
2349 (when (memq 'empty whitespace-active-style)
2350 (font-lock-add-keywords
2351 nil
2352 (list
2353 ;; Show empty lines at beginning of buffer
2354 (list #'whitespace-empty-at-bob-regexp
2355 1 whitespace-empty t))
2356 t)
2357 (font-lock-add-keywords
2358 nil
2359 (list
2360 ;; Show empty lines at end of buffer
2361 (list #'whitespace-empty-at-eob-regexp
2362 1 whitespace-empty t))
2363 t))
2364 (cond
2365 ((memq 'space-after-tab whitespace-active-style)
2366 (font-lock-add-keywords
2367 nil
2368 (list
2369 ;; Show SPACEs after TAB (indent-tabs-mode)
2370 (list (whitespace-space-after-tab-regexp)
2371 1 whitespace-space-after-tab t))
2372 t))
2373 ((memq 'space-after-tab::tab whitespace-active-style)
2374 (font-lock-add-keywords
2375 nil
2376 (list
2377 ;; Show SPACEs after TAB (SPACEs)
2378 (list (whitespace-space-after-tab-regexp 'tab)
2379 1 whitespace-space-after-tab t))
2380 t))
2381 ((memq 'space-after-tab::space whitespace-active-style)
2382 (font-lock-add-keywords
2383 nil
2384 (list
2385 ;; Show SPACEs after TAB (TABs)
2386 (list (whitespace-space-after-tab-regexp 'space)
2387 1 whitespace-space-after-tab t))
2388 t)))
2389 ;; now turn on font lock and highlight blanks
2390 (font-lock-mode 1))) 2263 (font-lock-mode 1)))
2391 2264
2392 2265