Merge pull request #307 from AndreaCrotti/reporting

Reporting
This commit is contained in:
Andrea Crotti 2019-03-09 09:45:29 +00:00 committed by GitHub
commit 827908d7cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
366 changed files with 973 additions and 875 deletions

10
report/project.clj Normal file
View File

@ -0,0 +1,10 @@
(defproject report "0.1.0-SNAPSHOT"
:description "Give a report of the yas snippets"
:dependencies [[org.clojure/clojure "1.10.0"]
[hiccup "1.0.5"]]
:uberjar-name "report.jar"
:min-lein-version "2.8.1"
:source-paths ["src"]
:test-paths ["test"]
:resource-paths ["resources"])

88
report/src/core.clj Normal file
View File

@ -0,0 +1,88 @@
(ns core
"Parse files and generate some html reports"
(:require [clojure.string :as str]
[hiccup.core :as hiccup]
[clojure.java.io :as io]))
;; TODO: do something whenever the mode has just `.yas-parents` and nothing else?
(def bulma-url "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.css")
(defn kw-pattern
[kw]
(re-pattern (format "# %s: (.*)" kw)))
(defn extract-keyword
[filename keyword]
(let [lines (-> filename
slurp
str/split-lines)]
(first
(remove nil?
(map #(last (re-find (kw-pattern keyword) %)) lines)))))
(defn mode-files
[mode-dir]
(filter #(.isFile %)
(file-seq (io/file mode-dir))))
(defn parse-mode
[mode-dir]
(for [f (mode-files mode-dir)]
{:filename (.getName (io/file mode-dir f))
:name (extract-keyword f "name")
:key (or (extract-keyword f "key")
(extract-keyword f "name"))
:group (extract-keyword f "group")
:desc (extract-keyword f "desc")}))
(defn parse-everything
[snippets-dir]
(into {}
(remove nil?)
(for [d (file-seq (io/file snippets-dir))]
(when (.isDirectory d)
{(.getName d) (parse-mode d)}))))
(defn store-to-edn
[snippets-dir output-file]
(spit output-file (parse-everything snippets-dir)))
(def header [:name :key :filename :group :desc])
(defn table
"Generate a table"
[header rows]
[:table.table.is-striped
[:thead (into [:tr.tr]
(for [h header]
[:td.td (name h)]))]
(into [:tbody.tbody]
(for [r rows]
(into [:tr.tr]
(for [h header]
[:td.td (r h)]))))])
(defn structure
[body]
[:html
[:head
[:link {:rel "stylesheet"
:href bulma-url
:crossorigin "anonymous"}]]
(into [:body] body)])
(defn gen-html
[snips-dir]
(let [all-modes (parse-everything snips-dir)
tables (for [[m snips] (sort all-modes)]
[:div.section
[:h2.subtitle m]
(table header snips)])]
(spit
"hello.html"
(hiccup/html
(structure tables)))))
(comment
(gen-html "../snippets"))

View File

@ -1,5 +1,5 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name : v.begin(), v.end() # name: v.begin(), v.end()
# key: beginend # key: beginend
# -- # --
${1:v}.begin(), $1.end ${1:v}.begin(), $1.end

View File

@ -1,4 +1,4 @@
#name : namespace ... # name: namespace ...
# key: ns # key: ns
# -- # --
namespace namespace

View File

@ -1,4 +1,4 @@
#name : using namespace ... # name: using namespace ...
# key: using # key: using
# -- # --
using namespace ${std}; using namespace ${std};

View File

@ -1,5 +1,5 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name : #include <...> # name: #include <...>
# key : incs # key : incs
# -- # --
#include <$1> #include <$1>

View File

@ -1,5 +1,5 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name : #include "..." # name: #include "..."
# key : incl # key : incl
# -- # --
#include "$1" #include "$1"

View File

@ -1,4 +1,4 @@
#name : #ifndef XXX; #define XXX; #endif # name: #ifndef XXX; #define XXX; #endif
# key: once # key: once
# -- # --
#ifndef ${1:`(upcase (file-name-nondirectory (file-name-sans-extension (or (buffer-file-name) ""))))`_H} #ifndef ${1:`(upcase (file-name-nondirectory (file-name-sans-extension (or (buffer-file-name) ""))))`_H}

View File

@ -1,5 +1,5 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name : case : {...} # name: case : {...}
# key: case # key: case
# expand-env: ((yas-also-auto-indent-first-line t)) # expand-env: ((yas-also-auto-indent-first-line t))
# -- # --

View File

@ -1,4 +1,4 @@
#name : do { ... } while (...) # name: do { ... } while (...)
# key: do # key: do
# -- # --
do do

View File

@ -1,5 +1,5 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name : else { ... } # name: else { ... }
# key: else # key: else
# -- # --
else${1: { else${1: {

View File

@ -1,8 +1,8 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
#cotributor: Henrique Jung <henriquenj@gmail.com> #cotributor: Henrique Jung <henriquenj@gmail.com>
#name: File description # name: File description
#key: \file # key: \file
#group: doxygen # group: doxygen
# -- # --
/** /**
* \file ${1:`(file-name-nondirectory(buffer-file-name))`} * \file ${1:`(file-name-nondirectory(buffer-file-name))`}

View File

@ -1,8 +1,8 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
#cotributor: Henrique Jung <henriquenj@gmail.com> #cotributor: Henrique Jung <henriquenj@gmail.com>
#name: Function description # name: Function description
#key: \brief # key: \brief
#group: doxygen # group: doxygen
# -- # --
/** /**
* \brief ${1:function description} * \brief ${1:function description}

View File

@ -1,5 +1,5 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name : if (...) { ... } # name: if (...) { ... }
# key: if # key: if
# -- # --
if (${1:condition}) ${2:{ if (${1:condition}) ${2:{

View File

@ -1,7 +1,7 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
#cotributor: Henrique Jung <henriquenj@gmail.com> #cotributor: Henrique Jung <henriquenj@gmail.com>
#name: Member description # name: Member description
#key: !< # key: !<
#group: doxygen # group: doxygen
# -- # --
/*!< ${1:Detailed description after the member} */ /*!< ${1:Detailed description after the member} */

View File

@ -1,4 +1,4 @@
#name : struct ... { ... } # name: struct ... { ... }
# key: struct # key: struct
# -- # --
struct ${1:name} struct ${1:name}

View File

@ -1,5 +1,5 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name : switch (...) { case : ... default: ...} # name: switch (...) { case : ... default: ...}
# key: switch # key: switch
# -- # --
switch (${1:expr}) { switch (${1:expr}) {

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : private attribute ....; # name: private attribute ....;
# key: attrib # key: attrib
# -- # --
/// <summary> /// <summary>

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : private attribute ....; public property ... ... { ... } # name: private attribute ....; public property ... ... { ... }
# key: attrib # key: attrib
# -- # --
/// <summary> /// <summary>
@ -19,4 +19,4 @@ public $1 $2
set { set {
this.$2 = value; this.$2 = value;
} }
} }

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : private _attribute ....; public Property ... ... { ... } # name: private _attribute ....; public Property ... ... { ... }
# key: attrib # key: attrib
# -- # --
/// <summary> /// <summary>
@ -19,4 +19,4 @@ public ${1:Type} ${2:Name}
set { set {
this.${2:$(if (> (length yas-text) 0) (format "_%s%s" (downcase (substring yas-text 0 1)) (substring yas-text 1 (length yas-text))) "")} = value; this.${2:$(if (> (length yas-text) 0) (format "_%s%s" (downcase (substring yas-text 0 1)) (substring yas-text 1 (length yas-text))) "")} = value;
} }
} }

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : class ... { ... } # name: class ... { ... }
# key: class # key: class
# -- # --
${5:public} class ${1:Name} ${5:public} class ${1:Name}

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : /// <summary> ... </summary> # name: /// <summary> ... </summary>
# key: comment # key: comment
# -- # --
/// <summary> /// <summary>

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : /// <param name="..."> ... </param> # name: /// <param name="..."> ... </param>
# key: comment # key: comment
# -- # --
/// <param name="$1">$2</param> /// <param name="$1">$2</param>

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : /// <param name="..."> ... </param> # name: /// <param name="..."> ... </param>
# key: comment # key: comment
# -- # --
/// <returns>$1</returns> /// <returns>$1</returns>

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : /// <exception cref="..."> ... </exception> # name: /// <exception cref="..."> ... </exception>
# key: comment # key: comment
# -- # --
/// <exception cref="$1">$2</exception> /// <exception cref="$1">$2</exception>

View File

@ -1,5 +1,5 @@
#contributor : Jostein Kjønigsen <jostein@kjonigsen.net> # contributor : Jostein Kjønigsen <jostein@kjonigsen.net>
#name : foreach { ... } # name: foreach { ... }
# key: fore # key: fore
# -- # --
foreach (${1:var} ${2:item} in ${3:list}) foreach (${1:var} ${2:item} in ${3:list})

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : public void Method { ... } # name: public void Method { ... }
# key: method # key: method
# -- # --
/// <summary> /// <summary>

View File

@ -1,8 +1,8 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : namespace .. { ... } # name: namespace .. { ... }
# key: namespace # key: namespace
# -- # --
namespace $1 namespace $1
{ {
$0 $0
} }

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : property ... ... { ... } # name: property ... ... { ... }
# key: prop # key: prop
# -- # --
/// <summary> /// <summary>

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : #region ... #endregion # name: #region ... #endregion
# key: region # key: region
# -- # --
#region $1 #region $1

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : using ...; # name: using ...;
# key: using # key: using
# -- # --
using $1; using $1;

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : using System; # name: using System;
# key: using # key: using
# -- # --
using System; using System;

View File

@ -1,5 +1,5 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> # contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : using System....; # name: using System....;
# key: using # key: using
# -- # --
using System.$1; using System.$1;

View File

@ -1,3 +1,3 @@
#name : background-color: ... # name: background-color: ...
# -- # --
background-color: #${1:DDD}; background-color: #${1:DDD};

View File

@ -1,3 +1,3 @@
#name : background-image: ... # name: background-image: ...
# -- # --
background-image: url($1); background-image: url($1);

View File

@ -1,3 +1,3 @@
#name : border size style color # name: border size style color
# -- # --
border: ${1:1px} ${2:solid} #${3:999}; border: ${1:1px} ${2:solid} #${3:999};

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : clear: ... # name: clear: ...
# -- # --
clear: $1; clear: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : display: block # name: display: block
# -- # --
display: block; display: block;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : display: inline # name: display: inline
# -- # --
display: inline; display: inline;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : display: none # name: display: none
# -- # --
display: none; display: none;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : font-family: ... # name: font-family: ...
# -- # --
font-family: $1; font-family: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : font-size: ... # name: font-size: ...
# -- # --
font-size: ${12px}; font-size: ${12px};

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : margin-bottom: ... # name: margin-bottom: ...
# -- # --
margin-bottom: $1; margin-bottom: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : margin-left: ... # name: margin-left: ...
# -- # --
margin-left: $1; margin-left: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : margin: ... # name: margin: ...
# -- # --
margin: $1; margin: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : margin top right bottom left # name: margin top right bottom left
# -- # --
margin: ${top} ${right} ${bottom} ${left}; margin: ${top} ${right} ${bottom} ${left};

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : margin-right: ... # name: margin-right: ...
# -- # --
margin-right: $1; margin-right: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : margin-top: ... # name: margin-top: ...
# -- # --
margin-top: $1; margin-top: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : padding-bottom: ... # name: padding-bottom: ...
# -- # --
padding-bottom: $1; padding-bottom: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : padding-left: ... # name: padding-left: ...
# -- # --
padding-left: $1; padding-left: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : padding: ... # name: padding: ...
# -- # --
padding: $1; padding: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : padding: top right bottom left # name: padding: top right bottom left
# -- # --
padding: ${top} ${right} ${bottom} ${left}; padding: ${top} ${right} ${bottom} ${left};

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : padding-right: ... # name: padding-right: ...
# -- # --
padding-right: $1; padding-right: $1;

View File

@ -1,4 +1,4 @@
#contributor : rejeep <johan.rejeep@gmail.com> # contributor : rejeep <johan.rejeep@gmail.com>
#name : padding-top: ... # name: padding-top: ...
# -- # --
padding-top: $1; padding-top: $1;

View File

@ -1,5 +1,5 @@
## -*- mode: snippet -*- ## -*- mode: snippet -*-
# name : after # name: after
# key: after # key: after
# -- # --
after ${1:500} -> after ${1:500} ->

View File

@ -1,5 +1,5 @@
## -*- mode: snippet -*- ## -*- mode: snippet -*-
# name : defmodule XXX end # name: defmodule XXX end
# key: dm # key: dm
# -- # --
defmodule ${1:`(concat (capitalize (file-name-nondirectory (directory-file-name (file-name-directory buffer-file-name)))) ".")`}${2:`(mapconcat 'capitalize (split-string (file-name-base) "_") "")`} do defmodule ${1:`(concat (capitalize (file-name-nondirectory (directory-file-name (file-name-directory buffer-file-name)))) ".")`}${2:`(mapconcat 'capitalize (split-string (file-name-base) "_") "")`} do

View File

@ -1,5 +1,5 @@
## -*- mode: snippet -*- ## -*- mode: snippet -*-
# name : function # name: function
# key: dfun # key: dfun
# -- # --
def $1($2)${3:$$(when (and yas-moving-away-p yas-modified-p) (concat " when " yas-text))} do def $1($2)${3:$$(when (and yas-moving-away-p yas-modified-p) (concat " when " yas-text))} do

View File

@ -1,5 +1,5 @@
## -*- mode: snippet -*- ## -*- mode: snippet -*-
# name : function-one-line # name: function-one-line
# key: df # key: df
# -- # --
def $1($2)${3:$$(when (and yas-moving-away-p yas-modified-p) (concat " when " yas-text))}, do: $0 def $1($2)${3:$$(when (and yas-moving-away-p yas-modified-p) (concat " when " yas-text))}, do: $0

View File

@ -1,5 +1,5 @@
## -*- mode: snippet -*- ## -*- mode: snippet -*-
# name : receive # name: receive
# key: rcv # key: rcv
# -- # --
receive do receive do

View File

@ -1,7 +1,7 @@
# -*- mode: snippet; -*- # -*- mode: snippet; -*-
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: add-hook # name: add-hook
#key: add-hook # key: add-hook
#key: ah # key: ah
# -- # --
(add-hook '${1:name}-hook ${2:'${3:function}})$0 (add-hook '${1:name}-hook ${2:'${3:function}})$0

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: and # name: and
#key: and # key: and
#key: a # key: a
# -- # --
(and $0) (and $0)

View File

@ -1,5 +1,5 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: aref # name: aref
#key: aref # key: aref
# -- # --
(aref ${1:array} {2:index}) (aref ${1:array} {2:index})

View File

@ -1,5 +1,5 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: aset # name: aset
#key: aset # key: aset
# -- # --
(aset ${1:array} ${2:index} ${3:element}) (aset ${1:array} ${2:index} ${3:element})

View File

@ -1,5 +1,5 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: assq # name: assq
#key: assq # key: assq
# -- # --
(assq ${1:key} ${2:list}) (assq ${1:key} ${2:list})

View File

@ -1,5 +1,5 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: autoload # name: autoload
#key: autoload # key: autoload
# -- # --
(autoload ${1:function} "${2:filename}"${3: "docstring"}${4: interactive}${5: type}) (autoload ${1:function} "${2:filename}"${3: "docstring"}${4: interactive}${5: type})

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: backward-char # name: backward-char
#key: backward-char # key: backward-char
#key: bc # key: bc
# -- # --
(backward-char $0) (backward-char $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: beginning-of-line # name: beginning-of-line
#key: beginning-of-line # key: beginning-of-line
#key: bol # key: bol
# -- # --
(beginning-of-line) (beginning-of-line)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: bounds-of-thing-at-point # name: bounds-of-thing-at-point
#key: bounds-of-thing-at-point # key: bounds-of-thing-at-point
#key: botap # key: botap
# -- # --
(bounds-of-thing-at-point $0) (bounds-of-thing-at-point $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: buffer-file-name # name: buffer-file-name
#key: buffer-file-name # key: buffer-file-name
#key: bfn # key: bfn
# -- # --
(buffer-file-name) (buffer-file-name)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: buffer-modified-p # name: buffer-modified-p
#key: buffer-modified-p # key: buffer-modified-p
#key: bmp # key: bmp
# -- # --
(buffer-modified-p $0) (buffer-modified-p $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: buffer-substring # name: buffer-substring
#key: buffer-substring # key: buffer-substring
#key: bs # key: bs
# -- # --
(buffer-substring ${1:start} ${2:end}) (buffer-substring ${1:start} ${2:end})

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: buffer-substring-no-properties # name: buffer-substring-no-properties
#key: buffer-substring-no-properties # key: buffer-substring-no-properties
#key: bsnp # key: bsnp
# -- # --
(buffer-substring-no-properties ${1:start} ${2:end}) (buffer-substring-no-properties ${1:start} ${2:end})

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: cond # name: cond
#key: cond # key: cond
# -- # --
(cond (cond
(${1:condition} ${2:body})$0) (${1:condition} ${2:body})$0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: condition-case # name: condition-case
#key: condition-case # key: condition-case
#key: cc # key: cc
# -- # --
(condition-case $0) (condition-case $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: copy-directory # name: copy-directory
#key: copy-directory # key: copy-directory
#key: cd # key: cd
# -- # --
(copy-directory ${1:directory} {2:target}${3: keep-time}${4: parents}) (copy-directory ${1:directory} {2:target}${3: keep-time}${4: parents})

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: copy-file # name: copy-file
#key: copy-file # key: copy-file
#key: cf # key: cf
# -- # --
(copy-file ${1:filename} ${2:newname}${3: ok-if-already-exists}${4: keep-time}{5: preserve-uid-gid}) (copy-file ${1:filename} ${2:newname}${3: ok-if-already-exists}${4: keep-time}{5: preserve-uid-gid})

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: current-buffer # name: current-buffer
#key: current-buffer # key: current-buffer
#key: cb # key: cb
# -- # --
(current-buffer) (current-buffer)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: custom-autoload # name: custom-autoload
#key: custom-autoload # key: custom-autoload
#key: ca # key: ca
# -- # --
(custom-autoload ${1:symbol} ${2:load}${3: noset}) (custom-autoload ${1:symbol} ${2:load}${3: noset})

View File

@ -1,5 +1,5 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: defalias # name: defalias
#key: defalias # key: defalias
# -- # --
(defalias '${1:symbol} '${2:alias}${3: "docstring"}) (defalias '${1:symbol} '${2:alias}${3: "docstring"})

View File

@ -1,5 +1,5 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: defcustom # name: defcustom
#key: defcustom # key: defcustom
# -- # --
(defcustom ${1:symbol} ${2:standard} "${3:docstring}"${4: args}) (defcustom ${1:symbol} ${2:standard} "${3:docstring}"${4: args})

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: define-key # name: define-key
#key: define-key # key: define-key
#key: dk # key: dk
# -- # --
(define-key ${1:mode}-map (kbd "${2:key}") $0) (define-key ${1:mode}-map (kbd "${2:key}") $0)

View File

@ -1,4 +1,4 @@
#name: defvar # name: defvar
#key: defvar # key: defvar
# -- # --
(defvar ${1:symbol} ${2:initvalue} "${3:docstring}") (defvar ${1:symbol} ${2:initvalue} "${3:docstring}")

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: delete-char # name: delete-char
#key: delete-char # key: delete-char
#key: dc # key: dc
# -- # --
(delete-char $0) (delete-char $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: delete-directory # name: delete-directory
#key: delete-directory # key: delete-directory
#key: dd # key: dd
# -- # --
(delete-directory ${1:dicretory}${2: recursive}) (delete-directory ${1:dicretory}${2: recursive})

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: delete-file # name: delete-file
#key: delete-file # key: delete-file
#key: df # key: df
# -- # --
(delete-file $0) (delete-file $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: delete-region # name: delete-region
#key: delete-region # key: delete-region
#key: dr # key: dr
# -- # --
(delete-region $0) (delete-region $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: directory-files # name: directory-files
#key: directory-files # key: directory-files
#key: df # key: df
# -- # --
(directory-files ${1:directory}${2: full}${3: match}${4: nosort}) (directory-files ${1:directory}${2: full}${3: match}${4: nosort})

View File

@ -1,5 +1,5 @@
#name : process marked files in dired # name: process marked files in dired
#contributor : Xah Lee # contributor : Xah Lee
# -- # --
;; idiom for processing a list of files in dired's marked files ;; idiom for processing a list of files in dired's marked files

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: end-of-line # name: end-of-line
#key: end-of-line # key: end-of-line
#key: eol # key: eol
# -- # --
(end-of-line) (end-of-line)

View File

@ -1,5 +1,5 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: error # name: error
#key: error # key: error
# -- # --
(error "${1:message}"${2: format-args}) (error "${1:message}"${2: format-args})

View File

@ -1,7 +1,7 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
#contributor: Raghav Kumar Gautam # contributor: Raghav Kumar Gautam
#name: ert-deftest # name: ert-deftest
#key: edt # key: edt
# -- # --
(ert-deftest ${1:test-name} () (ert-deftest ${1:test-name} ()
$0) $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: expand-file-name # name: expand-file-name
#key: expand-file-name # key: expand-file-name
#key: efn # key: efn
# -- # --
(expand-file-name $0) (expand-file-name $0)

View File

@ -1,5 +1,5 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: fboundp # name: fboundp
#key: fboundp # key: fboundp
# -- # --
(fboundp '$0) (fboundp '$0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: file-name-directory # name: file-name-directory
#key: file-name-directory # key: file-name-directory
#key: fnd # key: fnd
# -- # --
(file-name-directory $0) (file-name-directory $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: file-name-extension # name: file-name-extension
#key: file-name-extension # key: file-name-extension
#key: fne # key: fne
# -- # --
(file-name-extension ${1:filename}${2: period}) (file-name-extension ${1:filename}${2: period})

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: file-name-nondirectory # name: file-name-nondirectory
#key: file-name-nondirectory # key: file-name-nondirectory
#key: fnn # key: fnn
# -- # --
(file-name-nondirectory $0) (file-name-nondirectory $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: file-name-sans-extension # name: file-name-sans-extension
#key: file-name-sans-extension # key: file-name-sans-extension
#key: fnse # key: fnse
# -- # --
(file-name-sans-extension $0) (file-name-sans-extension $0)

View File

@ -1,6 +1,6 @@
#contributor: Xah Lee (XahLee.org) # contributor: Xah Lee (XahLee.org)
#name: file-relative-name # name: file-relative-name
#key: file-relative-name # key: file-relative-name
#key: frn # key: frn
# -- # --
(file-relative-name $0) (file-relative-name $0)

View File

@ -1,5 +1,5 @@
#name : a function that process a file # name: a function that process a file
#contributor : Xah Lee # contributor : Xah Lee
# -- # --
(defun doThisFile (fpath) (defun doThisFile (fpath)
"Process the file at path FPATH ..." "Process the file at path FPATH ..."

View File

@ -1,5 +1,5 @@
#name : read lines of a file # name: read lines of a file
#contributor : Xah Lee # contributor : Xah Lee
# -- # --
(defun read-lines (filePath) (defun read-lines (filePath)
"Return a list of lines in FILEPATH." "Return a list of lines in FILEPATH."

Some files were not shown because too many files have changed in this diff Show More