From 65764856df7ae28c8b07b4dfba512c8a86591f7d Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 1 Oct 2017 09:06:13 -0400 Subject: [PATCH] Put $0 before comment-end (#221) * Put $0 before comment-end * snippets/prog-mode/fixme: * snippets/prog-mode/todo: * snippets/prog-mode/xxx: Use comment-start and comment-end directly instead of `yas-with-comment` so that $0 can be inserted before comment-end. * * snippets/prog-mode/.yas-setup.el (yas-with-comment): Remove. --- snippets/prog-mode/.yas-setup.el | 3 --- snippets/prog-mode/fixme | 2 +- snippets/prog-mode/todo | 2 +- snippets/prog-mode/xxx | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/snippets/prog-mode/.yas-setup.el b/snippets/prog-mode/.yas-setup.el index 22a8168..486ae47 100644 --- a/snippets/prog-mode/.yas-setup.el +++ b/snippets/prog-mode/.yas-setup.el @@ -1,8 +1,5 @@ (require 'yasnippet) -(defun yas-with-comment (str) - (format "%s%s%s" comment-start str comment-end)) - ;; whitespace removing functions from Magnar Sveen ;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun yas-s-trim-left (s) "Remove whitespace at the beginning of S." diff --git a/snippets/prog-mode/fixme b/snippets/prog-mode/fixme index 146db8b..6a0406f 100644 --- a/snippets/prog-mode/fixme +++ b/snippets/prog-mode/fixme @@ -3,4 +3,4 @@ # key: fi # condition: (not (eq major-mode 'sh-mode)) # -- -`(yas-with-comment "FIXME: ")` \ No newline at end of file +`comment-start`FIXME: $0`comment-end \ No newline at end of file diff --git a/snippets/prog-mode/todo b/snippets/prog-mode/todo index 973151f..79484e7 100644 --- a/snippets/prog-mode/todo +++ b/snippets/prog-mode/todo @@ -2,4 +2,4 @@ # name: todo # key: t # -- -`(yas-with-comment "TODO: ")` \ No newline at end of file +`comment-start`TODO: $0`comment-end` \ No newline at end of file diff --git a/snippets/prog-mode/xxx b/snippets/prog-mode/xxx index 09df18b..85f0e6b 100644 --- a/snippets/prog-mode/xxx +++ b/snippets/prog-mode/xxx @@ -2,4 +2,4 @@ # name: xxx # key: x # -- -`(yas-with-comment "XXX: ")` \ No newline at end of file +`comment-start`XXX: $0`comment-end` \ No newline at end of file