diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2021-12-13 12:30:02 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2021-12-13 12:30:02 +0100 |
| commit | 700c9d7bc221e04e259947f8fb7a908bf1909bc0 (patch) | |
| tree | 478018586101718c990e175febcfc333cc579c7c | |
| parent | 5319e343bbaf272ac0d0b376b5b37f09be800314 (diff) | |
Remove cape-repair-misbehaving-capf
I added a better fix by @jakanakaevangeli directly to Corfu.
| -rw-r--r-- | README.org | 21 | ||||
| -rw-r--r-- | cape.el | 17 |
2 files changed, 0 insertions, 38 deletions
@@ -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. @@ -1015,23 +1015,6 @@ case sensitive instead." `(,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." (lambda (&optional interactive) |
