emacsで全角スペース・Tabを強調表示.

jspace.el(http://homepage3.nifty.com/satomii/software/elisp.ja.html)をsite-lispに追加.んで,色が変わるように適宜調整.次のwebサイトにある記述をまんま参考にさせてもらった,多謝.参考:http://openlab.dino.co.jp/2008/08/29/230500336.html

参考サイトの記述にyatex-modeを対象モードに追加すればよい.すると,以下のような記述を追加することになる.

;; タブ, 全角スペース、改行直前の半角スペースを表示する                         
(when (require 'jaspace nil t)
    (when (boundp 'jaspace-modes)
          (setq jaspace-modes (append jaspace-modes
                                  (list 'php-mode
                                        'yaml-mode
                                        'javascript-mode
                                        'ruby-mode
                                        'text-mode
                                        'yatex-mode
                                        'cc-mode
                                        'c++-mode
                                        'fundamental-mode))))
    (when (boundp 'jaspace-alternate-jaspace-string)
        (setq jaspace-alternate-jaspace-string "□"))
    (when (boundp 'jaspace-highlight-tabs)
        (setq jaspace-highlight-tabs ?^))
    (add-hook 'jaspace-mode-off-hook
             (lambda()
              (when (boundp 'show-trailing-whitespace)
                (setq show-trailing-whitespace nil))))
    (add-hook 'jaspace-mode-hook
             (lambda()
              (progn
                (when (boundp 'show-trailing-whitespace)
                  (setq show-trailing-whitespace t))
                (face-spec-set 'jaspace-highlight-jaspace-face
                             '((((class color) (background light))
                                (:foreground "blue"))
                               (t (:foreground "green"))))
                (face-spec-set 'jaspace-highlight-tab-face
                             '((((class color) (background light))
                                (:foreground "red"
                                 :background "unspecified"
                                 :strike-through nil
                                 :underline t))
                               (t (:foreground "purple"
                                   :background "unspecified"
                                   :strike-through nil
                                   :underline t))))
                (face-spec-set 'trailing-whitespace
                             '((((class color) (background light))
                                (:foreground "red"
                                 :background "unspecified"
                                 :strike-through nil
                                 :underline t))
                               (t (:foreground "purple"
                                   :background "unspecified"
                                   :strike-through nil
                                   :underline t))))))))

CとかC++のモードに追加すると便利かな・・・.というわけで,cc-modeとc++-modeも追加しておく.