Re: removing trailing blanks (and keeping them away)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Daniel P. Berrange" <berrange@xxxxxxxxxx> wrote:
> (require 'show-wspace)
> (add-hook 'font-lock-mode-hook 'highlight-trailing-whitespace)
>
> Which does the trick for me

I've found it useful to highlight space-before-TAB
and blank-lines-at-EOB, too.

(when window-system
  ;;; Create faces for highlighting white space.
  (copy-face 'underline 'ws-space-face)
  (set-face-foreground  'ws-space-face "red")
  (copy-face 'underline 'ws-unbreakable-space-face)
  (set-face-foreground  'ws-unbreakable-space-face "grey")

  ;;; Things to highlight in nearly every mode.
  (defvar always-font-lock-keywords
    '(("\\<\\(FIXME\\|XXX\\)[-!:]?\\>" 1 font-lock-warning-face t)
      ("\240"           0 'ws-unbreakable-space-face t)
      ("[ \t]+$"        0 'ws-space-face t)  ; trailing white space
      ("\\( +\\)\t"     1 'ws-space-face t)  ; spaces before a TAB
      ("\n\\(\n+\\)\\'" 1 'ws-space-face t)) ; blank lines at end of buffer
    "expressions to highlight in every font-lock enabled mode.")
  ...

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]