diff options
author | Yoni Rabkin <yoni@rabkins.net> | 2021-02-17 11:07:37 -0500 |
---|---|---|
committer | Yoni Rabkin <yoni@rabkins.net> | 2021-02-17 11:07:37 -0500 |
commit | 2bbaa7641fbafdc07bea5d965d75cc2d2f831235 (patch) | |
tree | 2f5f85cc887a5a43a6a8ace7e9fd0d66487f98b5 /rt-liberation.el | |
parent | f77c1e495a44272c7936f958e6af631a42295dd1 (diff) |
* rt-liberation.el: last communcation instead of section
Make "N" jump to the last Comment, Create, or Correspond section,
instead of just the last section.
Diffstat (limited to 'rt-liberation.el')
-rw-r--r-- | rt-liberation.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rt-liberation.el b/rt-liberation.el index 913bbeb..4ea72d1 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -246,6 +246,9 @@ This variable is made buffer local for the ticket history") (defvar rt-liber-viewer2-section-regexp "^Ticket [0-9]+ by " "Regular expression to match a section in the viewer.") +(defvar rt-liber-viewer2-communicate-regexp (regexp-opt '("[Create]" "[Correspond]" "[Comment]")) + "Regular expression to match ticket communication.") + (defvar rt-liber-viewer2-recenter 4 "Argument passed to `recenter' in the viewer.") @@ -1535,14 +1538,14 @@ 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 () +(defun rt-liber-viewer2-last-communicate-in () (interactive) (goto-char (point-max)) - (let ((last (re-search-backward rt-liber-viewer2-section-regexp + (let ((last (re-search-backward rt-liber-viewer2-communicate-regexp (point-min) t))) (if (not last) - (error "no sections found") + (error "no communcations found") (recenter rt-liber-viewer2-recenter) (goto-char (point-at-bol))))) @@ -1586,7 +1589,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-last-communicate-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) |