File: sepia-snippet.el

package info (click to toggle)
sepia 0.992-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 648 kB
  • sloc: perl: 2,811; lisp: 2,655; sh: 46; makefile: 14
file content (23 lines) | stat: -rw-r--r-- 896 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(eval-when-compile
  (require 'snippet))

(defun sepia-snippet-abbrev ()
  (require 'snippet nil t)
  (when (featurep 'snippet)
    (snippet-with-abbrev-table
     'sepia-mode-abbrev-table
     ("else" . "else {\n$>$.\n}$>")
     ("elsif" . "elsif ($${TEST}) {\n$>$.\n}$>")
     ("for" . "for ($${LIST}) {\n$>$.\n}$>")
     ("foreach" . "foreach my $${VAR} ($${LIST}) {\n$>$.\n}$>")
     ("formy" . "for my $${VAR} ($${LIST}) {\n$>$.\n}$>")
     ("given" . "given ($${VAR}) {\n$>$.\n}$>")
     ("when" . "when ($${TEST}) {\n$>$.\n}$>")
     ("if" . "if ($${TEST}) {\n$>$.\n}$>")
     ("sub" . "sub $${NAME}\n{\n$>$.\n}$>")
     ("unless" . "unless ($${TEST}) {\n$>$.\n}$>")
     ("until" . "until ($${TEST}) {\n$>$.\n}$>")
     ("while" . "while ($${TEST}) {\n$>$.\n}$>")
     ("whilekv" . "while (my ($k, $v) = each $${HASH}) {\n$>$.\n}$>"))))

(add-hook 'sepia-mode-hook 'sepia-snippet-abbrev)