From 0fad5ec6b36ee1e943350ea0f193f152c07cdc36 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Sat, 16 Mar 2019 10:06:05 -0700 Subject: [PATCH] add more snippets --- emacs_el/snippets/cperl-mode/perlscript | 85 +++++++++++++++++++ emacs_el/snippets/latex-mode/ctrig | 7 ++ emacs_el/snippets/latex-mode/fframe | 7 ++ emacs_el/snippets/latex-mode/game | 10 +++ emacs_el/snippets/latex-mode/multichoice | 7 ++ emacs_el/snippets/makefile-gmake-mode/dfig | 8 ++ .../snippets/message-mode/debbugs_moreinfo | 17 ++++ emacs_el/snippets/spamassassin-mode/meta | 8 ++ 8 files changed, 149 insertions(+) create mode 100644 emacs_el/snippets/cperl-mode/perlscript create mode 100644 emacs_el/snippets/latex-mode/ctrig create mode 100644 emacs_el/snippets/latex-mode/fframe create mode 100644 emacs_el/snippets/latex-mode/game create mode 100644 emacs_el/snippets/latex-mode/multichoice create mode 100644 emacs_el/snippets/makefile-gmake-mode/dfig create mode 100644 emacs_el/snippets/message-mode/debbugs_moreinfo create mode 100644 emacs_el/snippets/spamassassin-mode/meta diff --git a/emacs_el/snippets/cperl-mode/perlscript b/emacs_el/snippets/cperl-mode/perlscript new file mode 100644 index 0000000..48ddaaa --- /dev/null +++ b/emacs_el/snippets/cperl-mode/perlscript @@ -0,0 +1,85 @@ +# -*- mode: snippet -*- +# name: perlscript +# key: perlscript +# -- +#!/usr/bin/perl +# ${1:SCRIPTNAME} ${2:SCRIPTDOESSOMETHING} +# and is released under the terms of the GNU GPL version 3, or any +# later version, at your option. See the file README and COPYING for +# more information. +# Copyright `(format-time-string "%Y")` by Don Armstrong . + + +use warnings; +use strict; + +use Getopt::Long; +use Pod::Usage; + +=head1 NAME + +$1 - $2 + +=head1 SYNOPSIS + +$1 [options] + + Options: + --debug, -d debugging level (Default 0) + --help, -h display this help + --man, -m display manual + +=head1 OPTIONS + +=over + +=item B<--debug, -d> + +Debug verbosity. (Default 0) + +=item B<--help, -h> + +Display brief usage information. + +=item B<--man, -m> + +Display this manual. + +=back + +=head1 EXAMPLES + +C<$1> + +=cut + + +use vars qw($DEBUG); + +my %options = (debug => 0, + help => 0, + man => 0, + ); + +GetOptions(\%options, + 'debug|d+','help|h|?','man|m'); + +pod2usage() if $options{help}; +pod2usage({verbose=>2}) if $options{man}; + +$DEBUG = $options{debug}; + +my @USAGE_ERRORS; +if (1) { + push @USAGE_ERRORS,"You must pass something"; +} + +pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS; + +$0 + +__END__ +# Local Variables: +# indent-tabs-mode: nil +# cperl-indent-level: 4 +# End: diff --git a/emacs_el/snippets/latex-mode/ctrig b/emacs_el/snippets/latex-mode/ctrig new file mode 100644 index 0000000..a85b4d5 --- /dev/null +++ b/emacs_el/snippets/latex-mode/ctrig @@ -0,0 +1,7 @@ +# key: ctrig +# name: ctrig +# -- +\centering + \includegraphics[width=\textwidth,height=0.8\textheight,keepaspectratio]{figures/$0} + + {\small $1} diff --git a/emacs_el/snippets/latex-mode/fframe b/emacs_el/snippets/latex-mode/fframe new file mode 100644 index 0000000..a08eee7 --- /dev/null +++ b/emacs_el/snippets/latex-mode/fframe @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fframe +# key: fframe +# -- +\begin{frame}{${1:title}} +$0 +\end{frame} \ No newline at end of file diff --git a/emacs_el/snippets/latex-mode/game b/emacs_el/snippets/latex-mode/game new file mode 100644 index 0000000..92fe7ff --- /dev/null +++ b/emacs_el/snippets/latex-mode/game @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: game +# key: game +# -- +\node [game] (${1:round_name}) [right=of ${2:previous_round}.south east] + {\game{$4}{$5}% + {$6}{$7}}; + \path [bracket] ($2.east) -- ++(0.5em,0) |- ($1.176); + \path [bracket] (${3:other_previous_round}.east) -- ++(0.5em,0) |- ($1.184); +$0 diff --git a/emacs_el/snippets/latex-mode/multichoice b/emacs_el/snippets/latex-mode/multichoice new file mode 100644 index 0000000..7879e51 --- /dev/null +++ b/emacs_el/snippets/latex-mode/multichoice @@ -0,0 +1,7 @@ +# key: mquest +# name: multichoice +# -- +\question[${1:2}] $3 +\begin{choices} +\CorrectChoice $0 +\end{choices} \ No newline at end of file diff --git a/emacs_el/snippets/makefile-gmake-mode/dfig b/emacs_el/snippets/makefile-gmake-mode/dfig new file mode 100644 index 0000000..178a3c6 --- /dev/null +++ b/emacs_el/snippets/makefile-gmake-mode/dfig @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: dfig +# key: dfig +# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)) +# -- +DOWNLOAD_FIGURES+=${1:foo.jpg} +$1: + wget -O $@ "$0" diff --git a/emacs_el/snippets/message-mode/debbugs_moreinfo b/emacs_el/snippets/message-mode/debbugs_moreinfo new file mode 100644 index 0000000..2e75fb4 --- /dev/null +++ b/emacs_el/snippets/message-mode/debbugs_moreinfo @@ -0,0 +1,17 @@ +# -*- mode: snippet -*- +# name: debbugs_moreinfo +# key: debbugs_moreinfo +# -- +Because we receive and send a large amount of mail, we need more +information before we can figure out what actually happened to your +message. Could you please provide us with the following information +(or as much of it as possible): + + * the IP, + * the Time (including timezone), + * the Message-Id, + * the Addresses you sent from and to, + * anything else that you think would help + +Without that information, it's almost impossible for us to figure out +what went wrong. \ No newline at end of file diff --git a/emacs_el/snippets/spamassassin-mode/meta b/emacs_el/snippets/spamassassin-mode/meta new file mode 100644 index 0000000..a2f5ac0 --- /dev/null +++ b/emacs_el/snippets/spamassassin-mode/meta @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: meta +# key: meta +# -- +# don `(format-time-string "%Y-%m-%d")` +meta ${1:RULENAME} ${2:RULES} +describe $1 ${3:Description} +score $1 ${4:0.1} -- 2.39.2