[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/rec-mode 7e5c145 74/98: rec-mode: use a prefix argument
From: |
Stefan Monnier |
Subject: |
[elpa] externals/rec-mode 7e5c145 74/98: rec-mode: use a prefix argument to move N records forward/backward |
Date: |
Thu, 12 Nov 2020 13:18:43 -0500 (EST) |
branch: externals/rec-mode
commit 7e5c1457da587aef95a006be559675c8d6a0af69
Author: Julio C. M. Ramirez <rikijpn@member.fsf.org>
Commit: Antoine Kalmbach <ane@iki.fi>
rec-mode: use a prefix argument to move N records forward/backward
---
etc/rec-mode.el | 60 ++++++++++++++++++++++++++++++---------------------------
1 file changed, 32 insertions(+), 28 deletions(-)
diff --git a/etc/rec-mode.el b/etc/rec-mode.el
index aa24849..65d1e61 100644
--- a/etc/rec-mode.el
+++ b/etc/rec-mode.el
@@ -1860,45 +1860,49 @@ record. Interactive version."
(rec-beginning-of-record))
(rec-goto-next-field)))
-(defun rec-cmd-goto-next-rec ()
+(defun rec-cmd-goto-next-rec (&optional n)
"Move the pointer to the beginning of the next record in the
file. Interactive version."
- (interactive)
+ (interactive "P")
+ (when (null n) (setq n 1))
(widen)
(let ((record-type (rec-record-type)))
- (if (save-excursion
- (and (rec-goto-next-rec)
- (equal (rec-record-type) record-type)
- (not (rec-record-descriptor-p (rec-current-record)))))
- (progn
- (rec-unfold-all-fields)
- (rec-remove-continuation-line-marker-overlays)
- (rec-goto-next-rec))
- (if (not (rec-record-type))
- (message "No more records")
- (message "%s" (concat "No more records of type "
- (rec-record-type))))))
+ (dotimes (i n)
+ (if (save-excursion
+ (and (rec-goto-next-rec)
+ (equal (rec-record-type) record-type)
+ (not (rec-record-descriptor-p (rec-current-record)))))
+ (progn
+ (rec-unfold-all-fields)
+ (rec-remove-continuation-line-marker-overlays)
+ (rec-goto-next-rec))
+ (if (not (rec-record-type))
+ (message "No more records")
+ (message "%s" (concat "No more records of type "
+ (rec-record-type)))))))
(unless rec-editing
(rec-show-record)))
-(defun rec-cmd-goto-previous-rec ()
+(defun rec-cmd-goto-previous-rec (&optional n)
"Move the pointer to the beginning of the previous record in
the file. Interactive version."
- (interactive)
+ (interactive "P")
+ (when (null n) (setq n 1))
(widen)
(let ((record-type (rec-record-type)))
- (if (save-excursion
- (and (rec-goto-previous-rec)
- (equal (rec-record-type) record-type)
- (not (rec-record-descriptor-p (rec-current-record)))))
- (progn
- (rec-unfold-all-fields)
- (rec-remove-continuation-line-marker-overlays)
- (rec-goto-previous-rec))
- (if (not (rec-record-type))
- (message "No more records")
- (message "%s" (concat "No more records of type "
- (rec-record-type))))))
+ (dotimes (i n)
+ (if (save-excursion
+ (and (rec-goto-previous-rec)
+ (equal (rec-record-type) record-type)
+ (not (rec-record-descriptor-p (rec-current-record)))))
+ (progn
+ (rec-unfold-all-fields)
+ (rec-remove-continuation-line-marker-overlays)
+ (rec-goto-previous-rec))
+ (if (not (rec-record-type))
+ (message "No more records")
+ (message "%s" (concat "No more records of type "
+ (rec-record-type)))))))
(unless rec-editing
(rec-show-record)))
- [elpa] externals/rec-mode c92fd4c 15/98: Highlight %sort, (continued)
- [elpa] externals/rec-mode c92fd4c 15/98: Highlight %sort, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode fd8fdd3 10/98: auto added to rec-font-lock-keywords in rec-mode.el, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 011411c 28/98: rec-mode: several functions to support field types., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 5666b5d 27/98: rec-mode: misc fixes., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode f7b30a1 34/98: rec-mode: folding of fields., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode cdf4a16 48/98: rec-mode: rec-cmd-count now suggests a default selection expression when invoked with a numeric prefix., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 033a600 64/98: rec-mode: new constant rec-mode-version, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 460a48d 65/98: copyright years updated in some files, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode a997b92 70/98: src, doc, elisp: remove support for hyphens in field names., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 2735e99 72/98: rec-mode: avoid extra unused window in fast selection., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 7e5c145 74/98: rec-mode: use a prefix argument to move N records forward/backward,
Stefan Monnier <=
- [elpa] externals/rec-mode 797445b 77/98: rec-mode: fix a call to string-match-p with invalid arguments., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode ef55915 78/98: rec-mode: support search-insensitive searches., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode b447b39 86/98: rec-mode: require tabulated-list., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode a89b7c2 89/98: rec-mode: split fields by comma and whitespace for summary, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 3e2f5a7 46/98: rec-mode: support for multiple field names in %type entries., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode ceb00b5 41/98: rec-mode: rec-cmd-edit-field supports a numeric argument., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 9f7a14d 43/98: rec-mode: fix edition of the default record set., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode b149dfc 58/98: rec-mode: avoid trying to delete the sole window in the current frame., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode eaf5e93 60/98: rec-mode: support for a mode hook., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 4b485a0 76/98: rec-mode: several fixes while removing byte-compilation warnings., Stefan Monnier, 2020/11/12