From 753b2b8d34480ae39ce803b28aecb52d7c5ff99c Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 14 Dec 2010 23:21:23 +0100 Subject: Debugging aids A couple functions to manage logs, and a fix to the definition of geiser-messages-mode: do not ever kill all local variables in a derived mode definition! --- elisp/geiser-log.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'elisp') diff --git a/elisp/geiser-log.el b/elisp/geiser-log.el index 49b067d..aa1b477 100644 --- a/elisp/geiser-log.el +++ b/elisp/geiser-log.el @@ -42,7 +42,6 @@ (define-derived-mode geiser-messages-mode fundamental-mode "Geiser Messages" "Simple mode for Geiser log messages buffer." - (kill-all-local-variables) (buffer-disable-undo) (add-hook 'after-change-functions '(lambda (b e len) @@ -90,6 +89,21 @@ With prefix, activates all logging levels." (interactive) (geiser-log--with-buffer (delete-region (point-min) (point-max)))) +(defun geiser-log-toggle-verbose () + "Toggle verbose logs" + (interactive) + (setq geiser-log-verbose-p (not geiser-log-verbose-p)) + (message "Geiser verbose logs %s" + (if geiser-log-verbose-p "enabled" "disabled"))) + +(defun geiser-log--deactivate () + (interactive) + (setq geiser-log-verbose-p nil) + (when (eq (current-buffer) (geiser-log--buffer)) (View-quit))) + +(define-key geiser-messages-mode-map "c" 'geiser-log-clear) +(define-key geiser-messages-mode-map "Q" 'geiser-log--deactivate) + (provide 'geiser-log) ;;; geiser-log.el ends here -- cgit v1.2.3