GNU bug report logs - #8159
file-name-sans-version fails for some git files

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Wed, 2 Mar 2011 22:32:02 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8159 <at> debbugs.gnu.org
Subject: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 03 Mar 2011 05:58:06 +0200
> Date: Wed, 2 Mar 2011 22:31:12 +0000
> From: Reuben Thomas <rrt <at> sc3d.org>
> Cc: 
> 
> filenames like foo.js.~HEAD~1~ aren't handled properly because of the
> internal tilde.

What would be the "proper" handling of such a file name?  What is the
"version" here?

> This is easily fixable by adding tilde to the character class matched
> against (in emacs-23 it's in the source of file-name-sans-version; in
> the trunk it's in the more accessible file-name-version-regexp).
> 
> It seems to me that git is commonly-enough used that this is probably
> worth fixing in the source rather than leaving to users who notice the
> problem (especially in emacs-23, where it means redefining
> file-name-sans-version).

file-name-sans-versions is used by Emacs to produce backup file
names.  The file name you mention is not in the format of backup file
names that Emacs uses.  Extending file-name-sans-versions in the way
you suggest is not enough; we need also extend the format of backup
file names to support this.  Otherwise, removing the "version", then
adding another one will not produce a file name in this format.




This bug report was last modified 14 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.