[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/capf-autosuggest 7e623f3 04/63: Un-implement must-land-
From: |
ELPA Syncer |
Subject: |
[elpa] externals/capf-autosuggest 7e623f3 04/63: Un-implement must-land-inside, always treat it as t |
Date: |
Wed, 27 Oct 2021 14:57:53 -0400 (EDT) |
branch: externals/capf-autosuggest
commit 7e623f3e7a3f287c3071e804fbc64ead11642a4c
Author: jakanakaevangeli <jakanakaevangeli@chiru.no>
Commit: jakanakaevangeli <jakanakaevangeli@chiru.no>
Un-implement must-land-inside, always treat it as t
---
capf-autosuggest.el | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/capf-autosuggest.el b/capf-autosuggest.el
index b045b7d..a169eaa 100644
--- a/capf-autosuggest.el
+++ b/capf-autosuggest.el
@@ -50,31 +50,25 @@ for optimization.")
"Region of `completion-at-point'.")
;;;###autoload
-(defmacro capf-autosuggest-define-partial-accept-cmd
- (name command &optional must-land-inside)
+(defmacro capf-autosuggest-define-partial-accept-cmd (name command)
"Define a command NAME.
It will call COMMAND interactively, allowing it to move point
into an auto-suggested overlay. COMMAND must not modify buffer.
NAME must not be called if `capf-autosuggest-active-mode' in
inactive. Usually, NAME is bound in
-`capf-autosuggest-active-mode-map'.
-
-If MUST-LAND-INSIDE is non-nil, the auto-suggestied text will not
-be kept if COMMAND moves point outside of the region."
+`capf-autosuggest-active-mode-map'."
`(defun ,name ()
,(format "`%s', possibly moving point into an auto-suggested overlay."
command)
(interactive)
- (capf-autosuggest-call-partial-accept-cmd #',command ,must-land-inside)))
+ (capf-autosuggest-call-partial-accept-cmd #',command)))
-(defun capf-autosuggest-call-partial-accept-cmd
- (command &optional must-land-inside)
+(defun capf-autosuggest-call-partial-accept-cmd (command)
"Call COMMAND interactively, stepping into auto-suggested overlay.
Temporarily convert the overlay to buffer text and call COMMAND
interactively. Afterwards, the added text is deleted, but only
-the portion after point. Additionally, if MUST-LAND-INSIDE is
-non-nil, the whole added text is deleted if point isn't located
-inside the added text."
+the portion after point. Additionally, if the point is outside of
+the added text, the whole text is deleted."
(let (beg end text)
(with-silent-modifications
(catch 'cancel-atomic-change
@@ -86,9 +80,8 @@ inside the added text."
(setq end (point)))
(call-interactively command)
(and (> (point) beg)
- (or (not must-land-inside)
- (< (point) end))
- (setq text (buffer-substring beg (min (point) end))))
+ (<= (point) end)
+ (setq text (buffer-substring beg (point))))
(throw 'cancel-atomic-change nil))))
(when text
(if (= (point) beg)
- [elpa] externals/capf-autosuggest 3064910 54/63: Add undo-boundary when accepting suggestion, (continued)
- [elpa] externals/capf-autosuggest 3064910 54/63: Add undo-boundary when accepting suggestion, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 3f53162 58/63: Remove README, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 0bcdfae 59/63: Add license, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 05980d5 60/63: Adjust package headers, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 3e36894 61/63: Fix copyright notice, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 9fb8c7e 10/63: Fix cursor display if suggested string begins with newline, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest a5f0de5 19/63: Rearrange functions, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 8f0c505 11/63: Fix package header, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 74ed3c9 15/63: Doc fixes, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 65a33a7 05/63: Fix short description, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 7e623f3 04/63: Un-implement must-land-inside, always treat it as t,
ELPA Syncer <=
- [elpa] externals/capf-autosuggest 489974d 06/63: Require subr-x for compilation only, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 0ba985a 14/63: Minor simplification, use pcase-let, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 7085c0a 02/63: Improve, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 6432d5f 09/63: Avoid error if all-completions returns invalid strings, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest f9854fb 03/63: Define partial-accept commands individually, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest d374a0b 21/63: Small rearrangement, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 56796e2 23/63: Minor loop optimization, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 82c6851 25/63: Merge into one file, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest bdc26ec 31/63: Typo, ELPA Syncer, 2021/10/27
- [elpa] externals/capf-autosuggest 07cb937 32/63: Added dwim commands/menu-items, ELPA Syncer, 2021/10/27