Skip to content

Commit afa84f7

Browse files
committed
Merge branch 'release/0.7.2'
2 parents 1e6f973 + 9d58089 commit afa84f7

File tree

3 files changed

+27
-50
lines changed

3 files changed

+27
-50
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ env:
1313
script:
1414
- emacs --version
1515
- make test
16+
notifications:
17+
webhooks: https://webhooks.gitter.im/e/fa0500ce49cab8dc8144
18+
on_success: change
19+
on_failure: always
20+
on_start: never

drupal-mode.el

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,6 @@ See `drupal-mode-map'.")
252252
;; mode map on C-c C-v C-`mnemonic-key'.
253253
(dolist (elem drupal-mode-map-alist)
254254
(define-key map `[(control c) (control v) (control ,(car elem))] (cdr elem)))
255-
256-
(define-key map [(control a)] #'drupal-mode-beginning-of-line)
257255
map)
258256
"Keymap for `drupal-mode'")
259257

@@ -336,7 +334,8 @@ function arguments.")
336334
(require-final-newline . t)
337335
(c-offsets-alist . ((arglist-close . 0)
338336
(arglist-cont-nonempty . c-lineup-math)
339-
(arglist-intro . +)))
337+
(arglist-intro . +)
338+
(statement-cont . +)))
340339
(c-doc-comment-style . (php-mode . javadoc))
341340
(c-label-minimum-indentation . 1)
342341
(c-special-indent-hook . c-gnu-impose-minimum)
@@ -699,35 +698,6 @@ instead."
699698
((fboundp 'php-extras-eldoc-documentation-function)
700699
(php-extras-eldoc-documentation-function))))))
701700

702-
(defun drupal-mode-beginning-of-line (&optional n)
703-
"Move point to beginning of property value or to beginning of line.
704-
The prefix argument N is passed directly to `beginning-of-line'.
705-
706-
This command is identical to `beginning-of-line' if not in a mode
707-
derived from `conf-mode'.
708-
709-
If point is on a (non-continued) property line, move point to the
710-
beginning of the property value or the beginning of line,
711-
whichever is closer. If point is already at beginning of line,
712-
move point to beginning of property value. Therefore, repeated
713-
calls will toggle point between beginning of property value and
714-
beginning of line.
715-
716-
Heavily based on `message-beginning-of-line' from Gnus."
717-
(interactive "p")
718-
(let ((zrs 'zmacs-region-stays))
719-
(when (and (featurep 'xemacs) (interactive-p) (boundp zrs))
720-
(set zrs t)))
721-
(if (derived-mode-p 'conf-mode)
722-
(let* ((here (point))
723-
(bol (progn (beginning-of-line n) (point)))
724-
(eol (point-at-eol))
725-
(eoh (re-search-forward "= *" eol t)))
726-
(goto-char
727-
(if (and eoh (or (< eoh here) (= bol here)))
728-
eoh bol)))
729-
(beginning-of-line n)))
730-
731701

732702

733703
(defvar drupal-local-variables (make-hash-table :test 'equal)
@@ -898,8 +868,7 @@ If major version number is 4 - return both major and minor."
898868
(defun drupal-mode-bootstrap ()
899869
"Activate Drupal minor mode if major mode is supported.
900870
The command will activate `drupal-mode' if the current major mode
901-
is a mode supported by `drupal-mode' (currently only
902-
`php-mode').
871+
is a mode supported by `drupal-mode'.
903872
904873
The function is suitable for adding to the supported major modes
905874
mode-hook."

drupal/flycheck.el

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,24 @@ The Drupal standard includes checks for non-PHP files, this
4949
checker runs those.
5050
5151
See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
52-
:command ("phpcs" "--report=emacs"
53-
(option "--standard=" drupal/phpcs-standard concat)
54-
source-inplace)
55-
;; Though phpcs supports Checkstyle output which we could feed to
56-
;; `flycheck-parse-checkstyle', we are still using error patterns here,
57-
;; because PHP has notoriously unstable output habits. See URL
58-
;; `https://github.com/lunaryorn/flycheck/issues/78' and URL
59-
;; `https://github.com/lunaryorn/flycheck/issues/118'
60-
:error-patterns
61-
((error line-start
62-
(file-name) ":" line ":" column ": error - " (message)
63-
line-end)
64-
(warning line-start
65-
(file-name) ":" line ":" column ": warning - " (message)
66-
line-end))
52+
:command ("phpcs" "--report=checkstyle"
53+
(option "--standard=" flycheck-phpcs-standard concat)
54+
;; Pass original file name to phpcs. We need to concat explicitly
55+
;; here, because phpcs really insists to get option and argument as
56+
;; a single command line argument :|
57+
(eval (when (buffer-file-name)
58+
(concat "--stdin-path=" (buffer-file-name)))))
59+
:standard-input t
60+
:error-parser flycheck-parse-checkstyle
61+
:error-filter
62+
(lambda (errors)
63+
(flycheck-sanitize-errors
64+
(flycheck-remove-error-file-names "STDIN" errors)))
65+
;; Hardcoded for the moment, as this doesn't work:
66+
;; :modes (append drupal-css-modes drupal-js-modes drupal-info-modes)
67+
;; As they're reworking the checker selection code, we're letting this
68+
;; lie for the moment.
69+
:modes (css-mode javascript-mode js-mode js2-mode conf-windows-mode)
6770
:predicate (lambda ()
6871
(and drupal-mode drupal/phpcs-standard)))
6972

@@ -73,7 +76,7 @@ See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
7376
(let ((modes (append drupal-css-modes drupal-js-modes drupal-info-modes)))
7477
(dolist (checker (flycheck-defined-checkers))
7578
(dolist (mode (flycheck-checker-get checker 'modes))
76-
(if (memq mode modes)
79+
(if (and (memq mode modes) (not (eq checker 'drupal-phpcs)))
7780
(flycheck-add-next-checker checker 'drupal-phpcs)))))
7881

7982

0 commit comments

Comments
 (0)