Issue179

classification
Title vc-version-other-window, does not "respect" UTF-8
Type defect Module vc
Severity inconvenience Platform N/A
Keywords Nosy List
explanation
process
These controls should only be changed by committers and tracker administrators.
Status chatting   Reason
Superseder   Submitted 2007-12-03.09:02:08
Priority normal   Assigned To

Created on 2008-01-19.06:43:06 by oub, last changed 2008-04-16.13:16:34 by FKtPp.

Messages
msg272 [hidden] ([hidden]) Date: 2008-01-19.06:43:06
  Message-ID: <18268.18080.439931.958231@parhasard.net>
Ar an naoiú lá de mí na Nollaig, scríobh Vin Shelton: 

 > On Dec 9, 2007 12:34 PM, Aidan Kehoe <kehoea@parhasard.net> wrote:
 > >
 > >  Ar an t-ochtú lá de mí na Nollaig, scríobh Uwe Brauer:
 > >
 > >  >    > (setq-default buffer-file-coding-system 'utf-8)
 > >  >
 > >  > Now I remember the problem with this is that it converts my abbrev
 > >  > table using UTF-8 and then I can't use it anymore with xemacs no mule!
 > >
 > > Thanks for the report; I've fixed this in the trunk, but I don't have the
 > > right to apply the change to 21.4.
 > 
 > Can you please send me a 21.4 patch for review?

Sure. This differs from the output of hg tip -p slightly, and provokes a
couple of byte-compile-time warning on no-Mule 21.4.

lisp/ChangeLog addition:

2007-12-09  Aidan Kehoe  <kehoea@parhasard.net>

	* abbrev.el (write-abbrev-file):
	Write FILE using escape-quoted, as a coding system. Add a coding
	cookie to specify exactly what coding system was used; if
        coding-system-name is not used, this will always be binary. 

Index: lisp/abbrev.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/abbrev.el,v
retrieving revision 1.5
diff -u -u -r1.5 abbrev.el
--- lisp/abbrev.el	2001/04/12 18:21:09	1.5
+++ lisp/abbrev.el	2007/12/09 19:46:15
@@ -392,8 +392,11 @@

 (defun write-abbrev-file (file)
   "Write all abbrev definitions to a file of Lisp code.
+This does not include system abbrevs; it includes only the abbrev tables
+listed in listed in `abbrev-table-name-list'.
 The file written can be loaded in another session to define the same abbrevs.
-The argument FILE is the file name to write."
+The argument FILE is the file name to write.  If omitted or nil, the file
+specified in `abbrev-file-name' is used."
   (interactive
    (list
     (read-file-name "Write abbrev file: "
@@ -401,15 +404,21 @@
 		    abbrev-file-name)))
   (or (and file (> (length file) 0))
       (setq file abbrev-file-name))
-  (save-excursion
-   (set-buffer (get-buffer-create " write-abbrev-file"))
-   (erase-buffer)
-   (let ((tables abbrev-table-name-list))
-     (while tables
-       (insert-abbrev-table-description (car tables) nil)
-       (setq tables (cdr tables))))
-   (write-region 1 (point-max) file)
-   (erase-buffer)))
+  (let ((coding-system-for-write 'escape-quoted))
+    (with-temp-file file
+      ;; XEmacs change; not emacs-mule, and use the coding system
+      ;; escape-quoted resolves to, which will differ depending on whether
+      ;; the build is Mule or not.
+      (insert (format ";;-*-coding: %s;-*-\n"
+		      (or (and (fboundp #'coding-system-name)
+			       (coding-system-name
+				(find-coding-system coding-system-for-write)))
+			  "binary")))
+      (dolist (table
+               ;; XEmacs change; we keep the table sorted at runtime, no
+               ;; need to sort it here.
+               abbrev-table-name-list)
+        (insert-abbrev-table-description table nil)))))

 (defun abbrev-string-to-be-defined (arg)
   "Return the string for which an abbrev will be defined.
msg271 [hidden] ([hidden]) Date: 2008-01-19.06:43:06
  Message-ID: <20a807210712091115o77e10111w6508d02f3c95297d@mail.gmail.com>
Hi, Aidan -

On Dec 9, 2007 12:34 PM, Aidan Kehoe <kehoea@parhasard.net> wrote:
>
>  Ar an t-ochtú lá de mí na Nollaig, scríobh Uwe Brauer:
>
>  >    > This sounds like a bug specific to the VC package, not a bug
>  >    > specific to XEmacs. Ah, line 2610 vc.el; it does't preserve the
>  >    > coding system used in the original buffer. Is the bug addressed if
>  >    > you add a
>  >
>  >    > (setq-default buffer-file-coding-system 'utf-8)
>  >
>  > Now I remember the problem with this is that it converts my abbrev
>  > table using UTF-8 and then I can't use it anymore with xemacs no mule!
>
> Thanks for the report; I've fixed this in the trunk, but I don't have the
> right to apply the change to 21.4.

Can you please send me a 21.4 patch for review?

Thanks,
  Vin

_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta@xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
msg270 [hidden] ([hidden]) Date: 2008-01-19.06:43:06
  Message-ID: <18268.10003.692272.494053@parhasard.net>
Ar an t-ochtú lá de mí na Nollaig, scríobh Uwe Brauer: 

 >    > This sounds like a bug specific to the VC package, not a bug
 >    > specific to XEmacs. Ah, line 2610 vc.el; it does’t preserve the
 >    > coding system used in the original buffer. Is the bug addressed if
 >    > you add a
 > 
 >    > (setq-default buffer-file-coding-system 'utf-8)
 > 
 > Now I remember the problem with this is that it converts my abbrev
 > table using UTF-8 and then I can't use it anymore with xemacs no mule!

Thanks for the report; I’ve fixed this in the trunk, but I don’t have the
right to apply the change to 21.4.
msg269 [hidden] ([hidden]) Date: 2008-01-19.06:43:06
  Message-ID: <87ve7gm9rj.fsf@mat.ucm.es>
Hello

Starting xemacs-21.4.19 mule -vanilla with the minimal lines of my
last post, in order to use utf-8, I observed the follwing.

I created a file test in which I wrote some lines in spanish
input spanish-prefix, I saved it in utf-8 and registered the file
under vc (RCS). I checked in added some more text, checked out.

The command 
        file test 
tells me 
        test: UTF-8 Unicode text

Now I use vc-version-other-window but then 
file test.~1.3~
test.~1.3~: ISO-8859 text, with no line terminators

So the file is not in UTF-8. That is really bad. 

Can anybody reproduce this? What shall I do?

thanks

Uwe Brauer 

_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta@xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
History
Date User Action Args
2008-04-16 13:16:34FKtPpsetpriority: normal
platform: + N/A
type: defect
severity: inconvenience
module: + vc
2008-01-19 06:43:06aidansetmessages: + msg272
2008-01-19 06:43:06acssetmessages: + msg271
2008-01-19 06:43:06aidansetstatus: new -> chatting
messages: + msg270
2008-01-19 06:43:06oubcreate