[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rfc-mode dde7646c44 2/9: fix page navigation
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rfc-mode dde7646c44 2/9: fix page navigation |
Date: |
Fri, 13 Oct 2023 10:02:11 -0400 (EDT) |
branch: elpa/rfc-mode
commit dde7646c44240e4aacefb068845fa2c254185d2c
Author: Nicolas Martyanoff <nicolas@n16f.net>
Commit: Nicolas Martyanoff <nicolas@n16f.net>
fix page navigation
It was incorrect before (the header starts at the line after \f, not the
line
before), and was apparently broken by Emacs 29 (see #22).
---
rfc-mode.el | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/rfc-mode.el b/rfc-mode.el
index fa1456db36..d16c583ff8 100644
--- a/rfc-mode.el
+++ b/rfc-mode.el
@@ -155,21 +155,25 @@ If nil (the default) then use e.g. *rfc21*, otherwise use
e.g. rfc21.txt."
(defun rfc-mode-recenter ()
"Do the same as `recenter-top-bottom' would for the `top' position."
+ (rfc-mode-header-start)
(let ((recenter-positions '(top)))
(recenter-top-bottom)))
(defun rfc-mode-backward-page ()
"Scroll to the previous page of the current buffer."
(interactive)
+ (beginning-of-line)
+ (unless (looking-at "")
+ (backward-page))
(backward-page)
- (rfc-mode-previous-header)
+ (beginning-of-line 1)
(rfc-mode-recenter))
(defun rfc-mode-forward-page ()
"Scroll to the next page of the current buffer."
(interactive)
(forward-page)
- (rfc-mode-previous-header)
+ (beginning-of-line 1)
(rfc-mode-recenter))
(defun rfc-mode-goto-section (section) ;FIXME: Why not use imenu for that?
@@ -352,19 +356,8 @@ the header."
(when (looking-at "")
(forward-line 1)
(move-end-of-line 1)
- (let ((end (point)))
- (forward-line -2)
- (move-beginning-of-line 1)
- end)))
-
-(defun rfc-mode-previous-header ()
- "Move the the start of the previous header.
-
-Return the position of the end of the previous header or NIL if
-no previous header is found."
- (when (search-backward "" nil t)
- (goto-char (match-beginning 0))
- (rfc-mode-header-start)))
+ (prog1 (point)
+ (move-beginning-of-line 1))))
(defun rfc-mode-next-header ()
"Move the end of the next header.
- [nongnu] elpa/rfc-mode updated (c938c8134e -> ab09db78d9), ELPA Syncer, 2023/10/13
- [nongnu] elpa/rfc-mode 2dd9b27c10 4/9: update copyright years, ELPA Syncer, 2023/10/13
- [nongnu] elpa/rfc-mode 52682e3592 5/9: use rfc-mode for buffers using the custom buffer name, ELPA Syncer, 2023/10/13
- [nongnu] elpa/rfc-mode 069427e114 6/9: v1.4.1, ELPA Syncer, 2023/10/13
- [nongnu] elpa/rfc-mode ab09db78d9 9/9: v1.4.2, ELPA Syncer, 2023/10/13
- [nongnu] elpa/rfc-mode dde7646c44 2/9: fix page navigation,
ELPA Syncer <=
- [nongnu] elpa/rfc-mode f561b316bc 1/9: fix comments, ELPA Syncer, 2023/10/13
- [nongnu] elpa/rfc-mode 30d4281753 3/9: remove unused comment, ELPA Syncer, 2023/10/13
- [nongnu] elpa/rfc-mode da94509d3a 7/9: remove duplicate license, ELPA Syncer, 2023/10/13
- [nongnu] elpa/rfc-mode 7048dab3d8 8/9: highlight footers, ELPA Syncer, 2023/10/13