Skip to content

Commit 46205ad

Browse files
committed
Merge branch 'release/0.6.0'
2 parents 1d1690b + 76199a3 commit 46205ad

File tree

7 files changed

+207
-57
lines changed

7 files changed

+207
-57
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ below) and depend on a few through the packaging system
3232
## Installation
3333

3434
The easiest way to install Drupal mode is probably to install it via
35-
the ELPA archive at [Marmalade](http://marmalade-repo.org/packages/drupal-mode).
35+
the ELPA archive at
36+
[Marmalade](http://marmalade-repo.org/packages/drupal-mode) or
37+
[MELPA Stable](http://stable.melpa.org/#/drupal-mode) (if you want
38+
bleeding edge use regular [MELPA](http://melpa.org/#/drupal-mode)).
3639

3740
ELPA (package.el) is part of Emacs 24. For Emacs 23 see
3841
[Marmalade](http://marmalade-repo.org) for installation instructions.
@@ -174,7 +177,7 @@ For this to work you need:
174177
There are quite a few attempts at writing a Drupal mode out in the
175178
wild:
176179

177-
* [Search Github for drupal-mode](https://github.com/search?type=Repositories&q="drupal-mode")
180+
* [Search Github for drupal-mode](https://github.com/search?l=Emacs+Lisp&q=drupal&type=Repositories)
178181
* At drupal.org:
179182
* http://drupal.org/sandbox/bartlantz/1405156
180183
* http://drupal.org/project/emacs

drupal-mode.el

Lines changed: 137 additions & 45 deletions
Large diffs are not rendered by default.

drupal/eldoc.el

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
;;; drupal/eldoc.el --- Drupal-mode support for eldoc.el
2+
3+
;; Copyright (C) 2015 Arne Jørgensen
4+
5+
;; Author: Arne Jørgensen <[email protected]>
6+
7+
;; This file is part of Drupal mode.
8+
9+
;; Drupal mode is free software; you can redistribute it and/or modify
10+
;; it under the terms of the GNU General Public License as published
11+
;; by the Free Software Foundation, either version 3 of the License,
12+
;; or (at your option) any later version.
13+
14+
;; Drupal mode is distributed in the hope that it will be useful, but
15+
;; WITHOUT ANY WARRANTY; without even the implied warranty of
16+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
;; General Public License for more details.
18+
19+
;; You should have received a copy of the GNU General Public License
20+
;; along with Drupal mode. If not, see <http://www.gnu.org/licenses/>.
21+
22+
;;; Commentary:
23+
24+
;; Enable drupal-mode support for eldoc.
25+
26+
;;; Code:
27+
28+
(defun drupal/eldoc-enable ()
29+
"Enable eldoc in PHP files."
30+
(when (apply 'derived-mode-p drupal-php-modes)
31+
;; Show function arguments from GNU GLOBAL for function at point
32+
;; after a short delay of idle time.
33+
(when (fboundp 'eldoc-mode)
34+
(set (make-local-variable 'eldoc-documentation-function)
35+
#'drupal-eldoc-documentation-function)
36+
(eldoc-mode 1))))
37+
38+
(add-hook 'drupal-mode-hook #'drupal/eldoc-enable)
39+
40+
(when drupal-mode
41+
(drupal/eldoc-enable))
42+
43+
44+
45+
(provide 'drupal/eldoc)
46+
47+
;;; drupal/eldoc.el ends here

drupal/emacs-drush.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; drupal/emacs-drush.el --- Drupal-mode support for Drush utilities for Emacs users
22

3-
;; Copyright (C) 2012, 2013 Arne Jørgensen
3+
;; Copyright (C) 2012, 2013, 2015 Arne Jørgensen
44

55
;; Author: Arne Jørgensen <[email protected]>
66

@@ -32,7 +32,9 @@
3232
;;; Code:
3333

3434
(defcustom drupal/emacs-drush-update-tags-after-save
35-
(and drupal-drush-program
35+
(and (unless (boundp 'gtags-auto-update)
36+
gtags-auto-update)
37+
drupal-drush-program
3638
(zerop (call-process drupal-drush-program nil nil nil "help" "etags")))
3739
"Use `Drush utilities for Emacs users' to run etags/gtags after save.
3840
On `after-save-hook' run `drush etags' or `drush gtags'.

drupal/flycheck.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
(when (and drupal-mode drupal/phpcs-standard)
3434
;; Set the coding standard to "Drupal" (phpcs.el has checked that
3535
;; it's supported).
36-
(setq flycheck-phpcs-standard drupal/phpcs-standard)
36+
(set (make-local-variable 'flycheck-phpcs-standard) drupal/phpcs-standard)
3737

3838
;; Flycheck will also highlight trailing whitespace as an
3939
;; error so no need to highlight it twice.
@@ -50,8 +50,8 @@ checker runs those.
5050
5151
See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
5252
:command ("phpcs" "--report=emacs"
53-
(option "--standard=" flycheck-phpcs-standard)
54-
source)
53+
(option "--standard=" flycheck-phpcs-standard concat)
54+
source-inplace)
5555
;; Though phpcs supports Checkstyle output which we could feed to
5656
;; `flycheck-parse-checkstyle', we are still using error patterns here,
5757
;; because PHP has notoriously unstable output habits. See URL
@@ -67,7 +67,7 @@ See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
6767
;; We'd prefer to just check drupal-mode, but flycheck global mode
6868
;; finds the checker before we get a chance to set drupal-mode.
6969
:predicate (lambda ()
70-
(apply 'derived-mode-p (append drupal-php-modes drupal-css-modes drupal-js-modes drupal-info-modes))))
70+
(apply 'derived-mode-p (append drupal-css-modes drupal-js-modes drupal-info-modes))))
7171

7272
;; Append our custom checker.
7373
(add-to-list 'flycheck-checkers 'drupal-phpcs t)

drupal/flymake-phpcs.el

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
;; https://github.com/illusori/emacs-flymake.
4040
(when (or (boundp 'flymake-run-in-place)
4141
(fboundp 'flymake-phpcs-load))
42-
(defcustom drupal/flymake-phpcs-run-in-place t
42+
(defcustom drupal/flymake-phpcs-run-in-place 'auto
4343
"If nil, flymake will run on copies in `temporary-file-directory' rather
4444
than the same directory as the original file.
4545
4646
Drupal Coder Sniffer has some sniffs that will only work if run in place.
4747
48-
Defaults to `t'. Set to `default' to use whatever
48+
Defaults to t. Set to `default' to use whatever
4949
`flymake-run-in-place' is set to.
5050
5151
When editing a remote file via Tramp, this flag also has the side-effect of
@@ -55,6 +55,7 @@ file (and thus on the remote machine), or in the same place as
5555
:type `(choice
5656
(const :tag "Yes" t)
5757
(const :tag "No" nil)
58+
(const :tag "Auto" auto)
5859
(const :tag "Default" default))
5960
:link '(url-link :tag "Drupal Coder Sniffer" "https://drupal.org/project/coder")
6061
:group 'drupal))
@@ -77,7 +78,10 @@ file (and thus on the remote machine), or in the same place as
7778
(if drupal/flymake-phpcs-run-in-place
7879
(set (make-local-variable 'flymake-phpcs-location) 'inplace)
7980
(set (make-local-variable 'flymake-phpcs-location) 'tempdir)))
80-
(set (make-local-variable 'flymake-run-in-place) drupal/flymake-phpcs-run-in-place))
81+
(if (and (eq drupal/flymake-phpcs-run-in-place 'auto)
82+
(string-match "\\.info\\'" (or buffer-file-name (buffer-name))))
83+
(set (make-local-variable 'flymake-run-in-place) t)
84+
(set (make-local-variable 'flymake-run-in-place) nil)))
8185

8286
;; Flymake-phpcs will also highlight trailing whitespace as an
8387
;; error so no need to highlight it twice.
@@ -156,7 +160,8 @@ copy."
156160
(match-string-no-properties 0)
157161
(file-name-extension file-name t)))
158162
(base-name (file-name-nondirectory (replace-regexp-in-string (concat (regexp-quote extension) "\\'") "" file-name)))
159-
(temp-name (file-truename (make-temp-file (concat base-name "._" prefix) nil extension))))
163+
(temp-dir (file-truename (make-temp-file base-name t nil)))
164+
(temp-name (file-truename (concat temp-dir "/" file-name))))
160165
(flymake-log 3 "create-temp-intemp: file=%s temp=%s" file-name temp-name)
161166
temp-name))
162167

drush-make-mode.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
;;; Code:
2828

2929
(require 'bug-reference)
30+
(require 'imenu)
3031

3132
;;;###autoload
3233
(define-derived-mode drush-make-mode conf-windows-mode "Drush Make"

0 commit comments

Comments
 (0)