From 6a3efe35bf8b20b0900dbbf7747b8b8d0d19bd04 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 6 Sep 2016 07:39:30 +0200 Subject: Upgrade ports --- .emacs.d/snippets/prog-mode/commentblock | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .emacs.d/snippets/prog-mode/commentblock (limited to '.emacs.d/snippets/prog-mode/commentblock') diff --git a/.emacs.d/snippets/prog-mode/commentblock b/.emacs.d/snippets/prog-mode/commentblock new file mode 100644 index 0000000..ba61f61 --- /dev/null +++ b/.emacs.d/snippets/prog-mode/commentblock @@ -0,0 +1,36 @@ +# -*- mode: snippet -*- +# contributor: sh-ow +# name: commentblock +# key: cob +# -- +${1:$(let* ((col (current-column)) + (str "") + (lastcom (substring (yas-trimmed-comment-start) -1)) + (start (yas-trimmed-comment-start)) + (end (yas-trimmed-comment-end)) + (over (- (+ (string-width yas-text) (length start) (length end) col) 77))) + (while (< (length str) (+ (- 79 (length start) (length end) col) (if (> over 0) over 0))) + (setq str (concat str lastcom))) + (concat start str end))} +${1:$(let* ((col (current-column)) + (str "") + (start (yas-trimmed-comment-start)) + (end (yas-trimmed-comment-end))) + (while (< (length str) (ffloor (/ (- 78.0 (+ col (length start) (string-width yas-text) (length end))) 2.0))) + (setq str (concat str " "))) + (concat start str))} ${1:comment} ${1:$(let* ((col (current-column)) + (str "") + (start (yas-trimmed-comment-start)) + (end (yas-trimmed-comment-end))) + (while (< (length str) (- 79.0 (if (eq (mod (string-width yas-text) 2) 1) (- col 1) col) (length end))) + (setq str (concat str " "))) + (concat str end))} +${1:$(let* ((col (current-column)) + (str "") + (lastcom (substring (yas-trimmed-comment-start) -1)) + (start (yas-trimmed-comment-start)) + (end (yas-trimmed-comment-end)) + (over (- (+ (string-width yas-text) (length start) (length end) col) 77))) + (while (< (length str) (+ (- 79 (length start) (length end) col) (if (> over 0) over 0))) + (setq str (concat str lastcom))) + (concat start str end))}$0 \ No newline at end of file -- cgit v1.3