From 15c068e1cff03f81f63b85159437e162660c0760 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 28 Mar 2017 09:35:03 +0200 Subject: Update snippets and yasnippet --- .emacs.d/snippets/prog-mode/comment | 2 +- .emacs.d/snippets/prog-mode/commentline | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to '.emacs.d/snippets') diff --git a/.emacs.d/snippets/prog-mode/comment b/.emacs.d/snippets/prog-mode/comment index edd53e9..7ae2b8c 100644 --- a/.emacs.d/snippets/prog-mode/comment +++ b/.emacs.d/snippets/prog-mode/comment @@ -3,4 +3,4 @@ # name: comment # key: co # -- -${1:$(yas-trimmed-comment-start)} ${1:comment}${1:$(unless (eq (length comment-end) 0) (concat " " (yas-trimmed-comment-end)))}$0 \ No newline at end of file +`(yas-trimmed-comment-start)` ${1:comment}`(unless (eq (length comment-end) 0) (concat " " (yas-trimmed-comment-end)))`$0 \ No newline at end of file diff --git a/.emacs.d/snippets/prog-mode/commentline b/.emacs.d/snippets/prog-mode/commentline index 0b0edff..400a7bf 100644 --- a/.emacs.d/snippets/prog-mode/commentline +++ b/.emacs.d/snippets/prog-mode/commentline @@ -3,11 +3,9 @@ # name: commentline # key: col # -- -${1:$(yas-trimmed-comment-start)} ${1:comment} ${1:$(let* ((str "") - (curr (current-column)) - (start (yas-trimmed-comment-start)) - (lastcom (substring start -1)) - (end (yas-trimmed-comment-end))) - (while (< (length str) (- 79 (+ curr (length end)))) - (setq str (concat str lastcom))) - (concat str end))}$0 \ No newline at end of file +`(yas-trimmed-comment-start)` ${1:comment} ${1:$(let* ((start (yas-trimmed-comment-start)) + (lastcom (aref start (1- (length start)))) + (end (yas-trimmed-comment-end)) + (endpadlen (- 79 (+ (current-column) (length end))))) + (concat (make-string (max endpadlen 0) lastcom) + end))}$0 \ No newline at end of file -- cgit v1.3