[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 55c448b 32/42: Remove redundant arg to yas-expand-snippet
From: |
Noam Postavsky |
Subject: |
[elpa] master 55c448b 32/42: Remove redundant arg to yas-expand-snippet |
Date: |
Sun, 22 Dec 2019 17:38:02 -0500 (EST) |
branch: master
commit 55c448b9912fb65e449120e4ec8dfdafb8633291
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Remove redundant arg to yas-expand-snippet
* yasnippet.el (yas--expand-or-visit-from-menu)
(yas--expand-or-prompt-for-template)
(yas-visit-snippet-file, yas-tryout-snippet): Don't pass expand-env
when to yas-expand-snippet when first arg is a yas--template record.
---
yasnippet.el | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 27df486..bd915ef 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -1692,10 +1692,8 @@ Here's a list of currently recognized directives:
(let ((where (if (region-active-p)
(cons (region-beginning) (region-end))
(cons (point) (point)))))
- (yas-expand-snippet (yas--template-content yas--current-template)
- (car where)
- (cdr where)
- (yas--template-expand-env
yas--current-template)))))))
+ (yas-expand-snippet yas--current-template
+ (car where) (cdr where)))))))
(defun yas--key-from-desc (text)
"Return a yasnippet key from a description string TEXT."
@@ -2400,14 +2398,12 @@ template objects if CMD is nil (this is useful as a
more general predicate)."
Prompt the user if TEMPLATES has more than one element, else
expand immediately. Common gateway for
`yas-expand-from-trigger-key' and `yas-expand-from-keymap'."
- (let ((yas--current-template (or (and (cl-rest templates) ;; more than one
- (yas--prompt-for-template (mapcar
#'cdr templates)))
- (cdar templates))))
+ (let ((yas--current-template
+ (or (and (cl-rest templates) ;; more than one
+ (yas--prompt-for-template (mapcar #'cdr templates)))
+ (cdar templates))))
(when yas--current-template
- (yas-expand-snippet (yas--template-content yas--current-template)
- start
- end
- (yas--template-expand-env yas--current-template)))))
+ (yas-expand-snippet yas--current-template start end))))
;; Apropos the trigger key and the fallback binding:
;;
@@ -2552,10 +2548,7 @@ by condition."
(cons (region-beginning) (region-end))
(cons (point) (point)))))
(if yas--current-template
- (yas-expand-snippet (yas--template-content yas--current-template)
- (car where)
- (cdr where)
- (yas--template-expand-env yas--current-template))
+ (yas-expand-snippet yas--current-template (car where) (cdr where))
(yas--message 1 "No snippets can be inserted here!"))))
(defun yas-visit-snippet-file ()
@@ -2843,17 +2836,17 @@ DEBUG is for debugging the YASnippet engine itself."
:name (nth 2 parsed)
:expand-env (nth 5 parsed)))))
(cond (yas--current-template
- (let ((buffer-name (format "*testing snippet: %s*"
(yas--template-name yas--current-template))))
+ (let ((buffer-name
+ (format "*testing snippet: %s*"
+ (yas--template-name yas--current-template))))
(kill-buffer (get-buffer-create buffer-name))
(switch-to-buffer (get-buffer-create buffer-name))
(setq buffer-undo-list nil)
(condition-case nil (funcall test-mode) (error nil))
(yas-minor-mode 1)
(setq buffer-read-only nil)
- (yas-expand-snippet (yas--template-content yas--current-template)
- (point-min)
- (point-max)
- (yas--template-expand-env
yas--current-template))
+ (yas-expand-snippet yas--current-template
+ (point-min) (point-max))
(when (and debug
(require 'yasnippet-debug nil t))
(yas-debug-snippets "*YASnippet trace*" 'snippet-navigation)
- [elpa] master 8b25d62 20/42: * doc/snippet-development.org: Fix typos., (continued)
- [elpa] master 8b25d62 20/42: * doc/snippet-development.org: Fix typos., Noam Postavsky, 2019/12/22
- [elpa] master 7612bc1 24/42: Don't check this-command in yas-not-string-or-comment-condition, Noam Postavsky, 2019/12/22
- [elpa] master dabc719 21/42: Don't turn on yas-minor-mode in temp buffers, Noam Postavsky, 2019/12/22
- [elpa] master fc33b2f 28/42: Make overlay-modification protection optional, Noam Postavsky, 2019/12/22
- [elpa] master 048d030 22/42: Fix line-relative snapshotting for org src blocks, Noam Postavsky, 2019/12/22
- [elpa] master bae20af 27/42: ; * doc/faq.org: Linkify bug reference., Noam Postavsky, 2019/12/22
- [elpa] master ffc733d 09/42: ; Debug code fixes, Noam Postavsky, 2019/12/22
- [elpa] master 1d96da2 18/42: Don't call before/after change-functions twice, Noam Postavsky, 2019/12/22
- [elpa] master 6a3619b 23/42: Fix additional corner case with org source block integration, Noam Postavsky, 2019/12/22
- [elpa] master 9cedd59 25/42: Allow disabling snippet keybindings from hook, Noam Postavsky, 2019/12/22
- [elpa] master 55c448b 32/42: Remove redundant arg to yas-expand-snippet,
Noam Postavsky <=
- [elpa] master 189f737 26/42: * doc/faq.org: Note that Flyspell problem is (now fixed) Emacs bug., Noam Postavsky, 2019/12/22
- [elpa] master ffce236 30/42: Do auto indentation only in post command hook, Noam Postavsky, 2019/12/22
- [elpa] master 760f77a 12/42: Test for mirroring more than one field, Noam Postavsky, 2019/12/22
- [elpa] master 0f05a75 14/42: Add yas-completing-read, Noam Postavsky, 2019/12/22
- [elpa] master 03aa561 19/42: * doc/snippet-organization.org: Fix typo., Noam Postavsky, 2019/12/22
- [elpa] master 9f51cf2 17/42: Register snippet movement comments for eldoc, Noam Postavsky, 2019/12/22
- [elpa] master 6a738b5 29/42: ; doc/faq.org: Fix example keybinding code., Noam Postavsky, 2019/12/22
- [elpa] master 476bc77 35/42: Fix snippet undo, Noam Postavsky, 2019/12/22
- [elpa] master c432e78 31/42: Fix field adjustment on deletion, Noam Postavsky, 2019/12/22
- [elpa] master f056a4d 33/42: Minor code shuffling and commenting, Noam Postavsky, 2019/12/22