1
0
Fork 0

feat(emacs): add concrete grade-prev interactive function

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
Lucas Sta Maria 2024-02-02 17:34:09 -05:00
parent 405b26b256
commit dc4bcb4d5f
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47

View file

@ -222,11 +222,17 @@
(find-file target-filepath) (find-file target-filepath)
(message (format "next grading file doesn't exist!"))))))) (message (format "next grading file doesn't exist!")))))))
(defun grade-prev (&optional dec)
"Go to the previous homework by DEC to grade."
(interactive)
(let ((dec (or dec 1)))
(grade-next (- dec))))
(defun grade-start (&optional start) (defun grade-start (&optional start)
"Start grading in the current directory with homework START." "Start grading in the current directory with homework START."
(interactive) (interactive)
(keymap-global-set "C-c f" #'grade-next) (keymap-global-set "C-c f" #'grade-next)
(keymap-global-set "C-c b" (lambda () (interactive) (grade-next -1))) (keymap-global-set "C-c b" #'grade-prev)
(let* ((start (or start 1)) (let* ((start (or start 1))
(dir (if (eq major-mode 'dired-mode) (dir (if (eq major-mode 'dired-mode)