update packages
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
;;; -*- lexical-binding: t -*-
|
||||
(require 'yasnippet)
|
||||
|
||||
;; whitespace removing functions from Magnar Sveen ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
@@ -28,9 +29,17 @@
|
||||
"This function returns `comment-start' trimmed by whitespaces."
|
||||
(yas-s-trim comment-start))
|
||||
|
||||
(defun yas-trimmed-add-comment ()
|
||||
"This function returns `comment-start' trimmed by whitespaces. It uses
|
||||
`comment-add' to determine how many comment symbols to insert."
|
||||
(yas-s-trim (apply #'concat (mapcar (lambda (x)
|
||||
comment-start)
|
||||
(number-sequence 0 comment-add)))))
|
||||
|
||||
(defun yas-trimmed-comment-end ()
|
||||
"This function returns `comment-end' trimmed by whitespaces if `comment-end' is not empty.
|
||||
Otherwise the reversed output of function `yas-trimmed-comment-start' is returned."
|
||||
"This function returns `comment-end' trimmed by whitespaces if
|
||||
`comment-end' is not empty. Otherwise the reversed output of
|
||||
function `yas-trimmed-comment-start' is returned."
|
||||
(if (eq (length comment-end) 0)
|
||||
(yas-string-reverse (yas-trimmed-comment-start))
|
||||
(yas-s-trim comment-end)))
|
||||
|
||||
@@ -15,15 +15,20 @@ ${1:$(let* ((col (current-column))
|
||||
${1:$(let* ((col (current-column))
|
||||
(str "")
|
||||
(start (yas-trimmed-comment-start))
|
||||
(start (if (string= start ";") ";;" 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 start str))} ${1:comment} ${1:$(
|
||||
let* ((col (current-column))
|
||||
(str "")
|
||||
(start (yas-trimmed-comment-start))
|
||||
(start (if (string= start ";") ";;" start))
|
||||
(end (yas-trimmed-comment-end)))
|
||||
(while (< (length str)
|
||||
(- 79 (length end)
|
||||
(if (eq (mod (+ (string-width yas-text) (length start) (length end)) 2) 1) (- col 1) col)))
|
||||
(setq str (concat str " ")))
|
||||
(concat str end))}
|
||||
${1:$(let* ((col (current-column))
|
||||
(str "")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fixme
|
||||
# key: fi
|
||||
# condition: (not (eq major-mode 'sh-mode))
|
||||
# condition: (not (member major-mode '(sh-mode bash-ts-mode)))
|
||||
# --
|
||||
`comment-start`FIXME: $0`comment-end`
|
||||
6
lisp/yasnippet-snippets/snippets/prog-mode/spdxcopyright
Normal file
6
lisp/yasnippet-snippets/snippets/prog-mode/spdxcopyright
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Antero Mejr <mail@antr.me>
|
||||
# name: spdxcopyright
|
||||
# key: spc
|
||||
# --
|
||||
`(yas-trimmed-add-comment)` SPDX-FileCopyrightText: $0`comment-end`
|
||||
6
lisp/yasnippet-snippets/snippets/prog-mode/spdxlicense
Normal file
6
lisp/yasnippet-snippets/snippets/prog-mode/spdxlicense
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Antero Mejr <mail@antr.me>
|
||||
# name: spdxlicense
|
||||
# key: spl
|
||||
# --
|
||||
`(yas-trimmed-add-comment)` SPDX-License-Identifier: $0`comment-end`
|
||||
Reference in New Issue
Block a user