[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/setup 36b5ef2 04/17: Add yasnippet configuration as ano
From: |
Stefan Monnier |
Subject: |
[elpa] externals/setup 36b5ef2 04/17: Add yasnippet configuration as another example |
Date: |
Sat, 13 Mar 2021 18:15:12 -0500 (EST) |
branch: externals/setup
commit 36b5ef26147185ea47feb84465a017998b82f5cf
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>
Add yasnippet configuration as another example
---
README.md | 23 +++++++++++++++++++++--
setup.el | 18 ++++++++++++++++++
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 0bbb6e7..9e25927 100644
--- a/README.md
+++ b/README.md
@@ -10,10 +10,18 @@ example, these macros:
(:bind (key bury-buffer))))
- (setup (package paredit)
+ (setup (:package paredit)
(:hide-mode)
(:hook-into scheme-mode lisp-mode))
+
+ (setup (:package yasnippet)
+ (:with-mode yas-minor-mode
+ (:rebind "<backtab>" yas-expand)
+ (:option yas-prompt-functions '(yas-completing-prompt)
+ yas-wrap-around-region t)
+ (:hook-into prog-mode)))
+
will be replaced with the functional equivalent of
(global-set-key (kbd "C-c s") #'shell)
@@ -22,12 +30,23 @@ will be replaced with the functional equivalent of
(unless (package-install-p 'paredit)
- (package-install 'paredit ))
+ (package-install 'paredit))
(delq (assq 'paredit-mode minor-mode-alist)
minor-mode-alist)
(add-hook 'scheme-mode-hook #'paredit-mode)
(add-hook 'lisp-mode-hook #'paredit-mode)
+
+ (unless (package-install-p 'yasnippet)
+ (package-install 'yasnippet))
+ (with-eval-after-load 'yasnippet
+ (dolist (key (where-is-internal 'yas-expand yas-minor-mode-map))
+ (define-key yas-minor-mode-map key nil))
+ (define-key yas-minor-mode-map "<backtab>" #'yas-expand)
+ (customize-set-variable 'yas-prompt-functions '(yas-completing-prompt))
+ (customize-set-variable 'yas-wrap-around-region t))
+ (add-hook 'prog-mode-hook #'yas-minor-mode)
+
Additional "keywords" can be defined using `setup-define'. All known
keywords are documented in the docstring for `setup'.
diff --git a/setup.el b/setup.el
index 8a95dbe..69a32e3 100644
--- a/setup.el
+++ b/setup.el
@@ -28,6 +28,13 @@
;; (setup (:package paredit)
;; (:hide-mode)
;; (:hook-into scheme-mode lisp-mode))
+;;
+;; (setup (:package yasnippet)
+;; (:with-mode yas-minor-mode
+;; (:rebind "<backtab>" yas-expand)
+;; (:option yas-prompt-functions '(yas-completing-prompt)
+;; yas-wrap-around-region t)
+;; (:hook-into prog-mode)))
;; will be replaced with the functional equivalent of
@@ -42,6 +49,17 @@
;; minor-mode-alist)
;; (add-hook 'scheme-mode-hook #'paredit-mode)
;; (add-hook 'lisp-mode-hook #'paredit-mode)
+;;
+;; (unless (package-install-p 'yasnippet)
+;; (package-install 'yasnippet))
+;; (with-eval-after-load 'yasnippet
+;; (dolist (key (where-is-internal 'yas-expand yas-minor-mode-map))
+;; (define-key yas-minor-mode-map key nil))
+;; (define-key yas-minor-mode-map "<backtab>" #'yas-expand)
+;; (customize-set-variable 'yas-prompt-functions '(yas-completing-prompt))
+;; (customize-set-variable 'yas-wrap-around-region t))
+;; (add-hook 'prog-mode-hook #'yas-minor-mode)
+
;; Additional "keywords" can be defined using `setup-define'. All
;; known keywords are documented in the docstring for `setup'.
- [elpa] externals/setup 2624076 07/17: Add general conditional macro :if, (continued)
- [elpa] externals/setup 2624076 07/17: Add general conditional macro :if, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 87fcdf4 12/17: Improve (append ...) and (prepend ...) support, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 3767d24 16/17: Remove explicit dependency on cl-lib, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 912860f 03/17: Update README, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 35b4f18 11/17: Add :also-load macro, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 0bf5c62 09/17: Add :with-feature macro, Stefan Monnier, 2021/03/13
- [elpa] externals/setup d768953 10/17: Sort macros in alphabetical order, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 6ee46ab 14/17: Add support for edebug, Stefan Monnier, 2021/03/13
- [elpa] externals/setup b413502 01/17: Initial import, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 3d745d8 15/17: Update info node link, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 36b5ef2 04/17: Add yasnippet configuration as another example,
Stefan Monnier <=
- [elpa] externals/setup 761e2ea 05/17: Print signature with princ instead of prin1, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 23e8eef 08/17: Fix syntax-error while defining :with-map, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 6d84649 17/17: Update copyright notice, Stefan Monnier, 2021/03/13
- [elpa] externals/setup 0e95ccd 13/17: Document :repeatable property, Stefan Monnier, 2021/03/13