|
| 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 |
0 commit comments