skelrc: Add a debugging utility.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 15 Sep 2017 08:54:43 +0000 (09:54 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 15 Sep 2017 08:54:43 +0000 (09:54 +0100)
skelrc

diff --git a/skelrc b/skelrc
index 045075b..ef8c93b 100644 (file)
--- a/skelrc
+++ b/skelrc
@@ -1,5 +1,13 @@
 ;;; -*-emacs-lisp-*-
 
+(defun skelrc-dribble (msg &rest args)
+  "Write MSG (a `format'-style string, with ARGS) to the debug buffer."
+  (let ((buffer (get-buffer "*skel-debug*")))
+    (and buffer
+        (with-current-buffer buffer
+          (goto-char (point-max))
+          (insert (apply #'format msg args) "\n")))))
+
 (defun skelrc-strip-trailing-whitespace (string)
   "Return STRING, but with trailing whitespace removed.