[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 1e06f39e9f 025/308: Added `drupal-drush-cache-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 1e06f39e9f 025/308: Added `drupal-drush-cache-clear'. |
Date: |
Tue, 25 Jan 2022 10:59:04 -0500 (EST) |
branch: elpa/drupal-mode
commit 1e06f39e9f924d4df3e2cb141d94091f4eb3e61a
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Added `drupal-drush-cache-clear'.
The function will run drush to clear all Drupal caches.
Put it in the Drupal menu and on C-c d c.
---
drupal-mode.el | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drupal-mode.el b/drupal-mode.el
index 8a72d16f6a..030b67a844 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -118,6 +118,7 @@ According to http://drupal.org/coding-standards#indenting."
(defvar drupal-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-cdf" 'drupal-search-documentation)
+ (define-key map "\C-cdc" 'drupal-drush-cache-clear)
map)
"Keymap for `drupal-mode'")
@@ -179,6 +180,23 @@ According to http://drupal.org/coding-standards#indenting."
(interactive)
(info "drupal-mode"))
+(defun drupal-drush-cache-clear ()
+ "Clear all Drupal caches.
+Runs `drush cache-clear all'. Depends on `drupal-drush-program'
+pointing to Drush and depends on the buffer being part of a
+Drupal project (that means `drupal-rootdir' being set to the root
+of the project)."
+ (interactive)
+ (if (and drupal-rootdir
+ drupal-drush-program)
+ (let ((root drupal-rootdir))
+ (with-temp-buffer
+ (cd-absolute root)
+ (message "Clearing all caches...")
+ (call-process drupal-drush-program nil nil nil "cache-clear" "all")
+ (message "Clearing all caches...done")))
+ (message "Can't clear caches. No DRUPALROOT and/or no drush command.")))
+
;; Make a menu keymap (with a prompt string)
@@ -197,6 +215,10 @@ According to http://drupal.org/coding-standards#indenting."
(define-key drupal-mode-map
[menu-bar drupal search-documentation]
'("Search documentation" . drupal-search-documentation))
+(define-key drupal-mode-map
+ [menu-bar drupal cache-clear]
+ '(menu-item "Clear all caches" drupal-drush-cache-clear
+ :enable (and drupal-rootdir drupal-drush-program)))
- [nongnu] elpa/drupal-mode 9ca9376c93 055/308: Addes wrapper function and added test cases to package., (continued)
- [nongnu] elpa/drupal-mode 9ca9376c93 055/308: Addes wrapper function and added test cases to package., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 866c3f4f86 128/308: Carton renamed to Cask., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 080049a881 130/308: Reenable ignore-errors., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0a9d8dfa49 164/308: Cleaned whitespace., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 430b04536e 176/308: Added special case for .tpl.php extensions., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode be281df109 175/308: Added info modes. Drupal Coder Sniffer understands info files as well., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3937ec3f40 002/308: Initial version., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6e1ef13c5e 001/308: Initial commit, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 7d2d703ab9 017/308: Merge branch 'feature/documentation' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6fbdb4e9ad 020/308: Made customization of search URLs more intuitive., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 1e06f39e9f 025/308: Added `drupal-drush-cache-clear'.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 85040ec2e5 062/308: Actually enable flymake-mode in Drupal buffers., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 9c5f0066d5 071/308: Added function arguments on `drupal-insert-hook'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6b22e8c714 059/308: Added copyright and author comments., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode bb47e5d71b 086/308: Replaced nested `if's with `cond'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode de6c1b1442 057/308: Better checking for major modes., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 5e5f6e2782 084/308: Added drupal-mode support for `auto-insert-mode'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 511fa0de3f 104/308: Ensured file extensions are actually extensions., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8947650b95 119/308: Rewritten Makefile to use Carton., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 043d79f4ff 127/308: Sort imenu entries by name in .make files., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3f306071da 137/308: Drupal 8 moved the version number to a new file., ELPA Syncer, 2022/01/25