diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 01efd83..3917638 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -3964,7 +3964,9 @@ This places `point' just after the prompt, or at the beginning of the line." (kill-line))) (defun erc-complete-word-at-point () - (run-hook-with-args-until-success 'erc-complete-functions)) + (let ((pcomplete-extra-entry-points + (cons 'completion-at-point pcomplete-extra-entry-points))) + (run-hook-with-args-until-success 'erc-complete-functions))) (define-obsolete-function-alias 'erc-complete-word 'completion-at-point "24.1") diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 957505f..30a743b 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -471,6 +471,15 @@ Same as `pcomplete' but using the standard completion UI." (plist-get :predicate (nthcdr 3 data))))) ;;; Pcomplete's native UI. +(defvar pcomplete-extra-entry-points nil + "When an non-native command is driving `pcomplete', that command's +symbol must be placed in this variable while `pcomplete' is invoked +in order to allow completion cycling to occur.\n +For example:\n + When completing ab → aba abc abd able via `completion-at-point',\n +which [may] delegate to `pcomplete' via `completion-at-point-functions', +the functions in that list should bind this variable to include the +symbol 'completion-at-point.") ;;;###autoload (defun pcomplete (&optional interactively) @@ -481,9 +490,10 @@ completion functions list (it should occur fairly early in the list)." (if (and interactively pcomplete-cycle-completions pcomplete-current-completions - (memq last-command '(pcomplete - pcomplete-expand-and-complete - pcomplete-reverse))) + (or (memq last-command '(pcomplete + pcomplete-expand-and-complete + pcomplete-reverse)) + (memq last-command pcomplete-extra-entry-points))) (progn (delete-char (- pcomplete-last-completion-length)) (if (eq this-command 'pcomplete-reverse)