Subject: bug#14173: comint file completion bug

From: Jacob Butcher <[email-masked]>
Date: Wed, 10 Apr 2013 01:15:03 -0700

Function comint-quote-filename does not correctly quote "]" characters when
they appear in variable comint-file-name-quote-list.  The function naively
formats each character in the list into a string representation of a character
set by surrounded them with "[" and "]".
When the list consists of characters like " " and "|", that works fine, and
yields character sets like "[ |]". But if the list is:

    (91 93 124 38 60 62 40 41 59 32 36 42 33 34 39 96 35 92)

the resulting character set "[[]|&<>(); $*!\"'`#\\]" is wrong, as it does
not place "]" first, the only location where it is permitted.  (That
restriction is not actually specified in,
http://emacswiki.org/emacs/RegularExpression, which defines character sets
rather poorly, but perhaps that wiki is not your responsibility.)  I
suspect adding "-" to comint-file-name-quote-list except as the first or
last character would yield a similar problem.

I fixed the problem for myself by putting 93 as the first list element.
A more general solution would involve massaging the list in function
comint-file-name-quote-list to put "]" first and "-" last, when present.
I could write that code if you wish.

                                Sincerely,
                                    Jacob Butcher