Skip to content

Instantly share code, notes, and snippets.

View sabof's full-sized avatar

Evgkeni Sampelnikof sabof

  • London, United Kingdom
View GitHub Profile
@sabof
sabof / javascript-imenu.el
Last active December 13, 2015 16:39
javascript function lookup
(defun es-js-imenu-create-index ()
"Return an imenu index for the current buffer."
(save-excursion
(save-restriction
(let (unique-names result name pos)
(widen)
(goto-char (point-min))
(while (re-search-forward
(concat "\\(\\_<.+?\\_>\\) = function"
"\\|"
@sabof
sabof / gist:4483784
Last active December 10, 2015 19:48
The code that generates the es-lib markdown documentation. Copy-pasted as it was - might need some tweaking to make it work for you
(defun* buffer-defuns (&optional (buffer (current-buffer)))
(with-current-buffer buffer
(save-excursion
(goto-char (point-min))
(let (names)
(while (re-search-forward "^(defun[*]? \\(\\_<.+?\\_>\\)" nil t)
(push (intern (match-string-no-properties 1)) names))
names))))
(defun* buffer-macros (&optional (buffer (current-buffer)))