From 4eb3b11cc0157d301e6a97f8d3504ca6a17b5788 Mon Sep 17 00:00:00 2001 From: "modula t. worm" Date: Mon, 27 Nov 2017 22:10:56 -0600 Subject: [PATCH] add sauron-mark-event-handled function. --- sauron.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sauron.el b/sauron.el index 02d8515..2972a27 100644 --- a/sauron.el +++ b/sauron.el @@ -208,6 +208,7 @@ PROPS is a backend-specific plist.") (define-key map "n" 'next-line) (define-key map "p" 'previous-line) (define-key map "q" 'bury-buffer) + (define-key map "r" 'sauron-mark-event-handled) map) "Keymap for the sauron buffer.") (fset 'sauron-mode-map sauron-mode-map) @@ -488,19 +489,27 @@ clicked line before calling sauron-activate-event." (beginning-of-line) (sauron-activate-event))) -(defun sauron-activate-event () - "Activate the callback for the current sauron line, and remove -any special faces from the line." +(defun sauron-mark-event-handled () + "Mark the current sauron line as handled." (interactive) (unless (eq major-mode 'sauron-mode) (error "Not in sauron mode")) - (let* ((callback (get-text-property (point) 'callback)) - (inhibit-read-only t)) + (let ((inhibit-read-only t)) ;; handled face (by default) does a strike-through of the events (put-text-property (line-beginning-position) (line-end-position) 'face 'sauron-event-handled-face) (put-text-property (line-beginning-position) (line-end-position) - 'status 'handled) + 'status 'handled)) + (next-line)) + +(defun sauron-activate-event () + "Activate the callback for the current sauron line, and remove +any special faces from the line." + (interactive) + (unless (eq major-mode 'sauron-mode) + (error "Not in sauron mode")) + (let ((callback (get-text-property (point) 'callback))) + (sauron-mark-event-handled) (if callback (funcall callback) (message "No callback defined for this line."))))