From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: saveplace: don't ask for coding system Date: Tue, 04 Dec 2007 23:32:08 +0200 Message-ID: References: <198E2B70-D060-41D8-8BC2-A9614C2729CC@inf.ed.ac.uk> <06675819-C4A8-4D78-AD59-0A2AF296AC7E@inf.ed.ac.uk> <87ve7gn5zc.fsf@red-bean.com> <0CD94276-1D9F-42BB-A6F7-A90ED9E06817@inf.ed.ac.uk> <87bq98n0ka.fsf@red-bean.com> <87fxykjb6y.fsf@red-bean.com> <87hcizihwh.fsf@red-bean.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1196803947 31717 80.91.229.12 (4 Dec 2007 21:32:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Dec 2007 21:32:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 04 22:32:35 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IzfNZ-00050L-Fm for ged-emacs-devel@m.gmane.org; Tue, 04 Dec 2007 22:32:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IzfNI-0005WA-U4 for ged-emacs-devel@m.gmane.org; Tue, 04 Dec 2007 16:32:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IzfND-0005SY-Hi for emacs-devel@gnu.org; Tue, 04 Dec 2007 16:32:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IzfN9-0005OX-R2 for emacs-devel@gnu.org; Tue, 04 Dec 2007 16:32:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IzfN9-0005OO-N5 for emacs-devel@gnu.org; Tue, 04 Dec 2007 16:32:07 -0500 Original-Received: from romy.inter.net.il ([213.8.233.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IzfN9-0002p7-41 for emacs-devel@gnu.org; Tue, 04 Dec 2007 16:32:07 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-84-229-222-88.inter.net.il [84.229.222.88]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id JNW45657 (AUTH halo1); Tue, 4 Dec 2007 23:31:49 +0200 (IST) In-reply-to: (lekktu@gmail.com) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84675 Archived-At: > Date: Tue, 4 Dec 2007 17:40:57 +0100 > From: "Juanma Barranquero" > Cc: "Emacs Devel" > > Which brings forth a similar case: the savehist-file (from > savehist.el) is by default saved in utf-8 (at least on recent XEmacs > and Emacs). However, the eol-conversion is left for Emacs to decide. When saving history, there's nothing to decide: savehist uses a temporary buffer, which is born with the native EOL convention of the underlying platform: -unix on Posix platforms, -dos on Windows. > That's Not Good when some of the saved variables contain "^M" or "^J" > on a non-unix environment. So you mean when reading the history file, yes? > For example, I did some "^M^J" -> "^J" > replacements (to fix a garbled patch) on Windows, and in subsequent > invocations of Emacs the contents of query-replace-history got sillier > and sillier: "^M^M^J", "^M^M^M^M^J", etc. > > Now, savehist.el is friendly enough to contain a variable > `savehist-coding-system', so it's easy to fix in your own .emacs. The > question is, for a file whose intention is to preserve exactly some > variable's contents, wouldn't be a better default to use utf-8-unix? I don't think it's better, because a lone ^M can fool Emacs even if we use -unix. What would help, I think, is have an explicit EOL conversion stated in the coding: cookie. Then the fragile guesswork will be bypassed.