Variable: pcomplete-exit-function

pcomplete-exit-function is a variable defined in pcomplete.el.gz.

Value

pcomplete-default-exit-function

Documentation

The exit function to call in pcomplete-completions-at-point.

This variable is let-bound in pcomplete-completions-at-point, so you can modify or advise it in order to adjust the behavior for a specific completion. For example, you might do the following in a pcomplete-try-first-hook function to insert a trailing slash after a completion:

  (add-function
   :before (var pcomplete-exit-function)
   (lambda (_ status)
     (when (eq status 'finished)
       (insert "/"))))

Source Code

;; Defined in /usr/src/emacs/lisp/pcomplete.el.gz
(defvar pcomplete-exit-function #'pcomplete-default-exit-function
  "The exit function to call in `pcomplete-completions-at-point'.

This variable is let-bound in `pcomplete-completions-at-point',
so you can modify or advise it in order to adjust the behavior
for a specific completion.  For example, you might do the
following in a `pcomplete-try-first-hook' function to insert a
trailing slash after a completion:

  (add-function
   :before (var pcomplete-exit-function)
   (lambda (_ status)
     (when (eq status \\='finished)
       (insert \"/\"))))")