-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
89 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
;; Author: Arne Jørgensen <[email protected]> | ||
;; URL: https://github.com/arnested/drupal-mode | ||
;; Created: January 17, 2012 | ||
;; Version: 0.4.1 | ||
;; Version: 0.5.0 | ||
;; Package-Requires: ((php-mode "1.5.0")) | ||
;; Keywords: programming, php, drupal | ||
|
||
|
@@ -387,6 +387,12 @@ of the project)." | |
(define-key drupal-mode-map | ||
[menu-bar drupal manual] | ||
'("Drupal Mode manual" . drupal-mode-manual)) | ||
(define-key drupal-mode-map | ||
[menu-bar drupal insert-hook] | ||
'("Insert hook implementation" . drupal-insert-hook)) | ||
(define-key drupal-mode-map | ||
[menu-bar drupal insert-function] | ||
'("Insert function template" . drupal-insert-function)) | ||
(define-key drupal-mode-map | ||
[menu-bar drupal search-documentation] | ||
'(menu-item "Search documentation" drupal-search-documentation | ||
|
@@ -774,6 +780,7 @@ mode-hook." | |
(eval-after-load 'autoinsert '(require 'drupal/autoinsert)) | ||
(eval-after-load 'etags '(require 'drupal/etags)) | ||
(eval-after-load 'gtags '(require 'drupal/gtags)) | ||
(eval-after-load 'ggtags '(require 'drupal/ggtags)) | ||
(eval-after-load 'ispell '(require 'drupal/ispell)) | ||
(eval-after-load 'flymake-phpcs '(require 'drupal/flymake-phpcs)) | ||
(eval-after-load 'flycheck '(require 'drupal/flycheck)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
;;; drupal/ggtags.el --- Drupal-mode support for ggtags.el | ||
|
||
;; Copyright (C) 2012, 2013, 2014 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 gtags. | ||
|
||
;;; Code: | ||
|
||
(require 'ggtags) | ||
|
||
(defvar drupal/ggtags-global-command (executable-find "global") | ||
"Name of the GNU GLOBAL `global' executable. | ||
Include path to the executable if it is not in your $PATH.") | ||
|
||
(defun drupal/ggtags-enable () | ||
"Setup rootdir for gtags." | ||
(let ((dir (locate-dominating-file (or buffer-file-name default-directory) "GTAGS"))) | ||
(when dir | ||
(ggtags-mode 1) | ||
;; Connect `drupal-symbol-collection' to `ggtags-mode' | ||
;; completion | ||
(setq drupal-symbol-collection | ||
(lambda () (all-completions "" ggtags-completion-table))) | ||
(setq drupal-get-function-args #'drupal/ggtags-get-function-args)))) | ||
|
||
(defun drupal/ggtags-get-function-args (symbol &optional version) | ||
"Get function arguments from GNU GLOBAL." | ||
(when (and (boundp 'ggtags-project-root) | ||
(file-exists-p (expand-file-name "GTAGS" ggtags-project-root))) | ||
(with-temp-buffer | ||
(ignore-errors | ||
(call-process drupal/ggtags-global-command nil t nil "-x" symbol) | ||
(goto-char (point-min)) | ||
(search-forward-regexp "[^(]*(\\(.*\\))[^)]*" nil t) | ||
(match-string-no-properties 1))))) | ||
|
||
(add-hook 'drupal-mode-hook #'drupal/ggtags-enable) | ||
|
||
|
||
|
||
(provide 'drupal/ggtags) | ||
|
||
;;; drupal/ggtags.el ends here |