Skip to content

Instantly share code, notes, and snippets.

@wang-zhijun
Last active July 11, 2016 12:26
Show Gist options
  • Select an option

  • Save wang-zhijun/cc63ca2bc5555809e39fda8e750a24e1 to your computer and use it in GitHub Desktop.

Select an option

Save wang-zhijun/cc63ca2bc5555809e39fda8e750a24e1 to your computer and use it in GitHub Desktop.
Emacs Lisp Snippet

my-hello-emacs関数を定義して,呼び出す

(defun my-hello-emacs()
  (message "hello emacs"))
(my-hello-emacs) ; my-hello-emacs関数を呼び出す

文字列FOOを変数fooに代入.'quote関数の略称

(setq foo "FOO")
(set 'foo "FOO") ; setq使わない方法
(set (quote foo) "FOO")

Common Lispのtype

(type-of '[1 3 4]) ; vector
(type-of '(1 2 3)) ; cons
(type-of 'foo) ; symbol
(type-of ?a) ; integer

入力を求める

(read-from-minibuffer "Enter your name: ")

文字列をフォーマット

(format "Hello %s!\n" "visitor")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment