diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-04-13 12:40:27 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-04-13 12:40:27 +0200 |
| commit | 61558a241da59580394412903d3433d37ce94970 (patch) | |
| tree | 1f2e080fc620899693f2fac46a134f5adb2311f8 /cape.el | |
| parent | 12b157b0e3367504d4267c3b3977850e588e463e (diff) | |
Minor restructuring
Diffstat (limited to 'cape.el')
| -rw-r--r-- | cape.el | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -822,15 +822,15 @@ completion table is refreshed on every input change." (setq valid (or valid #'equal)) (pcase (funcall capf) (`(,beg ,end ,table . ,plist) - (setq plist `(:cape--buster t . ,plist)) - `(,beg ,end - ,(let* ((beg (copy-marker beg)) - (end (copy-marker end t)) - (input (buffer-substring-no-properties beg end)) - (all-input input) - (all-table table)) - (lambda (str pred action) - (let ((new-input (buffer-substring-no-properties beg end))) + (let* ((mbeg (copy-marker beg)) + (mend (copy-marker end t)) + (input (buffer-substring-no-properties mbeg mend)) + (all-input input) + (all-table table) + (all-plist `(:cape--buster t . ,plist))) + `(,beg ,end + ,(lambda (str pred action) + (let ((new-input (buffer-substring-no-properties mbeg mend))) (unless (or (string-match-p "\\s-" new-input) ;; Support Orderless (funcall valid (if (eq action t) all-input input) new-input)) (pcase (funcall capf) @@ -843,9 +843,9 @@ completion table is refreshed on every input change." (when (eq action t) (setf all-table new-table all-input new-input - (cddr plist) new-plist))))))) - (complete-with-action action (if (eq action t) all-table table) str pred))) - ,@plist)))) + (cddr all-plist) new-plist))))))) + (complete-with-action action (if (eq action t) all-table table) str pred)) + ,@all-plist))))) ;;;###autoload (defun cape-wrap-properties (capf &rest properties) |
