branch: elpa/drupal-mode
commit 319acd576147144985dbb38d5a5747703c60d2eb
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>
Moved eldoc stuff to separate file.
---
drupal-mode.el | 9 +--------
drupal/eldoc.el | 47 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 8 deletions(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index ca94c1d8c4..3efde98b9b 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -302,14 +302,6 @@ function arguments.")
;; Stuff special for php-mode buffers.
(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 (and drupal-get-function-args
- (fboundp 'eldoc-mode))
- (set (make-local-variable 'eldoc-documentation-function)
- #'drupal-eldoc-documentation-function)
- (eldoc-mode 1))
-
;; Set correct comment style for inline comments.
(setq comment-start "//")
(setq comment-padding " ")
@@ -877,6 +869,7 @@ mode-hook."
;; Load support for various Emacs features if necessary.
(eval-after-load 'autoinsert '(require 'drupal/autoinsert))
+(eval-after-load 'eldoc '(require 'drupal/eldoc))
(eval-after-load 'etags '(require 'drupal/etags))
(eval-after-load 'gtags '(require 'drupal/gtags))
(eval-after-load 'ggtags '(require 'drupal/ggtags))
diff --git a/drupal/eldoc.el b/drupal/eldoc.el
new file mode 100644
index 0000000000..ed0f4e7b5a
--- /dev/null
+++ b/drupal/eldoc.el
@@ -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