summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2020-12-14 15:04:38 -0500
committerYoni Rabkin <yoni@rabkins.net>2020-12-14 15:04:38 -0500
commitfd1e4a9e61445706d700ee67dd92a8b77911526e (patch)
treed9d35d49402c04022685e34929464437fc1dec86
parentd567c5942a06fa2604d065101c990d3743bf5f13 (diff)
* rt-liberation.el: add jump to last section
-rw-r--r--rt-liberation.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/rt-liberation.el b/rt-liberation.el
index d708f43..1117889 100644
--- a/rt-liberation.el
+++ b/rt-liberation.el
@@ -1535,6 +1535,17 @@ ASSOC-BROWSER if non-nil should be a ticket browser."
(recenter rt-liber-viewer2-recenter)))
(goto-char (point-at-bol))))
+(defun rt-liber-viewer2-last-section-in ()
+ (interactive)
+ (goto-char (point-max))
+ (let ((last (re-search-backward rt-liber-viewer2-section-regexp
+ (point-min)
+ t)))
+ (if (not last)
+ (error "no sections found")
+ (recenter rt-liber-viewer2-recenter)
+ (goto-char (point-at-bol)))))
+
(defun rt-liber-viewer2-previous-section-in ()
(interactive)
(when (looking-at rt-liber-viewer2-section-regexp)
@@ -1575,6 +1586,7 @@ ASSOC-BROWSER if non-nil should be a ticket browser."
(defconst rt-liber-viewer2-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "q") 'rt-liber-viewer2-mode-quit)
+ (define-key map (kbd "N") 'rt-liber-viewer2-last-section-in)
(define-key map (kbd "n") 'rt-liber-viewer2-next-section-in)
(define-key map (kbd "p") 'rt-liber-viewer2-previous-section-in)
(define-key map (kbd "V") 'rt-liber-viewer-visit-in-browser)