all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [angeli@iwi.uni-sb.de: Saving safe local variables garbles 8-bit characters in .emacs file]
@ 2006-03-07 19:35 Richard Stallman
  2006-03-08  2:25 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Stallman @ 2006-03-07 19:35 UTC (permalink / raw)


Would someone please DTRT, then ack this message?

------- Start of forwarded message -------
From: Ralf Angeli <angeli@iwi.uni-sb.de>
To: emacs-pretest-bug@gnu.org
Date: Mon, 06 Mar 2006 17:38:32 +0100
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Subject: Saving safe local variables garbles 8-bit characters in .emacs file

- --=-=-=

Under certain circumstances saving safe local variables permanently,
i.e. answering with `!' to the respective question may garble 8-bit
characters in a .emacs file.  For this to happen the .emacs file has
to contain UTF-8 characters and has to be saved as UTF-8.  In addition
Emacs has to be started in a directory with a .emacs.desktop file
which has to load a LaTeX file containing 8-bit characters like
umlauts, i.e. a file with a Latin-1 coding system.  In addition the
LaTeX file has to contain a Local Variables section with an unknown
variable.  As soon as Emacs is started this should pop up the question
about how to deal with the variable and once you answer with `!' the
.emacs file will be written.  If you open the .emacs file after that
8-bit characters will be garbled (it looks like the UTF-8 characters
got decomposed into their two separate bytes).

Attached you can find the files I used for testing (".emacs.orig" is
the original .emacs file and ".emacs.result" the one after the safe
variables stuff was written to it):


- --=-=-=
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename=.emacs.orig
Content-Transfer-Encoding: quoted-printable

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(desktop-save (quote ask-if-exists))
 '(desktop-save-mode t))

;; =E2=86=92 =C3=B6=C3=A4=C3=BC=C3=9F

;; Local Variables:
;; coding: utf-8
;; End:

- --=-=-=
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename=.emacs.result
Content-Transfer-Encoding: quoted-printable

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(desktop-save (quote ask-if-exists))
 '(desktop-save-mode t)
 '(safe-local-variable-values (quote ((foo)))))

;; =C3=A2=C2=86=C2=92 =C3=83=C2=B6=C3=83=C2=A4=C3=83=C2=BC=C3=83=C2=9F

(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )
;; Local Variables:
;; coding: utf-8
;; End:

- --=-=-=
Content-Disposition: attachment; filename=.emacs.desktop

;; -*- mode: emacs-lisp; coding: emacs-mule; -*-
;; --------------------------------------------------------------------------
;; Desktop File for Emacs
;; --------------------------------------------------------------------------
;; Created Mon Mar  6 17:20:28 2006
;; Desktop file format version 206
;; Emacs version 22.0.50.1

;; Global section:
(setq desktop-missing-file-warning nil)
(setq tags-file-name nil)
(setq tags-table-list nil)
(setq search-ring nil)
(setq regexp-search-ring nil)
(setq register-alist nil)

;; Buffer section -- buffers listed in same order as in buffer list:
(desktop-create-buffer 206
  "/home/angeli/scratch/desktop-test/test.tex"
  "test.tex"
  'latex-mode
  nil
  1
  '(nil nil)
  nil
  nil
  '((indent-tabs-mode) (buffer-file-coding-system . iso-latin-1-unix)))


- --=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename=test.tex
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by
	justus.rz.uni-saarland.de id k26GchrZ21992447

=F6=E4=FC=DF

%%% Local Variables:
%%% foo: nil
%%% End:

- --=-=-=




In GNU Emacs 22.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.8.13)
 of 2006-03-06 on neutrino
X server distributor `The X.Org Foundation', version 11.0.60802000
configured using `configure '--with-gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  locale-coding-system: iso-8859-1
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  desktop-save-mode: t
  tooltip-mode: t
  auto-compression-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  line-number-mode: t

Recent input:
! C-x C-f <C-backspace> <C-backspace> <C-backspace> 
. e m <tab> <return> M-x r e p o r <tab> <return>

Recent messages:
Loading regexp-opt...done
Loading tex-mode...done
Please type y, n, or !: 
Loading cus-edit...
Loading easymenu...done
Loading cus-edit...done
Wrote /home/angeli/.emacs
Desktop: 1 buffer restored.
For information about the GNU Project and its goals, type C-h C-p.
Loading emacsbug...done

- --=-=-=
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

- --=-=-=--
------- End of forwarded message -------

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

