branch: externals/cape
commit 700c9d7bc221e04e259947f8fb7a908bf1909bc0
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Remove cape-repair-misbehaving-capf
I added a better fix by @jakanakaevangeli directly to Corfu.
---
README.org | 21 ---------------------
cape.el | 17 -----------------
2 files changed, 38 deletions(-)
diff --git a/README.org b/README.org
index 82605da70b..dea6d1f661 100644
--- a/README.org
+++ b/README.org
@@ -194,27 +194,6 @@ achieve a similarly refreshing strategy.
(list (cape-capf-buster #'some-caching-capf)))
#+end_src
-** Repair misbehaving Capfs
-
-/Sweep misbehaving Capfs under the Cape!/
-
-Unfortunately some completion of point functions from Emacs show misbehavior.
-This is not a term I've made up, but minibuffer.el distinguishes old-style
-("misbehaving") Capfs and modern-style Capfs. The misbehaving Capfs do not
-return a completion table but just perform completion right away. Such behavior
-is particularily harmful for completion UIs like Company or Corfu in
-idle/auto-completion mode. There is at least one completion function, which
-affects shell completions: ~pcomplete-completions-at-point~.
-
-#+begin_src emacs-lisp
- (advice-add 'pcomplete-completions-at-point :around
#'cape-repair-misbehaving-capf)
-#+end_src
-
-By wrapping it with ~cape-repair-misbehaving-capf~ we can repair the occasional
-misbehavior of the Capf. In the long term the underlying issue should of course
-be fixed in ~pcomplete-completions-at-point~ but in the meantime we can live
with
-a localized fix.
-
** Other Capf transformers
- ~cape-silent-capf~: Wrap a chatty Capf and silence it.
diff --git a/cape.el b/cape.el
index 474a887b60..aa71afc944 100644
--- a/cape.el
+++ b/cape.el
@@ -1014,23 +1014,6 @@ case sensitive instead."
(`(,beg ,end ,table . ,plist)
`(,beg ,end ,(cape--noninterruptible-table table) ,@plist)))))
-;;;###autoload
-(defun cape-repair-misbehaving-capf (capf)
- "Repair a misbehaving CAPF."
- (save-mark-and-excursion
- (let ((beg (copy-marker (point)))
- (end (copy-marker (point) t)))
- (with-silent-modifications
- (unwind-protect
- (pcase (funcall capf)
- ((and res `(,beg ,end ,_table . ,_plist)
- (guard (integer-or-marker-p beg))
- (guard (integer-or-marker-p end)))
- (ignore beg end)
- res))
- (when (/= beg end)
- (delete-region beg end)))))))
-
;;;###autoload
(defun cape-interactive-capf (capf)
"Create interactive completion function from CAPF."