[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/rt-liberation d567c59 60/68: * rt-liberation.el: fix n/
From: |
Yoni Rabkin |
Subject: |
[elpa] externals/rt-liberation d567c59 60/68: * rt-liberation.el: fix n/p in viewer2 |
Date: |
Wed, 16 Dec 2020 12:11:16 -0500 (EST) |
branch: externals/rt-liberation
commit d567c5942a06fa2604d065101c990d3743bf5f13
Author: Yoni Rabkin <yoni@rabkins.net>
Commit: Yoni Rabkin <yoni@rabkins.net>
* rt-liberation.el: fix n/p in viewer2
Not the best solution, but one that reliably works.
---
rt-liberation.el | 39 +++++++++++++++++++++++----------------
1 file changed, 23 insertions(+), 16 deletions(-)
diff --git a/rt-liberation.el b/rt-liberation.el
index 3c2962f..d708f43 100644
--- a/rt-liberation.el
+++ b/rt-liberation.el
@@ -243,6 +243,9 @@ This variable is made buffer local for the ticket history")
(defvar rt-liber-display-ticket-at-point-f
'rt-liber-viewer2-display-ticket-at-point
"Function for displaying ticket at point in the browser.")
+(defvar rt-liber-viewer2-section-regexp "^Ticket [0-9]+ by "
+ "Regular expression to match a section in the viewer.")
+
(defvar rt-liber-viewer2-recenter 4
"Argument passed to `recenter' in the viewer.")
@@ -1521,25 +1524,29 @@ ASSOC-BROWSER if non-nil should be a ticket browser."
(defun rt-liber-viewer2-next-section-in ()
(interactive)
- (forward-line)
- (let ((next (next-single-property-change
- (point)
- 'rt-liberation-viewer-header)))
- (if (not next)
- (message "no next section")
- (goto-char next)
- (recenter rt-liber-viewer2-recenter))))
+ (when (looking-at rt-liber-viewer2-section-regexp)
+ (goto-char (1+ (point))))
+ (let ((next (re-search-forward rt-liber-viewer2-section-regexp
+ (point-max)
+ t)))
+ (cond ((not next)
+ (message "no next section"))
+ (t
+ (recenter rt-liber-viewer2-recenter)))
+ (goto-char (point-at-bol))))
(defun rt-liber-viewer2-previous-section-in ()
(interactive)
- (let ((prev (previous-single-property-change
- (point-at-bol)
- 'rt-liberation-viewer-header)))
- (if (not prev)
- (message "no previous section")
- (goto-char prev)
- (forward-line -1)
- (recenter rt-liber-viewer2-recenter))))
+ (when (looking-at rt-liber-viewer2-section-regexp)
+ (goto-char (1- (point))))
+ (let ((prev (re-search-backward rt-liber-viewer2-section-regexp
+ (point-min)
+ t)))
+ (cond ((not prev)
+ (message "no previous section"))
+ (t
+ (recenter rt-liber-viewer2-recenter)))
+ (goto-char (point-at-bol))))
(defun rt-liber-viewer2-answer ()
(interactive)
- [elpa] externals/rt-liberation d6441dc 03/68: * rt-liberation-report.el: fix error, (continued)
- [elpa] externals/rt-liberation d6441dc 03/68: * rt-liberation-report.el: fix error, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 05176e8 13/68: * rt-liberation.el: version bump, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 0be03c5 12/68: * doc/gpl.texi: fix compilation warning, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 7269205 07/68: * rt-liberation.el: remove cl and cl-lib requirement, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 45275d3 36/68: splitting aside code for viewer2, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 3b95e84 40/68: * rt-liberation.el: reformatting, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation f529257 52/68: * rt-liberation.el: section display, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 35f4cd5 66/68: * doc/developer-release.txt:, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 50eba43 62/68: * rt-liberation-rest.el: formatting, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation b1a1dc6 56/68: * rt-liberation.el: prep for mail, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation d567c59 60/68: * rt-liberation.el: fix n/p in viewer2,
Yoni Rabkin <=
- [elpa] externals/rt-liberation 3376123 63/68: * rt-liberation-rest.el: better user interaction, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation f682e7b 68/68: Merge branch 'master' into externals/rt-liberation, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 0fc4737 09/68: documentation fixes, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation ed929f5 16/68: integrate changes post-ELPA synchronization, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 53e56b7 31/68: * rt-liberation-viewer.el: history parse, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation a9786cf 23/68: * NEWS: update, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 1000e89 11/68: * doc/rt-liberation.texinfo: update manual, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation 680e177 48/68: * rt-liberation.el: remove leading blank lines, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation cbfb99c 49/68: * rt-liberation.el: start making sense of section types, Yoni Rabkin, 2020/12/16
- [elpa] externals/rt-liberation b23df79 50/68: * rt-liberation.el: forward and back section movement, Yoni Rabkin, 2020/12/16