Skip to content

Commit

Permalink
Merge branch 'release/0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Jun 24, 2015
2 parents 1d1690b + 76199a3 commit 46205ad
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 57 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ below) and depend on a few through the packaging system
## Installation

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

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

* [Search Github for drupal-mode](https://github.com/search?type=Repositories&q="drupal-mode")
* [Search Github for drupal-mode](https://github.com/search?l=Emacs+Lisp&q=drupal&type=Repositories)
* At drupal.org:
* http://drupal.org/sandbox/bartlantz/1405156
* http://drupal.org/project/emacs
Expand Down
182 changes: 137 additions & 45 deletions drupal-mode.el

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions drupal/eldoc.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
;;; drupal/eldoc.el --- Drupal-mode support for eldoc.el

;; Copyright (C) 2015 Arne Jørgensen

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

;; This file is part of Drupal mode.

;; Drupal mode is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published
;; by the Free Software Foundation, either version 3 of the License,
;; or (at your option) any later version.

;; Drupal mode is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with Drupal mode. If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; Enable drupal-mode support for eldoc.

;;; Code:

(defun drupal/eldoc-enable ()
"Enable eldoc in PHP files."
(when (apply 'derived-mode-p drupal-php-modes)
;; Show function arguments from GNU GLOBAL for function at point
;; after a short delay of idle time.
(when (fboundp 'eldoc-mode)
(set (make-local-variable 'eldoc-documentation-function)
#'drupal-eldoc-documentation-function)
(eldoc-mode 1))))

(add-hook 'drupal-mode-hook #'drupal/eldoc-enable)

(when drupal-mode
(drupal/eldoc-enable))



(provide 'drupal/eldoc)

;;; drupal/eldoc.el ends here
6 changes: 4 additions & 2 deletions drupal/emacs-drush.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; drupal/emacs-drush.el --- Drupal-mode support for Drush utilities for Emacs users

;; Copyright (C) 2012, 2013 Arne Jørgensen
;; Copyright (C) 2012, 2013, 2015 Arne Jørgensen

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

Expand Down Expand Up @@ -32,7 +32,9 @@
;;; Code:

(defcustom drupal/emacs-drush-update-tags-after-save
(and drupal-drush-program
(and (unless (boundp 'gtags-auto-update)
gtags-auto-update)
drupal-drush-program
(zerop (call-process drupal-drush-program nil nil nil "help" "etags")))
"Use `Drush utilities for Emacs users' to run etags/gtags after save.
On `after-save-hook' run `drush etags' or `drush gtags'.
Expand Down
8 changes: 4 additions & 4 deletions drupal/flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
(when (and drupal-mode drupal/phpcs-standard)
;; Set the coding standard to "Drupal" (phpcs.el has checked that
;; it's supported).
(setq flycheck-phpcs-standard drupal/phpcs-standard)
(set (make-local-variable 'flycheck-phpcs-standard) drupal/phpcs-standard)

;; Flycheck will also highlight trailing whitespace as an
;; error so no need to highlight it twice.
Expand All @@ -50,8 +50,8 @@ checker runs those.
See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
:command ("phpcs" "--report=emacs"
(option "--standard=" flycheck-phpcs-standard)
source)
(option "--standard=" flycheck-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
Expand All @@ -67,7 +67,7 @@ See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
;; We'd prefer to just check drupal-mode, but flycheck global mode
;; finds the checker before we get a chance to set drupal-mode.
:predicate (lambda ()
(apply 'derived-mode-p (append drupal-php-modes drupal-css-modes drupal-js-modes drupal-info-modes))))
(apply 'derived-mode-p (append drupal-css-modes drupal-js-modes drupal-info-modes))))

;; Append our custom checker.
(add-to-list 'flycheck-checkers 'drupal-phpcs t)
Expand Down
13 changes: 9 additions & 4 deletions drupal/flymake-phpcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
;; https://github.com/illusori/emacs-flymake.
(when (or (boundp 'flymake-run-in-place)
(fboundp 'flymake-phpcs-load))
(defcustom drupal/flymake-phpcs-run-in-place t
(defcustom drupal/flymake-phpcs-run-in-place 'auto
"If nil, flymake will run on copies in `temporary-file-directory' rather
than the same directory as the original file.
Drupal Coder Sniffer has some sniffs that will only work if run in place.
Defaults to `t'. Set to `default' to use whatever
Defaults to t. Set to `default' to use whatever
`flymake-run-in-place' is set to.
When editing a remote file via Tramp, this flag also has the side-effect of
Expand All @@ -55,6 +55,7 @@ file (and thus on the remote machine), or in the same place as
:type `(choice
(const :tag "Yes" t)
(const :tag "No" nil)
(const :tag "Auto" auto)
(const :tag "Default" default))
:link '(url-link :tag "Drupal Coder Sniffer" "https://drupal.org/project/coder")
:group 'drupal))
Expand All @@ -77,7 +78,10 @@ file (and thus on the remote machine), or in the same place as
(if drupal/flymake-phpcs-run-in-place
(set (make-local-variable 'flymake-phpcs-location) 'inplace)
(set (make-local-variable 'flymake-phpcs-location) 'tempdir)))
(set (make-local-variable 'flymake-run-in-place) drupal/flymake-phpcs-run-in-place))
(if (and (eq drupal/flymake-phpcs-run-in-place 'auto)
(string-match "\\.info\\'" (or buffer-file-name (buffer-name))))
(set (make-local-variable 'flymake-run-in-place) t)
(set (make-local-variable 'flymake-run-in-place) nil)))

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

Expand Down
1 change: 1 addition & 0 deletions drush-make-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
;;; Code:

(require 'bug-reference)
(require 'imenu)

;;;###autoload
(define-derived-mode drush-make-mode conf-windows-mode "Drush Make"
Expand Down

0 comments on commit 46205ad

Please sign in to comment.