all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* auto-mode-alist doesn't match VC files file.c.~version~
@ 2007-10-10 20:21 Chris Moore
  2007-10-10 20:25 ` Chris Moore
  2007-10-10 21:12 ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Moore @ 2007-10-10 20:21 UTC (permalink / raw)
  To: emacs-pretest-bug

Using C-u C-x v ~ in VC I can request an old version of a file.

The old version will be written to disk as file.~version~ where
version is the version I've requested.

If I then visit the file in Emacs, the mode isn't set correctly,
unless 'version' is entirely numeric, and even then it only works by
accident, since Emacs' file-name-sans-versions strips off .~[0-9]+~
endings before auto-mode-alist gets to work on the filename.

When I visit file.c.~version~, file-name-sans-versions strips off just
the last '~', making my local .emacs customisation to deal with this
situation fail:
  (push '("\\.~[^~/]+~\\'" nil t) auto-mode-alist)

I think it would be better if file-name-sans-versions wasn't called in

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: auto-mode-alist doesn't match VC files file.c.~version~
  2007-10-10 20:21 auto-mode-alist doesn't match VC files file.c.~version~ Chris Moore
@ 2007-10-10 20:25 ` Chris Moore
  2007-10-10 21:12 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Moore @ 2007-10-10 20:25 UTC (permalink / raw)
  To: emacs-pretest-bug

On 10/10/07, Chris Moore <christopher.ian.moore@gmail.com> wrote:
> Using C-u C-x v ~ in VC I can request an old version of a file.
>
> The old version will be written to disk as file.~version~ where
> version is the version I've requested.
>
> If I then visit the file in Emacs, the mode isn't set correctly,
> unless 'version' is entirely numeric, and even then it only works by
> accident, since Emacs' file-name-sans-versions strips off .~[0-9]+~
> endings before auto-mode-alist gets to work on the filename.
>
> When I visit file.c.~version~, file-name-sans-versions strips off just
> the last '~', making my local .emacs customisation to deal with this
> situation fail:
>   (push '("\\.~[^~/]+~\\'" nil t) auto-mode-alist)
>
> I think it would be better if file-name-sans-versions wasn't called in
[I clicked 'send'?]

... set-auto-mode, allowing us to handle VC filenames as well as
backup filenames in auto-mode-alist.  This would also allow us to set
the mode of files with names like file.c.~1~.~1~ (made when I edit a
backup file) correctly, which currently doesn't happen.

Chris.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: auto-mode-alist doesn't match VC files file.c.~version~
  2007-10-10 20:21 auto-mode-alist doesn't match VC files file.c.~version~ Chris Moore
  2007-10-10 20:25 ` Chris Moore
@ 2007-10-10 21:12 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2007-10-10 21:12 UTC (permalink / raw)
  To: Chris Moore; +Cc: emacs-pretest-bug

"Chris Moore" <christopher.ian.moore@gmail.com> writes:

> If I then visit the file in Emacs, the mode isn't set correctly,
> unless 'version' is entirely numeric, and even then it only works by
> accident, since Emacs' file-name-sans-versions strips off .~[0-9]+~
> endings before auto-mode-alist gets to work on the filename.

This has already been fixed for the next release.
file-name-sans-versions has been extended to handle non-numeric backup
versions.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-10 21:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-10 20:21 auto-mode-alist doesn't match VC files file.c.~version~ Chris Moore
2007-10-10 20:25 ` Chris Moore
2007-10-10 21:12 ` Andreas Schwab

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.