emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pcmpl-args a04b9f0308 14/33: Filter out backspace characte


From: ELPA Syncer
Subject: [nongnu] elpa/pcmpl-args a04b9f0308 14/33: Filter out backspace character in default man function output
Date: Mon, 31 Jan 2022 11:59:23 -0500 (EST)

branch: elpa/pcmpl-args
commit a04b9f030878326843512324f4824c8329f7d452
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Troy Hinckley <t.macman@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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]