2022-02-20 15:26:48 +01:00
|
|
|
fundamental-mode ;; Available everywhere
|
|
|
|
|
|
|
|
(today (format-time-string "%Y-%m-%d"))
|
2022-07-31 11:03:59 +02:00
|
|
|
(heredoc "<<EOF\n" p "EOF\n")
|
2022-02-20 15:26:48 +01:00
|
|
|
|
|
|
|
prog-mode
|
|
|
|
|
|
|
|
(fixme (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "FIXME ")
|
|
|
|
(todo (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "TODO ")
|
|
|
|
(bug (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "BUG ")
|
|
|
|
(hack (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "HACK ")
|
|
|
|
|
|
|
|
latex-mode
|
|
|
|
|
|
|
|
(begin "\\begin{" (s env) "}" > n> r> "\\end{" (s env) "}")
|
|
|
|
(frac "\\frac{" p "}{" p "}")
|
|
|
|
(enumerate "\\begin{enumerate}\n\\item " r> n> "\\end{enumerate}")
|
|
|
|
(itemize "\\begin{itemize}\n\\item " r> n> "\\end{itemize}")
|
|
|
|
|
|
|
|
lisp-mode emacs-lisp-mode ;; Specify multiple modes
|
|
|
|
|
|
|
|
(lambda "(lambda (" p ")" n> r> ")")
|
|
|
|
|
|
|
|
emacs-lisp-mode
|
|
|
|
|
|
|
|
(lambda "(lambda (" p ")" n> r> ")")
|
|
|
|
(var "(defvar " p "\n \"" p "\")")
|
|
|
|
(const "(defconst " p "\n \"" p "\")")
|
|
|
|
(custom "(defcustom " p "\n \"" p "\"" n> ":type '" p ")")
|
|
|
|
(face "(defface " p " '((t :inherit " p "))\n \"" p "\")")
|
|
|
|
(group "(defgroup " p " nil\n \"" p "\"" n> ":group '" p n> ":prefix \"" p "-\")")
|
|
|
|
(macro "(defmacro " p " (" p ")\n \"" p "\"" n> r> ")")
|
|
|
|
(fun "(defun " p " (" p ")\n \"" p "\"" n> r> ")")
|
|
|
|
(let "(let (" p ")" n> r> ")")
|
|
|
|
(star "(let* (" p ")" n> r> ")")
|
|
|
|
(rec "(letrec (" p ")" n> r> ")")
|
|
|
|
(command "(defun " p " (" p ")\n \"" p "\"" n> "(interactive)" n> r> ")")
|
|
|
|
|
|
|
|
text-mode
|
|
|
|
|
|
|
|
(cut "--8<---------------cut here---------------start------------->8---" n r n
|
|
|
|
"--8<---------------cut here---------------end--------------->8---" n)
|
|
|
|
(asciibox "+-" (make-string (length str) ?-) "-+" n
|
|
|
|
"| " (s str) " |" n
|
|
|
|
"+-" (make-string (length str) ?-) "-+" n)
|
|
|
|
(rot13 (p "plain text" text) n "----" n (rot13 text))
|
|
|
|
(calc (p "taylor(sin(x),x=0,3)" formula) n "----" n (format "%s" (calc-eval formula)))
|
|
|
|
|
|
|
|
rst-mode
|
|
|
|
|
|
|
|
(title (make-string (length title) ?=) n (p "Title: " title) n (make-string (length title) ?=) n)
|
|
|
|
|
|
|
|
java-mode
|
|
|
|
|
|
|
|
(class "public class " (p (file-name-base (or (buffer-file-name) (buffer-name)))) " {" n> r> n "}")
|
|
|
|
|
|
|
|
c-mode :condition (re-search-backward "^\\w*$" (line-beginning-position) 'noerror)
|
|
|
|
|
|
|
|
(inc "#include <" (p (concat (file-name-base (or (buffer-file-name) (buffer-name))) ".h")) ">")
|
|
|
|
(incc "#include \"" (p (concat (file-name-base (or (buffer-file-name) (buffer-name))) ".h")) "\"")
|
|
|
|
|
|
|
|
org-mode
|
|
|
|
|
2022-10-09 16:30:31 +02:00
|
|
|
(title "#+title: " p n "#+author: Richard Brežák" n "#+language: en" n n)
|
|
|
|
(quote "#+begin_quote" n> r> n> "#+end_quote" n)
|
|
|
|
(example "#+begin_example" n> r> n> "#+end_example" n)
|
|
|
|
(center "#+begin_center" n> r> n> "#+end_center" n)
|
|
|
|
(comment "#+begin_comment" n> r> n> "#+end_comment" n)
|
|
|
|
(verse "#+begin_verse" n> r> n> "#+end_verse" n)
|
|
|
|
(src "#+begin_src " p n> r> n> "#+end_src" n
|
|
|
|
:post (org-edit-src-code))
|
2022-10-27 13:24:10 +02:00
|
|
|
(export "#+begin_export " p n> r> n> "#+end_export" n
|
|
|
|
:post (org-edit-special))
|
2022-10-09 16:30:31 +02:00
|
|
|
(elisp "#+begin_src emacs-lisp" n> r> n "#+end_src" n
|
2022-08-30 10:57:25 +02:00
|
|
|
:post (progn (org-edit-src-code)))
|
2022-10-09 16:30:31 +02:00
|
|
|
(abs "\\begin{abstract}" n> r> n> "\\end{abstract}" n)
|
|
|
|
(align "\\begin{align}" n> r> n> "\\end{align}" n)
|
|
|
|
(align* "\\begin{align*}" n> r> n> "\\end{align*}" n)
|
|
|
|
(arr "\\begin{array}" n> r> n> "\\end{array}" begin)
|
|
|
|
(begin "\\begin{" (p "environment" env) "}" n p n "\\end{" (s env) "}" n)
|
|
|
|
(bib "\\bibliographystyle{plain}" n "\\bibliography{" s "}" n)
|
|
|
|
(dm "\\[" n p n "\\]" n)
|
|
|
|
(item "\\begin{itemize}" n p n "\\end{itemize}" n)
|
|
|
|
(it "\\item " r)
|
|
|
|
(itd "\\item[" (p "label") "] " r)
|
|
|
|
(fig "\\begin{figure}[htbp]" n "\\centering" n p n "\\caption{" p "}" n "\\label{" p "}" n "\\end{figure}" n)
|
|
|
|
(minipage "\\begin{minipage}[" (p "htbp") "]{" (p "1.0") (p "\\linewidth") "}" n> r> n "\\end{minipage}" n)
|
|
|
|
(frame "\\begin{frame}{" (p "Frame Title") "}" n> r> n "\\end{frame}" n)
|
|
|
|
(package "#+LATEX_HEADER: \\usepackage[" p "]{" p "}" n)
|
|
|
|
(ref "\\ref{" p "}")
|
2022-11-10 22:39:14 +01:00
|
|
|
(table "\\begin{tabular}{" p "}\n\n\\end{tabular}\n"
|
|
|
|
:post (progn (previous-line 2) (org-edit-special)))
|
2022-10-09 16:30:31 +02:00
|
|
|
|
2022-11-10 22:39:14 +01:00
|
|
|
org-mode :condition (org-inside-LaTeX-fragment-p)
|
2022-10-09 16:30:31 +02:00
|
|
|
|
|
|
|
(// "\\frac{" p "}{" p "}")
|
|
|
|
(larrow "\\leftarrow")
|
|
|
|
(rarrow "\\rightarrow")
|
2022-02-20 15:26:48 +01:00
|
|
|
|
|
|
|
haskell-mode
|
|
|
|
|
|
|
|
(case
|
|
|
|
"case " (p "x") " of " n>
|
|
|
|
(p "Data") " -> " (p "undefined") n>
|
|
|
|
(p "Data") " -> " (p "undefined"))
|
|
|
|
({-} "{- " p " -}")
|
|
|
|
(=> (p "Class") " " (p "m") " => ")
|
|
|
|
(idata "data " (p "Type" ndata) " = " (s ndata) " " (p "Int") n>
|
|
|
|
"deriving (" (p "Show, Eq") ")")
|
|
|
|
(newtype "newtype " (p "Type" ndata) " = " (s ndata) " " (p "Int") n>
|
|
|
|
"deriving (" (p "Show, Eq") ")")
|
|
|
|
(data "data " (p "Type" ndata) " = " (s ndata) n>
|
|
|
|
"{ " (p "field") " :: " (p "Type") n>
|
|
|
|
", " (p "field") " :: " (p "Type") (p (ignore (setq tempel-retpoint (point)) ) retpoint t) n>
|
|
|
|
"}" n>
|
|
|
|
"deriving (" (p "Show, Eq") ")")
|
|
|
|
(fn (p "f" fname) " :: " (p "a") " -> " (p "b") n
|
|
|
|
(s fname) " " (p "x") " = " (p "undefined"))
|
|
|
|
(fnc (p "f" fname) " :: " (p "a") " -> " (p "b") n
|
|
|
|
(s fname) " " (p "pattern") " = " (p "undefined") n
|
|
|
|
(s fname) " " (p "pattern") " = " (p "undefined"))
|
|
|
|
; guarded fn
|
|
|
|
(<- (p "x") " <- " (p "undefined"))
|