branch: elpa/pcmpl-args commit a04b9f030878326843512324f4824c8329f7d452 Author: Matthew Bauer <mjbaue...@gmail.com> Commit: Troy Hinckley <t.mac...@gmail.com>
Filter out backspace character in default man function output The man command can produce \b characters that are used to make argument bold. This lead to completions that looked like: ls -_--_-a_al_ll_l To fix this we need to use the col -b command to apply all of the backspaces in order and get the final column positions. --- pcmpl-args.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcmpl-args.el b/pcmpl-args.el index 872c712a61..5baa5f246a 100644 --- a/pcmpl-args.el +++ b/pcmpl-args.el @@ -788,7 +788,8 @@ insert its content into the current buffer.") ;; line, reducing the number of false positives that result from lines ;; starting with `-' that aren't really options. (push "MANWIDTH=10000" process-environment) - (pcmpl-args-process-file "man" name))) + (pcmpl-args-process-file + shell-file-name shell-command-switch (format "man %s | col -b" name)))) (defun pcmpl-args-extract-argspecs-from-manpage (name &rest args) "Return a list of argspecs by parsing the manpage identified by NAME.