[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode ae4dd40f05 122/308: Added pcomplete for drush.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode ae4dd40f05 122/308: Added pcomplete for drush. |
Date: |
Tue, 25 Jan 2022 10:59:37 -0500 (EST) |
branch: elpa/drupal-mode
commit ae4dd40f05514b1a8a4206339704db69fd6097f2
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Added pcomplete for drush.
Courtesy of Damon Haley.
---
drupal-mode.el | 3 +++
drupal/pcomplete.el | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+)
diff --git a/drupal-mode.el b/drupal-mode.el
index 446b8bf579..0af85a91ef 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -118,6 +118,7 @@ whitespace at the end."
:group 'drupal-drush)
+;;;###autoload
(defcustom drupal-drush-program (executable-find "drush")
"Name of the Drush executable.
Include path to the executable if it is not in your $PATH."
@@ -682,6 +683,8 @@ mode-hook."
(eval-after-load 'ispell '(require 'drupal/ispell))
(eval-after-load 'flymake-phpcs '(require 'drupal/flymake-phpcs))
;;;###autoload
+(eval-after-load 'pcomplete '(require 'drupal/pcomplete))
+;;;###autoload
(eval-after-load 'webjump '(require 'drupal/webjump))
diff --git a/drupal/pcomplete.el b/drupal/pcomplete.el
new file mode 100644
index 0000000000..164b2c5476
--- /dev/null
+++ b/drupal/pcomplete.el
@@ -0,0 +1,62 @@
+;;; drupal/pcomplete.el --- Drush support for pcomplete.el
+
+;; Copyright (C) 2013 Damon Haley
+
+;; Author: Damon Haley <dkh@member.fsf.org>
+
+;; 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 drush support for pcomplete.el.
+
+;;; Code:
+
+(require 'pcomplete)
+
+(defun drupal/pcomplete-drush-commands ()
+ "Return the most common drush commands by parsing the drush output."
+ (with-temp-buffer
+ (call-process drupal-drush-program nil t nil
+ "--early=includes/complete.inc")
+ (goto-char 0)
+ (let (commands)
+ (while (re-search-forward
+ "^[[:blank:]]*\\([@]?[[:word:]-.]+\\)"
+ nil t)
+ (push (match-string-no-properties 1) commands))
+ (sort commands #'string<))))
+
+(defvar drupal/pcomplete-drush-commands (drupal/pcomplete-drush-commands)
+ "List of `drush' commands.")
+
+(defun drupal/pcomplete-drush-completion ()
+ "Completion for `drush'."
+ ;; Completion for the command argument.
+ (pcomplete-here* drupal/pcomplete-drush-commands)
+ (cond
+ ((pcomplete-match "help" 1)
+ (pcomplete-here* drupal/pcomplete-drush-commands))
+ (t
+ (while (pcomplete-here (pcomplete-entries))))))
+
+(defalias 'pcomplete/drush 'drupal/pcomplete-drush-completion)
+
+
+
+(provide 'drupal/pcomplete)
+
+;;; drupal/pcomplete.el ends here
- [nongnu] elpa/drupal-mode ec024f1e2a 148/308: `drupal/phpcs-dont-show-trailing-whitespace` common to flycheck and flymake., (continued)
- [nongnu] elpa/drupal-mode ec024f1e2a 148/308: `drupal/phpcs-dont-show-trailing-whitespace` common to flycheck and flymake., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode da62dbfc22 149/308: Added missing EOL., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f77dd902b4 009/308: Add :link to defcustom. Part of #9., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e4d21708db 010/308: Untabify and indent., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 24bae05adf 036/308: Merge branch 'master' of github.com:arnested/drupal-mode, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 02eacb79f2 078/308: Added `drupal/etags-get-function-args' for finding arguments using Etags., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0b770695f8 072/308: Fixed `drupal-get-function-args' to fail gracefully., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 551cc3c803 093/308: Eliminated `drupal-drush-mode'. It had no purpose., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c81cdfd343 096/308: Made `drupal-search-url' et el safe for `string-or-null-p'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 05e0a86bed 099/308: Added keyboard shortcut for `drupal-module-name'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ae4dd40f05 122/308: Added pcomplete for drush.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 57897dbed5 125/308: Fixed locating drush version number., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0b9e5d25b4 129/308: Added basic support for flycheck., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4f54f8bcb8 134/308: Fixed documentation., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode bd22697642 135/308: Mark `drupal/flymake-phpcs-standard' as obsolete., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3ba088c812 139/308: No need for make-local-variable., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode a6a4bfa842 144/308: No quoting necessary, says wiser minds than mine., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 996081be40 157/308: Merge branch 'release/0.3.0', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 97b60197d0 151/308: Improved rootdir detection for etags and gtags., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8733eb2d1e 160/308: Bumped versio to 0.3.1., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 31c2b672aa 168/308: Added Api.drupalize.me as `drupal-search-url` option., ELPA Syncer, 2022/01/25