]> git.eshelyaron.com Git - emacs.git/commit
Pcomplete: Better obey `completion-at-point-functions`
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Mar 2022 15:59:32 +0000 (11:59 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Mar 2022 15:59:32 +0000 (11:59 -0400)
commitce28de5d3a1293ceaf4317520ec8c3d2095ab947
treefee494d06643e8e03a8b5bf6f01f31d121cf12b1
parentf51e12feceae18f0b6715142a4e61d6522f79389
Pcomplete: Better obey `completion-at-point-functions`

Functions on `completion-at-point-functions` should not modify
the buffer.  Pcomplete itself mostly abides by this but Eshell's
use of it doesn't.  Try and catch those cases.  Also fix one of
those cases.

* lisp/pcomplete.el (pcomplete-allow-modifications): New var.
(pcomplete-completions-at-point): Enforce it.
(pcomplete, pcomplete-expand-and-complete, pcomplete-expand):
Rebind it since these commands expect the extra side effects.

* lisp/eshell/em-cmpl.el (eshell--pcomplete-insert-tab): New function,
extracted from `eshell-complete-parse-arguments`.
(eshell-complete-parse-arguments): Use it and obey
`pcomplete-allow-modifications`.
lisp/eshell/em-cmpl.el
lisp/pcomplete.el