dir-locals.el: whitespace support

Submitted by Andres Gomez on Aug. 2, 2016, 4:53 p.m.

Details

Message ID 1470156810-6901-1-git-send-email-agomez@igalia.com
State Superseded
Headers show
Series "dir-locals.el: whitespace support" ( rev: 2 ) in Piglit

Not browsing as part of any series.

Commit Message

Andres Gomez Aug. 2, 2016, 4:53 p.m.
Highlight bogus indentation and long lines.

v2: python-mode inherits from prog-mode

Signed-off-by: Andres Gomez <agomez@igalia.com>
---
 .dir-locals.el | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/.dir-locals.el b/.dir-locals.el
index 3bdca17..554cafb 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,11 +1,20 @@ 
 ((nil . ((indent-tabs-mode . t)
 	 (tab-width . 8)
-	 (show-trailing-whitespace . t)))
+	 (show-trailing-whitespace . t)
+	 (whitespace-style face indentation lines-tail)
+	 (whitespace-line-column . 79)))
  (prog-mode .
-	    ((c-file-style . "linux")))
+	    ((c-file-style . "linux")
+	     (eval ignore-errors
+		   (require 'whitespace)
+		   (whitespace-mode 1))))
  (cmake-mode .
-	     ((cmake-tab-width . 8)))
+	     ((cmake-tab-width . 8)
+	      (eval ignore-errors
+		    (require 'whitespace)
+		    (whitespace-mode 1))))
  (python-mode .
 	      ((indent-tabs-mode . nil)
-	       (tab-width . 4)))
+	       (tab-width . 4)
+	       (whitespace-line-column . 80)))
  )

Comments

If nobody says otherwise, I will land this by the beginning of next
week.

On Tue, 2016-08-02 at 19:53 +0300, Andres Gomez wrote:
> Highlight bogus indentation and long lines.
> 
> v2: python-mode inherits from prog-mode
> 
> Signed-off-by: Andres Gomez <agomez@igalia.com>
> ---
>  .dir-locals.el | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/.dir-locals.el b/.dir-locals.el
> index 3bdca17..554cafb 100644
> --- a/.dir-locals.el
> +++ b/.dir-locals.el
> @@ -1,11 +1,20 @@
>  ((nil . ((indent-tabs-mode . t)
>  	 (tab-width . 8)
> -	 (show-trailing-whitespace . t)))
> +	 (show-trailing-whitespace . t)
> +	 (whitespace-style face indentation lines-tail)
> +	 (whitespace-line-column . 79)))
>   (prog-mode .
> -	    ((c-file-style . "linux")))
> +	    ((c-file-style . "linux")
> +	     (eval ignore-errors
> +		   (require 'whitespace)
> +		   (whitespace-mode 1))))
>   (cmake-mode .
> -	     ((cmake-tab-width . 8)))
> +	     ((cmake-tab-width . 8)
> +	      (eval ignore-errors
> +		    (require 'whitespace)
> +		    (whitespace-mode 1))))
>   (python-mode .
>  	      ((indent-tabs-mode . nil)
> -	       (tab-width . 4)))
> +	       (tab-width . 4)
> +	       (whitespace-line-column . 80)))
>   )