[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode ec024f1e2a 148/308: `drupal/phpcs-dont-show-tr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode ec024f1e2a 148/308: `drupal/phpcs-dont-show-trailing-whitespace` common to flycheck and flymake. |
Date: |
Tue, 25 Jan 2022 10:59:40 -0500 (EST) |
branch: elpa/drupal-mode
commit ec024f1e2a631095b95a02aac3d048eea0445fc2
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
`drupal/phpcs-dont-show-trailing-whitespace` common to flycheck and flymake.
---
drupal/flycheck.el | 14 +-------------
drupal/flymake-phpcs.el | 13 ++-----------
drupal/phpcs.el | 16 ++++++++++++++++
3 files changed, 19 insertions(+), 24 deletions(-)
diff --git a/drupal/flycheck.el b/drupal/flycheck.el
index 0cc0d214e7..1aef618e9e 100644
--- a/drupal/flycheck.el
+++ b/drupal/flycheck.el
@@ -27,15 +27,6 @@
(require 'drupal/phpcs)
-(defcustom drupal/flycheck-phpcs-dont-show-trailing-whitespace t
- "Non-nil means don't highlight trailing whitespace when flycheck-phpcs is in
use.
-Flycheck-phpcs will also highlight trailing whitespace as an error
-so no need to highlight it twice."
- :type `(choice
- (const :tag "Yes" t)
- (const :tag "No" nil))
- :group 'drupal)
-
(defcustom drupal/flycheck-phpcs-js-and-css t
"When Non-nil, override Flycheck to use PHPCS for checking CSS and
JavaScript files instead of the checkers configured for css-mode and js-mode."
:type `(choice
@@ -53,10 +44,7 @@ so no need to highlight it twice."
;; Flycheck will also highlight trailing whitespace as an
;; error so no need to highlight it twice.
- (when drupal/flycheck-phpcs-dont-show-trailing-whitespace
- (setq show-trailing-whitespace nil))
- )
-)
+ (drupal/phpcs-dont-show-trailing-whitespace)))
(add-hook 'drupal-mode-hook #'drupal/flycheck-hook)
diff --git a/drupal/flymake-phpcs.el b/drupal/flymake-phpcs.el
index 42e86f4420..671e3a172d 100644
--- a/drupal/flymake-phpcs.el
+++ b/drupal/flymake-phpcs.el
@@ -29,17 +29,9 @@
(require 'flymake-phpcs)
(define-obsolete-variable-alias 'drupal/flymake-phpcs-standard
'drupal/phpcs-standard)
+(define-obsolete-variable-alias
'drupal/flymake-phpcs-dont-show-trailing-whitespace
'drupal/phpcs-dont-show-trailing-whitespace)
(require 'drupal/phpcs)
-(defcustom drupal/flymake-phpcs-dont-show-trailing-whitespace t
- "Non-nil means don't highlight trailing whitespace when flymake-phpcs is in
use.
-Flymake-phpcs will also highlight trailing whitespace as an error
-so no need to highlight it twice."
- :type `(choice
- (const :tag "Yes" t)
- (const :tag "No" nil))
- :group 'drupal)
-
(defun drupal/flymake-phpcs-enable ()
"Enable drupal-mode support for flymake-phpcs."
(when (and (apply 'derived-mode-p (append drupal-php-modes drupal-css-modes
drupal-js-modes))
@@ -51,8 +43,7 @@ so no need to highlight it twice."
;; Flymake-phpcs will also highlight trailing whitespace as an
;; error so no need to highlight it twice.
- (when drupal/flymake-phpcs-dont-show-trailing-whitespace
- (setq show-trailing-whitespace nil))
+ (drupal/phpcs-dont-show-trailing-whitespace)
;; This is a php-mode file so add the extension to a buffer locale
;; version of `flymake-allowed-file-name-masks' and make
diff --git a/drupal/phpcs.el b/drupal/phpcs.el
index 21b35db7b1..a83c2b024c 100644
--- a/drupal/phpcs.el
+++ b/drupal/phpcs.el
@@ -48,6 +48,22 @@ a standard. Adding file name requires PHP CodeSniffer version
+(defcustom drupal/phpcs-dont-show-trailing-whitespace t
+ "Non-nil means don't highlight trailing whitespace when Drupal Coder Sniffer
is in use.
+Phpcs will also highlight trailing whitespace as an error so no
+need to highlight it twice."
+ :type `(choice
+ (const :tag "Yes" t)
+ (const :tag "No" nil))
+ :group 'drupal)
+
+(defun drupal/phpcs-dont-show-trailing-whitespace ()
+ "Turn of various trailing white space highlighting."
+ (when drupal/phpcs-dont-show-trailing-whitespace
+ (when (boundp 'whitespace-style)
+ (set (make-local-variable 'whitespace-style) (remove 'trailing
whitespace-style)))
+ (setq show-trailing-whitespace nil)))
+
(provide 'drupal/phpcs)
;;; drupal/phpcs.el ends here
- [nongnu] elpa/drupal-mode 8951d9a7e8 105/308: Extended documentation of `drupal/flymake-phpcs-standard'., (continued)
- [nongnu] elpa/drupal-mode 8951d9a7e8 105/308: Extended documentation of `drupal/flymake-phpcs-standard'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3df6f6725c 110/308: Add contributing guidelines., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f0ae32d88a 111/308: Added first take at a `drush-make-mode'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode cd3e68f6b3 113/308: Better support for hook_form_FORM_ID_alter() et al., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode a22be38d3c 114/308: Read FORM_ID from minibuffer in `drupal-insert-hook'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 71f3ba70fe 116/308: Added .inc files as `php-mode` as well., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2245c415ee 123/308: Added check for `drupal-drush-program` is set., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 213ebf5e65 124/308: Fixed eshell site-alias expansion for aliases beginning with @. Suggestion by Tassilo Horn:, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f4a4985134 132/308: Check if our checker can be used before enforcing it., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2ad9decdb7 136/308: Merge branch 'develop' into pr/35, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ec024f1e2a 148/308: `drupal/phpcs-dont-show-trailing-whitespace` common to flycheck and flymake.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode da62dbfc22 149/308: Added missing EOL., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f77dd902b4 009/308: Add :link to defcustom. Part of #9., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e4d21708db 010/308: Untabify and indent., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 24bae05adf 036/308: Merge branch 'master' of github.com:arnested/drupal-mode, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 02eacb79f2 078/308: Added `drupal/etags-get-function-args' for finding arguments using Etags., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0b770695f8 072/308: Fixed `drupal-get-function-args' to fail gracefully., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 551cc3c803 093/308: Eliminated `drupal-drush-mode'. It had no purpose., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c81cdfd343 096/308: Made `drupal-search-url' et el safe for `string-or-null-p'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 05e0a86bed 099/308: Added keyboard shortcut for `drupal-module-name'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ae4dd40f05 122/308: Added pcomplete for drush., ELPA Syncer, 2022/01/25