From ee24d693951dfb6bc6683930c63b1eecfc4b628e Mon Sep 17 00:00:00 2001 From: Lockywolf Date: Wed, 28 Aug 2019 18:09:12 +0800 Subject: Add a custom variable to scroll *geiser messages*. --- elisp/geiser-log.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/elisp/geiser-log.el b/elisp/geiser-log.el index 1828cb8..a252144 100644 --- a/elisp/geiser-log.el +++ b/elisp/geiser-log.el @@ -22,6 +22,11 @@ ;;; Customization: +(geiser-custom--defcustom geiser-log-autoscroll-buffer-p nil + "Set this so than the buffer *geiser messages* always shows the last message" + :group 'geiser + :type 'boolean) + (defvar geiser-log--buffer-name "*geiser messages*" "Name of the Geiser log buffer.") @@ -49,6 +54,12 @@ (when (> b geiser-log--max-buffer-size) (delete-region (point-min) b)))) nil t) + (add-hook 'after-change-functions + '(lambda (b e len) + (when geiser-log-autoscroll-buffer-p + (let ((my-window (get-buffer-window (geiser-log--buffer) t))) + (set-window-point my-window (point))))) + nil t) (setq buffer-read-only t)) (geiser-popup--define log geiser-log--buffer-name geiser-messages-mode) -- cgit v1.2.3