Functions to re-evaluate buffer/library with re-assigning `defvar` values.
--- a/.emacs-my Sat Aug 13 18:35:26 2016 +0300
+++ b/.emacs-my Thu Aug 25 20:30:31 2016 +0300
@@ -81,6 +81,28 @@
(setq debug-on-event lvl2)
(setq debug-on-signal lvl2)))
+(defun my/eval-buffer ()
+ "Evaluate entire buffer with re-assigning values to `defvar' / `defcustom'.
+Useful during package development."
+ (interactive)
+ (save-excursion
+ (beginning-of-buffer)
+ (while (not (eobp))
+ (eval-defun nil)
+ (end-of-defun))))
+
+(defun my/load-library (library)
+ "Evaluate entire library with re-assigning values to `defvar' / `defcustom'.
+Useful during package development."
+ (interactive
+ (list (completing-read "Load library: "
+ (apply-partially 'locate-file-completion-table
+ load-path
+ '("" ".el")))))
+ (with-temp-buffer
+ (insert-file-contents (locate-file library load-path '("" ".el")))
+ (my/eval-buffer)))
+
(my-debug nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;