[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/recomplete 2b38ca25e3 12/14: Add optional argument to step
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/recomplete 2b38ca25e3 12/14: Add optional argument to step onto the second item when completing |
Date: |
Thu, 7 Jul 2022 12:02:22 -0400 (EDT) |
branch: elpa/recomplete
commit 2b38ca25e3392636fe936d3edad447970279a463
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Add optional argument to step onto the second item when completing
This is more appropriate for cycling over elements where
the current item is included in the list.
---
recomplete.el | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/recomplete.el b/recomplete.el
index 09f3c43c14..e983d48e79 100644
--- a/recomplete.el
+++ b/recomplete.el
@@ -5,7 +5,7 @@
;; Author: Campbell Barton <ideasman42@gmail.com>
;; URL: https://gitlab.com/ideasman42/emacs-recomplete
-;; Version: 0.1
+;; Version: 0.2
;; Package-Requires: ((emacs "26.1"))
;; This program is free software; you can redistribute it and/or modify
@@ -346,11 +346,16 @@ Argument FN-CACHE stores the result for reuse."
;; Make public since users may want to add their own callbacks.
;;;###autoload
-(defun recomplete-with-callback (fn-symbol cycle-offset)
+(defun recomplete-with-callback (fn-symbol cycle-offset &optional
cycle-index-init)
"Run FN-SYMBOL, chaining executions for any function in FN-GROUP.
Argument CYCLE-OFFSET The offset for cycling words,
-1 or -1 for forward/backward."
+1 or -1 for forward/backward.
+
+Optional argument CYCLE-INDEX-INIT The initial index to use,
+defaulting to zero (which makes sense for corrections) you may wish to set
+the value to 1 when the current symbol is included in the list
+(so as to step onto the next item)."
;; Default to 1 (one step forward).
(setq cycle-offset (or cycle-offset 1))
@@ -365,7 +370,7 @@ Argument CYCLE-OFFSET The offset for cycling words,
(point-init (point))
(buffer-undo-list-init buffer-undo-list)
(pending-undo-list-init pending-undo-list)
- (cycle-index 0)
+ (cycle-index (or cycle-index-init 0))
(cycle-reverse nil)
(fn-cache nil)
- [nongnu] elpa/recomplete 80361184ad 06/14: Cleanup: docstring width, (continued)
- [nongnu] elpa/recomplete 80361184ad 06/14: Cleanup: docstring width, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete 8b794d1947 08/14: Cleanup: use defgroup, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete 8de8362858 03/14: readme: minor update, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete 9bf8222e31 09/14: Fix undo-collapse macro, use back-ported emacs 29.1 macro, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete d0e61f19a2 01/14: Initial working version., ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete f831f61797 02/14: readme: add melpa link, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete 802c85b02d 04/14: Replace cl-letf with advice macro, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete ef800da3ff 05/14: Cleanup: formatting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete 9d64b65855 10/14: Cleanup: use window-body-width, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete 28a7dbd533 11/14: readme: uncomment installation section, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete 2b38ca25e3 12/14: Add optional argument to step onto the second item when completing,
ELPA Syncer <=
- [nongnu] elpa/recomplete 48432904b2 07/14: Cleanup: replace 'if' with 'cond', ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete d0d3809294 13/14: Cleanup: use brief SPDX license, ELPA Syncer, 2022/07/07
- [nongnu] elpa/recomplete 021ca9b047 14/14: Change URL to codeberg, ELPA Syncer, 2022/07/07