* Re: [angeli@iwi.uni-sb.de: Saving safe local variables garbles 8-bit characters in .emacs file]
  2006-03-07 19:35 [angeli@iwi.uni-sb.de: Saving safe local variables garbles 8-bit characters in .emacs file] Richard Stallman
@ 2006-03-08  2:25 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2006-03-08  2:25 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Would someone please DTRT, then ack this message?

Fixed.

> From: Ralf Angeli <angeli@iwi.uni-sb.de>
> Subject: Saving safe local variables garbles 8-bit characters in .emacs file
> To: emacs-pretest-bug@gnu.org
>
> - --=-=-=
>
> Under certain circumstances saving safe local variables permanently,
> i.e. answering with `!' to the respective question may garble 8-bit
> characters in a .emacs file.  For this to happen the .emacs file has
> to contain UTF-8 characters and has to be saved as UTF-8.  In addition
> Emacs has to be started in a directory with a .emacs.desktop file
> which has to load a LaTeX file containing 8-bit characters like
> umlauts, i.e. a file with a Latin-1 coding system.  In addition the
> LaTeX file has to contain a Local Variables section with an unknown
> variable.  As soon as Emacs is started this should pop up the question
> about how to deal with the variable and once you answer with `!' the
> .emacs file will be written.  If you open the .emacs file after that
> 8-bit characters will be garbled (it looks like the UTF-8 characters
> got decomposed into their two separate bytes).
>
> Attached you can find the files I used for testing (".emacs.orig" is
> the original .emacs file and ".emacs.result" the one after the safe
> variables stuff was written to it):
>
>
> - --=-=-=
> Content-Type: text/plain; charset=utf-8
> Content-Disposition: attachment; filename=.emacs.orig
> Content-Transfer-Encoding: quoted-printable
>
> (custom-set-variables
>   ;; custom-set-variables was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>  '(desktop-save (quote ask-if-exists))
>  '(desktop-save-mode t))
>
> ;; =E2=86=92 =C3=B6=C3=A4=C3=BC=C3=9F
>
> ;; Local Variables:
> ;; coding: utf-8
> ;; End:
>
> - --=-=-=
> Content-Type: text/plain; charset=utf-8
> Content-Disposition: attachment; filename=.emacs.result
> Content-Transfer-Encoding: quoted-printable
>
> (custom-set-variables
>   ;; custom-set-variables was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>  '(desktop-save (quote ask-if-exists))
>  '(desktop-save-mode t)
>  '(safe-local-variable-values (quote ((foo)))))
>
> ;; =C3=A2=C2=86=C2=92 =C3=83=C2=B6=C3=83=C2=A4=C3=83=C2=BC=C3=83=C2=9F
>
> (custom-set-faces
>   ;; custom-set-faces was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>  )
> ;; Local Variables:
> ;; coding: utf-8
> ;; End:
>
> - --=-=-=
> Content-Disposition: attachment; filename=.emacs.desktop
>
> ;; -*- mode: emacs-lisp; coding: emacs-mule; -*-
> ;; --------------------------------------------------------------------------
> ;; Desktop File for Emacs
> ;; --------------------------------------------------------------------------
> ;; Created Mon Mar  6 17:20:28 2006
> ;; Desktop file format version 206
> ;; Emacs version 22.0.50.1
>
> ;; Global section:
> (setq desktop-missing-file-warning nil)
> (setq tags-file-name nil)
> (setq tags-table-list nil)
> (setq search-ring nil)
> (setq regexp-search-ring nil)
> (setq register-alist nil)
>
> ;; Buffer section -- buffers listed in same order as in buffer list:
> (desktop-create-buffer 206
>   "/home/angeli/scratch/desktop-test/test.tex"
>   "test.tex"
>   'latex-mode
>   nil
>   1
>   '(nil nil)
>   nil
>   nil
>   '((indent-tabs-mode) (buffer-file-coding-system . iso-latin-1-unix)))
>
>
> - --=-=-=
> Content-Type: text/plain; charset=iso-8859-1
> Content-Disposition: attachment; filename=test.tex
> Content-Transfer-Encoding: quoted-printable
> X-MIME-Autoconverted: from 8bit to quoted-printable by
> 	justus.rz.uni-saarland.de id k26GchrZ21992447
>
> =F6=E4=FC=DF
>
> %%% Local Variables:
> %%% foo: nil
> %%% End:

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

end of thread, other threads:[~2006-03-08  2:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-07 19:35 [angeli@iwi.uni-sb.de: Saving safe local variables garbles 8-bit characters in .emacs file] Richard Stallman
2006-03-08  2:25 ` Chong Yidong

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.