[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 493acf44da 166/308: Redone building `drupal-mo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 493acf44da 166/308: Redone building `drupal-mode-map`. |
Date: |
Tue, 25 Jan 2022 10:59:44 -0500 (EST) |
branch: elpa/drupal-mode
commit 493acf44da901ee746559d80c83182f19dd33027
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Redone building `drupal-mode-map`.
This way it is easier to also add the mnemonic keys / functions to other
key bindings. I.e. I do the following in my .emacs to map them to the
hyper key:
```
(add-hook 'drupal-mode-hook (lambda ()
(dolist (elem drupal-mode-map-alist)
(local-set-key `[(hyper ,(car elem))] (cdr
elem)))))
```
---
drupal-mode.el | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index 7d75e17872..e87a75f733 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -188,14 +188,23 @@ Include path to the executable if it is not in your
$PATH."
(make-variable-buffer-local 'drupal-project)
(put 'drupal-project 'safe-local-variable 'string-or-null-p)
+(defvar drupal-mode-map-alist
+ '((?d . drupal-search-documentation)
+ (?c . drupal-drush-cache-clear)
+ (?h . drupal-insert-hook)
+ (?f . drupal-insert-function)
+ (?m . drupal-module-name)
+ (?t . drupal-wrap-string-in-t-function))
+ "Map of mnemonic keys and functions for keyboard shortcuts.
+See `drupal-mode-map'.")
+
(defvar drupal-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map [(control c) (control v) (control d)]
#'drupal-search-documentation)
- (define-key map [(control c) (control v) (control c)]
#'drupal-drush-cache-clear)
- (define-key map [(control c) (control v) (control h)] #'drupal-insert-hook)
- (define-key map [(control c) (control v) (control f)]
#'drupal-insert-function)
- (define-key map [(control c) (control v) (control m)] #'drupal-module-name)
- (define-key map [(control c) (control v) (control t)]
#'drupal-wrap-string-in-t-function)
+ ;; Iterate `drupal-mode-map-alist' and assign the functions to the
+ ;; mode map on C-c C-v C-`mnemonic-key'.
+ (dolist (elem drupal-mode-map-alist)
+ (define-key map `[(control c) (control v) (control ,(car elem))] (cdr
elem)))
+
(define-key map [(control a)] #'drupal-mode-beginning-of-line)
map)
"Keymap for `drupal-mode'")
- [nongnu] elpa/drupal-mode 38783166f3 143/308: Check for drupal/flycheck-phpcs-js-and-css in predicate, now we don't enforce it., (continued)
- [nongnu] elpa/drupal-mode 38783166f3 143/308: Check for drupal/flycheck-phpcs-js-and-css in predicate, now we don't enforce it., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8d57a2a3d6 146/308: Added `hash-table-p` check., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 274015c27a 147/308: Merge pull request #37 from xendk/develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4adeb0c218 150/308: Fixed tar on Mac OS X., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e20d8fefaa 153/308: Swicth to https links to Drupal.org., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8eec967164 152/308: Fixed latest commit., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 36a8caff76 156/308: Bumped version number to 0.3.0., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 557f34c5d3 163/308: Fixed tar on Mac OS X., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4e4714fc16 165/308: ..., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 919154b7f4 158/308: Merge branch 'release/0.3.0' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 493acf44da 166/308: Redone building `drupal-mode-map`.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode a25b4df69a 179/308: Cope with different implementations of flymake-phpcs., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 9b091a3b71 182/308: Merge tag '0.4.0' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3bb1e40acc 183/308: Silence byte compiler., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode cd07abb544 189/308: Made it possible to refer to issue comments., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4532cd7217 193/308: Use `._flymake` as temp file pattern., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 7ddadecabd 191/308: Reduced number of times calling `drupal-detect-drupal-version`., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 1d1690b855 203/308: Merge branch 'release/0.5.0', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ca93db3d20 027/308: Only change dictionary to `american' if it exists., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ab0af570f8 095/308: Added .profile to `auto-load-alist' for `php-mode'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8d2c52c821 188/308: Prepared for .api.php CoderSniffer sniffs., ELPA Syncer, 2022/01/25