branch: externals/cape
commit 87561729cb882680187e54755e81c9c18bb0ab26
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Mark cape-capf-purify as obsolete
---
CHANGELOG.org | 4 ++++
README.org | 5 +----
cape.el | 7 ++-----
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org
index d3f1188050..e15f360005 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -2,6 +2,10 @@
#+author: Daniel Mendler
#+language: en
+* Development
+
+- Mark ~cape-capf-purify~ and ~cape-wrap-purify~ as obsolete.
+
* Version 2.2 (2025-10-13)
- Minor improvements.
diff --git a/README.org b/README.org
index fc7517de7f..c5a16c6678 100644
--- a/README.org
+++ b/README.org
@@ -247,7 +247,6 @@ the Capf transformers with =defalias= to a function symbol.
- ~cape-capf-predicate~, ~cape-wrap-predicate~: Add candidate predicate to a
Capf.
- ~cape-capf-prefix-length~, ~cape-wrap-prefix-length~: Enforce a minimal
prefix length.
- ~cape-capf-properties~, ~cape-wrap-properties~: Add completion properties to
a Capf.
-- ~cape-capf-purify~, ~cape-wrap-purify~: Purify a broken Capf and ensure that
it does not modify the buffer.
- ~cape-capf-silent~, ~cape-wrap-silent~: Silence Capf messages and errors.
- ~cape-capf-sort~, ~cape-wrap-sort~: Add sort function to a Capf.
- ~cape-capf-super~, ~cape-wrap-super~: Merge multiple Capfs into a Super-Capf.
@@ -288,11 +287,9 @@ personal configuration.
(list (cape-capf-predicate #'elisp-completion-at-point
#'ignore-elisp-keywords)))
-;; Example 7: Sanitize broken Capfs. Catch errors with `cape-wrap-silent' or
-;; make sure that the Capf does not modify the buffer itself.
+;; Example 7: Catch errors with `cape-wrap-silent'.
(advice-add 'dabbrev-capf :around #'cape-wrap-silent)
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent) ;; Was
necessary on Emacs 28
-(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify) ;; Was
necessary on Emacs 28
#+end_src
* Contributions
diff --git a/cape.el b/cape.el
index 3de83d8c3c..d4eca75ccc 100644
--- a/cape.el
+++ b/cape.el
@@ -1208,11 +1208,6 @@ This function can be used as an advice around an
existing Capf."
(defun cape-wrap-purify (capf)
"Call CAPF and ensure that it does not illegally modify the buffer.
This function can be used as an advice around an existing Capf."
- ;; bug#50470: Fix Capfs which illegally modify the buffer or which illegally
- ;; call `completion-in-region'. The workaround here was proposed by
- ;; @jakanakaevangeli and is used in his capf-autosuggest package. In Emacs
29
- ;; the purity bug of Pcomplete has been fixed, such that make
- ;; `cape-wrap-purify' is not necessary anymore.
(catch 'cape--illegal-completion-in-region
(condition-case nil
(let ((buffer-read-only t)
@@ -1223,6 +1218,8 @@ This function can be used as an advice around an existing
Capf."
(list beg end coll :predicate pred)))))
(funcall capf))
(buffer-read-only nil))))
+(make-obsolete 'cape-wrap-purify nil "2.2")
+(make-obsolete 'cape-capf-purify nil "2.2")
;;;###autoload
(defun cape-wrap-accept-all (capf)