[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode e96a1f70f4 066/308: Added support for "Drush u
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode e96a1f70f4 066/308: Added support for "Drush utilities for Emacs users". |
Date: |
Tue, 25 Jan 2022 10:59:29 -0500 (EST) |
branch: elpa/drupal-mode
commit e96a1f70f4abc4f6c50eaf6655ed79077f4afdaf
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Added support for "Drush utilities for Emacs users".
---
README.md | 8 +++++++
drupal/emacs-drush.el | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++
drupal/etags.el | 1 +
drupal/gtags.el | 1 +
4 files changed, 76 insertions(+)
diff --git a/README.md b/README.md
index df31b68d2c..b27d1a9062 100644
--- a/README.md
+++ b/README.md
@@ -133,6 +133,14 @@ support in Emacs then Drupal mode will set `gtags-rootdir`
to your
DRUPAL_ROOT.
+### Drush utilities for Emacs users
+
+If
+[Drush utilities for Emacs users](http://drupal.org/project/emacs_drush)
+is installed Drupal mode will update existing tag files in your
+DRUPAL_ROOT after saving a buffer.
+
+
### ispell
If ispell.el is loaded in Emacs then Drupal mode will set the language
diff --git a/drupal/emacs-drush.el b/drupal/emacs-drush.el
new file mode 100644
index 0000000000..df7d808682
--- /dev/null
+++ b/drupal/emacs-drush.el
@@ -0,0 +1,66 @@
+;;; drupal/emacs-drush.el --- Drupal-mode support for Drush utilities for
Emacs users
+
+;; Copyright (C) 2012 Arne Jørgensen
+
+;; Author: Arne Jørgensen <arne@arnested.dk>
+
+;; 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:
+
+;; You need to install `Drush utilities for Emacs users'
+;; <http://drupal.org/project/emacs_drush> for this to work.
+
+;; If `Drush utilities for Emacs users' is installed it will run
+;; `drush etags' on `after-save-hook' if a TAGS file is present in
+;; DRUPAL_ROOT and it will run `drush gtags' on `after-save-hook' if a
+;; GTAGS file is present in DRUPAL_ROOT.
+
+;;; Code:
+
+(defcustom drupal/emacs-drush-update-tags-after-save
+ (and 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'.
+
+Requires `Drush utilities for Emacs users' to be installed."
+ :type `(choice
+ (const :tag "Yes" t)
+ (const :tag "No" nil))
+ :link '(url-link :tag "Drush utilities for Emacs users"
"http://drupal.org/project/emacs_drush")
+ :group 'drupal)
+
+(defun drupal/emacs-drush-run-after-save ()
+ "Run drush etags/gtags on after-save-hook."
+ (when (and drupal/emacs-drush-update-tags-after-save
+ (boundp 'drupal-rootdir)
+ drupal-drush-program)
+ (when (file-exists-p (concat drupal-rootdir "TAGS"))
+ (call-process drupal-drush-program nil 0 nil "etags"))
+ (when (file-exists-p (concat drupal-rootdir "GTAGS"))
+ (call-process drupal-drush-program nil 0 nil "gtags"))))
+
+(defun drupal/emacs-drush-enable ()
+ (add-hook 'after-save-hook #'drupal/emacs-drush-run-after-save nil t))
+
+(add-hook 'drupal-mode-hook #'drupal/emacs-drush-enable)
+
+
+
+(provide 'drupal/emacs-drush)
+
+;;; drupal/emacs-drush.el ends here
diff --git a/drupal/etags.el b/drupal/etags.el
index 3df8b28439..306474b621 100644
--- a/drupal/etags.el
+++ b/drupal/etags.el
@@ -26,6 +26,7 @@
;;; Code:
(require 'etags)
+(require 'drupal/emacs-drush)
(defun drupal/etags-enable ()
"Setup TAGS file for etags if it exists in DRUPAL_ROOT."
diff --git a/drupal/gtags.el b/drupal/gtags.el
index 87da53f6ac..21ad5cb536 100644
--- a/drupal/gtags.el
+++ b/drupal/gtags.el
@@ -26,6 +26,7 @@
;;; Code:
(require 'gtags)
+(require 'drupal/emacs-drush)
(defun drupal/gtags-enable ()
"Setup rootdir for gtags to be DRUPAL_ROOT."
- [nongnu] elpa/drupal-mode 56a55ff9c8 019/308: Drush API search on master if version is y.x-dev., (continued)
- [nongnu] elpa/drupal-mode 56a55ff9c8 019/308: Drush API search on master if version is y.x-dev., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 25dc7333d9 028/308: Added flymake-phpcs support., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0a5c953312 029/308: flymake-phpcs will only be used in php-mode., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e4c4c3d6e1 022/308: `drupal-delete-trailing-whitespace' made local var., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 9c618f003c 026/308: Set `ispell-local-dictionary' to `american'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode abc074346f 035/308: Merge branch 'release/0.2.0' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode a0ef7e7fce 039/308: Fixed package name in install target., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 661e6bba48 040/308: Changed info about flymake-phpcs., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ebb3c56e25 068/308: Discovers more module info and added module menu., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 587e0eb2ec 060/308: Added completion based on gtags., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e96a1f70f4 066/308: Added support for "Drush utilities for Emacs users".,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 5386751a5d 069/308: Fixed module version in module menu., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8fc32e7641 053/308: Made `drupal-detect-drupal-version' more reliable., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ce7e9d2bf3 043/308: Various cleanup., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 00aae1e5e8 070/308: Added support for `web-mode'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 48a90d94ed 061/308: Fixed spelling., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode b8863a5c82 054/308: Added first take on automated tests., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8599809578 058/308: Flymake-phpcs also highlights trailing whitespace., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode aa87684203 048/308: Added `require' for supported libraries., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 897fbfb4a5 082/308: Added small optimization for byte compiler., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode a53c312da1 089/308: Improved info file auto-insert skeleton., ELPA Syncer, 2022/01/25