From eec2e557d769f3379e6c208334650f3041d28d54 Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Thu, 15 Sep 2016 11:45:29 +0200 Subject: [PATCH 1/6] Updated to the latest flycheck. --- drupal/flycheck.el | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/drupal/flycheck.el b/drupal/flycheck.el index 1eb3675..42b2252 100644 --- a/drupal/flycheck.el +++ b/drupal/flycheck.el @@ -49,21 +49,24 @@ The Drupal standard includes checks for non-PHP files, this checker runs those. See URL `http://pear.php.net/package/PHP_CodeSniffer/'." - :command ("phpcs" "--report=emacs" - (option "--standard=" drupal/phpcs-standard concat) - source-inplace) - ;; Though phpcs supports Checkstyle output which we could feed to - ;; `flycheck-parse-checkstyle', we are still using error patterns here, - ;; because PHP has notoriously unstable output habits. See URL - ;; `https://github.com/lunaryorn/flycheck/issues/78' and URL - ;; `https://github.com/lunaryorn/flycheck/issues/118' - :error-patterns - ((error line-start - (file-name) ":" line ":" column ": error - " (message) - line-end) - (warning line-start - (file-name) ":" line ":" column ": warning - " (message) - line-end)) + :command ("phpcs" "--report=checkstyle" + (option "--standard=" flycheck-phpcs-standard concat) + ;; Pass original file name to phpcs. We need to concat explicitly + ;; here, because phpcs really insists to get option and argument as + ;; a single command line argument :| + (eval (when (buffer-file-name) + (concat "--stdin-path=" (buffer-file-name))))) + :standard-input t + :error-parser flycheck-parse-checkstyle + :error-filter + (lambda (errors) + (flycheck-sanitize-errors + (flycheck-remove-error-file-names "STDIN" errors))) + ;; Hardcoded for the moment, as this doesn't work: + ;; :modes (append drupal-css-modes drupal-js-modes drupal-info-modes) + ;; As they're reworking the checker selection code, we're letting this + ;; lie for the moment. + :modes (css-mode javascript-mode js-mode js2-mode conf-windows-mode) :predicate (lambda () (and drupal-mode drupal/phpcs-standard))) @@ -73,7 +76,7 @@ See URL `http://pear.php.net/package/PHP_CodeSniffer/'." (let ((modes (append drupal-css-modes drupal-js-modes drupal-info-modes))) (dolist (checker (flycheck-defined-checkers)) (dolist (mode (flycheck-checker-get checker 'modes)) - (if (memq mode modes) + (if (and (memq mode modes) (not (eq checker 'drupal-phpcs))) (flycheck-add-next-checker checker 'drupal-phpcs))))) From f93cdfe1b26da7c67f37750d44108ef69966f18f Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Tue, 13 Dec 2016 13:42:44 +0100 Subject: [PATCH 2/6] Use proper indent for continuation lines This properly indents this: $var->func() ->func(); --- drupal-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/drupal-mode.el b/drupal-mode.el index 091cd49..15ad3f5 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -340,6 +340,7 @@ function arguments.") (c-doc-comment-style . (php-mode . javadoc)) (c-label-minimum-indentation . 1) (c-special-indent-hook . c-gnu-impose-minimum) + (statement-cont . +) ) "Drupal coding style. According to https://drupal.org/coding-standards#indenting." From dea5a8da789e5c707fa6c63cd400282ea7205a14 Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Thu, 15 Dec 2016 13:14:55 +0100 Subject: [PATCH 3/6] Fix thinko --- drupal-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drupal-mode.el b/drupal-mode.el index 15ad3f5..c5c444b 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -336,11 +336,11 @@ function arguments.") (require-final-newline . t) (c-offsets-alist . ((arglist-close . 0) (arglist-cont-nonempty . c-lineup-math) - (arglist-intro . +))) + (arglist-intro . +) + (statement-cont . +))) (c-doc-comment-style . (php-mode . javadoc)) (c-label-minimum-indentation . 1) (c-special-indent-hook . c-gnu-impose-minimum) - (statement-cont . +) ) "Drupal coding style. According to https://drupal.org/coding-standards#indenting." From ca569eaa626ffc38165fec8fb57767db749e4e7f Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Thu, 12 Jan 2017 20:27:59 +0100 Subject: [PATCH 4/6] Update obsoleted comment --- drupal-mode.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drupal-mode.el b/drupal-mode.el index c5c444b..b8c2a15 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -899,8 +899,7 @@ If major version number is 4 - return both major and minor." (defun drupal-mode-bootstrap () "Activate Drupal minor mode if major mode is supported. The command will activate `drupal-mode' if the current major mode -is a mode supported by `drupal-mode' (currently only -`php-mode'). +is a mode supported by `drupal-mode'. The function is suitable for adding to the supported major modes mode-hook." From 6f40ad04b760d2266b8c07283df266471d85a9b2 Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Thu, 12 Jan 2017 20:36:47 +0100 Subject: [PATCH 5/6] Remove drupal-mode-beginning-of-line --- drupal-mode.el | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/drupal-mode.el b/drupal-mode.el index b8c2a15..f8da836 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -252,8 +252,6 @@ See `drupal-mode-map'.") ;; mode map on C-c C-v C-`mnemonic-key'. (dolist (elem drupal-mode-map-alist) (define-key map `[(control c) (control v) (control ,(car elem))] (cdr elem))) - - (define-key map [(control a)] #'drupal-mode-beginning-of-line) map) "Keymap for `drupal-mode'") @@ -700,35 +698,6 @@ instead." ((fboundp 'php-extras-eldoc-documentation-function) (php-extras-eldoc-documentation-function)))))) -(defun drupal-mode-beginning-of-line (&optional n) - "Move point to beginning of property value or to beginning of line. -The prefix argument N is passed directly to `beginning-of-line'. - -This command is identical to `beginning-of-line' if not in a mode -derived from `conf-mode'. - -If point is on a (non-continued) property line, move point to the -beginning of the property value or the beginning of line, -whichever is closer. If point is already at beginning of line, -move point to beginning of property value. Therefore, repeated -calls will toggle point between beginning of property value and -beginning of line. - -Heavily based on `message-beginning-of-line' from Gnus." - (interactive "p") - (let ((zrs 'zmacs-region-stays)) - (when (and (featurep 'xemacs) (interactive-p) (boundp zrs)) - (set zrs t))) - (if (derived-mode-p 'conf-mode) - (let* ((here (point)) - (bol (progn (beginning-of-line n) (point))) - (eol (point-at-eol)) - (eoh (re-search-forward "= *" eol t))) - (goto-char - (if (and eoh (or (< eoh here) (= bol here))) - eoh bol))) - (beginning-of-line n))) - (defvar drupal-local-variables (make-hash-table :test 'equal) From 9d5808972f344a09dcf665d5113ae81e39ac1051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Fri, 10 Feb 2017 21:55:44 +0100 Subject: [PATCH 6/6] Add Travis notifications to Gitter.im room --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 88b3b49..68bb672 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,8 @@ env: script: - emacs --version - make test +notifications: + webhooks: https://webhooks.gitter.im/e/fa0500ce49cab8dc8144 + on_success: change + on_failure: always + on_start: never