Skip to content

Instantly share code, notes, and snippets.

@danhodge
Created September 14, 2018 17:13
Show Gist options
  • Select an option

  • Save danhodge/8e728253cd72eccbda0fa927d765809a to your computer and use it in GitHub Desktop.

Select an option

Save danhodge/8e728253cd72eccbda0fa927d765809a to your computer and use it in GitHub Desktop.
Emacs LISP Scratchpad
; Trying to figure out how namespaced elisp functions work: https://www.greghendershott.com/2017/02/emacs-themes.html
(defun dh/foo (x)
"adds 4 to x"
(+ x 4))
(dh/foo 1)
(defun dh/bar (x, fn)
"adds 5 to fn(x)"
(+ 5 (fn x)))
(dh/bar 7 #'dh/foo)
; Trying to figure out how to pass functions in elisp
(defun plus1 (x) (+ 1 x))
(defun callfn (fn, x) (fn x))
(callfn (lambda() plus1) 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment