summaryrefslogtreecommitdiff
path: root/modules/system-lib.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system-lib.el')
-rw-r--r--modules/system-lib.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/system-lib.el b/modules/system-lib.el
index 8bbf8474..4c2f17ef 100644
--- a/modules/system-lib.el
+++ b/modules/system-lib.el
@@ -6,6 +6,7 @@
;;
;; Functions include:
;; - Checking if external programs are available in PATH
+;; - Silent logging to *Messages* buffer
;;
;;; Code:
@@ -16,5 +17,15 @@ PROGRAM should be a string naming an executable program."
(not (string-empty-p program))
(executable-find program)))
+(defun cj/log-silently (format-string &rest args)
+ "Append formatted message (FORMAT-STRING with ARGS) to *Messages* buffer.
+This does so without echoing in the minibuffer."
+ (let ((inhibit-read-only t))
+ (with-current-buffer (get-buffer-create "*Messages*")
+ (goto-char (point-max))
+ (unless (bolp) (insert "\n"))
+ (insert (apply #'format format-string args))
+ (unless (bolp) (insert "\n")))))
+
(provide 'system-lib)
;;; system-lib.el ends here