Subject: Re: bug#37189: 25.4.1: vc-hg-ignore implementation is missing

From: Dmitry Gutov <[email-masked]>
Date: Wed, 25 Dec 2019 02:16:27 +0200

Hi Wolfgang,

On 29.08.2019 18:52, Wolfgang Scherer wrote:
> +  "Ignore FILE of DIRECTORY (default is `default-directory').

IF this function needs a docstring at all (which is not obvious since it 
should be following vc-ignore), I think I'd rather this followed the 
latter's docstring. Where the clarification about the default is not in 
the first sentence.

Also, I think saying "Ignore FILE under DIRECTORY" would be better, if 
you intend to add this particular semantics to relative names.

> +Otherwise, FILE is either relative to DIRECTORY or absolute. FILE
> +is converted to a path relative to the project root of DIRECTORY.

Isn't it a bit odd that vc-ignore's docstring doesn't specify this 
distinction, and yet we're trying to implement it in vc-hg-ignore?

Do you have a particular reason for that?

> +                (concat pattern (and (file-directory-p file-path) "*"))))))

I think it needs to asterisks for the glob to become recursive. At least 
according to https://stackoverflow.com/a/255094/615245.

> +    (lambda (_c)
> +      (cons _c (concat "\\" (char-to-string _c)))))

Our convention says that an argument whose name starts with underscore 
is unused. That's not the case here, so it shouldn't be named like that.

> +    (lambda (_c)
> +      (or (cdr (assq _c vc-hg--py-regexp-special-chars))
> +          (char-to-string _c))))

Same.