mirror of
https://github.com/joaotavora/yasnippet.git
synced 2026-05-05 15:28:18 +00:00
added about 10 elisp keywords. work in progress to add more.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
TITLE: Emacs Idiom Template Set. Version 1. 2009-02-22
|
||||
TITLE: Emacs Idiom Template Set.
|
||||
|
||||
Version 1.1. 2010-08-05
|
||||
Version 1. 2009-02-22
|
||||
|
||||
DESCRIPTION: Some useful templates for emacs lisp. This template set is based on useful elisp idioms on common tasks.
|
||||
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: and
|
||||
# --
|
||||
(and $0)
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: autoload
|
||||
# --
|
||||
(autoload 'FUNCNAME$0 "FILENAME" & "DOCSTRING" INTERACTIVE TYPE)
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: car
|
||||
# --
|
||||
(car $0)
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: define-key
|
||||
# --
|
||||
(define-key KEYMAPNAME$0 (kbd "M-b") 'FUNCNAME)
|
||||
Regular → Executable
+4
-5
@@ -1,11 +1,10 @@
|
||||
#name : function template
|
||||
#contributor : Xah Lee
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: defun
|
||||
# --
|
||||
(defun $1 ()
|
||||
"thisandthat."
|
||||
"DOCSTRING"
|
||||
(interactive)
|
||||
(let (var1)
|
||||
(setq var1 some)
|
||||
$0
|
||||
)
|
||||
)
|
||||
))
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: defvar
|
||||
# --
|
||||
(defvar SYMBOL & INITVALUE "DOCSTRING")
|
||||
@@ -1,4 +0,0 @@
|
||||
#name : grab word under cursor
|
||||
#contributor : Xah Lee
|
||||
# --
|
||||
(setq $0 (thing-at-point 'symbol))
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: if
|
||||
# --
|
||||
(if $0)
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: let
|
||||
# --
|
||||
(let ($1 )
|
||||
$0
|
||||
)
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: not
|
||||
# --
|
||||
(not $0 )
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: or
|
||||
# --
|
||||
(or $0 )
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: '(...)
|
||||
#key: '
|
||||
# --
|
||||
'($0 )
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: setq
|
||||
# --
|
||||
(setq $0 )
|
||||
Regular → Executable
+2
-2
@@ -1,5 +1,5 @@
|
||||
#name : process marked files in dired
|
||||
#contributor : Xah Lee
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: process marked files in dired
|
||||
# --
|
||||
;; idiom for processing a list of files in dired's marked files
|
||||
|
||||
Regular → Executable
+2
-2
@@ -1,5 +1,5 @@
|
||||
#name : a function that process a file
|
||||
#contributor : Xah Lee
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: a function that process a file
|
||||
# --
|
||||
(defun doThisFile (fpath)
|
||||
"Process the file at path FPATH ..."
|
||||
Regular → Executable
+2
-2
@@ -1,5 +1,5 @@
|
||||
#name : read lines of a file
|
||||
#contributor : Xah Lee
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: read lines of a file
|
||||
# --
|
||||
(defun read-lines (filePath)
|
||||
"Return a list of lines in FILEPATH."
|
||||
Regular → Executable
+2
-2
@@ -1,5 +1,5 @@
|
||||
#name : find and replace on region
|
||||
#contributor : Xah Lee
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: find and replace on region
|
||||
# --
|
||||
(defun replace-html-chars-region (start end)
|
||||
"Replace “<” to “<” and other chars in HTML.
|
||||
Regular → Executable
+2
-2
@@ -1,4 +1,4 @@
|
||||
#name : grab buffer substring
|
||||
#contributor : Xah Lee
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: grab buffer substring
|
||||
# --
|
||||
(setq $0 (buffer-substring-no-properties myStartPos myEndPos))
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: grab word under cursor
|
||||
# --
|
||||
(setq $0 (thing-at-point 'symbol))
|
||||
Regular → Executable
+2
-2
@@ -1,5 +1,5 @@
|
||||
#name : traversing a directory
|
||||
#contributor : Xah Lee
|
||||
#name: traversing a directory
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
# --
|
||||
;; apply a function to all files in a dir
|
||||
(require 'find-lisp)
|
||||
Regular → Executable
+2
-2
@@ -1,5 +1,5 @@
|
||||
#name : Command that works on region or word
|
||||
#contributor : Xah Lee
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: Command that works on region or word
|
||||
# --
|
||||
;; example of a command that works on current word or text selection
|
||||
(defun down-case-word-or-region ()
|
||||
Reference in New Issue
Block a user