Skip to content

Commit

Permalink
Merge branch 'release/0.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Sep 26, 2017
2 parents 1e6f973 + 9d58089 commit afa84f7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 50 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
37 changes: 3 additions & 34 deletions drupal-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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'")

Expand Down Expand Up @@ -336,7 +334,8 @@ 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)
Expand Down Expand Up @@ -699,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)
Expand Down Expand Up @@ -898,8 +868,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."
Expand Down
35 changes: 19 additions & 16 deletions drupal/flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand All @@ -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)))))


Expand Down

0 comments on commit afa84f7

Please sign in to comment.