From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: prompt: "Select one of these safe coding systems" Date: Mon, 25 Nov 2002 08:02:54 +0200 (IST) Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <87smxqzsfw.fsf@computer.localdomain> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1038204324 21179 80.91.224.249 (25 Nov 2002 06:05:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 25 Nov 2002 06:05:24 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18GCN0-0005VR-00 for ; Mon, 25 Nov 2002 07:05:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18GCM3-0006ft-00; Mon, 25 Nov 2002 01:04:23 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18GCKl-0005QF-00 for help-gnu-emacs@gnu.org; Mon, 25 Nov 2002 01:03:03 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18GCKg-0005I7-00 for help-gnu-emacs@gnu.org; Mon, 25 Nov 2002 01:03:01 -0500 Original-Received: from is.elta.co.il ([199.203.121.2]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18GCKf-000582-00 for help-gnu-emacs@gnu.org; Mon, 25 Nov 2002 01:02:57 -0500 Original-Received: from is (is [199.203.121.2]) by is.elta.co.il (8.9.3/8.8.8) with SMTP id IAA10119 for ; Mon, 25 Nov 2002 08:02:55 +0200 (IST) X-Sender: eliz@is Original-To: help-gnu-emacs@gnu.org In-Reply-To: <87smxqzsfw.fsf@computer.localdomain> Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:3952 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3952 On 24 Nov 2002, D. Goel wrote: > [1] It seems I cannot get emacs to follow a system I want (utf-8) by > default. It still tries other systems and then shows me utf-8 among > the list of choices. What am i doing wrong? How did you try to achieve that? The right way is to use prefer-coding-system, I think. > [2] If emacs cannot "safely" encode, how do i ask it to please not > prompt me, but simply select the first from the "safe" "alternatives" > shows me? IIRC, you can't. Wrong encoding is deemed a disaster (because it could lose information and corrupt your precious files), so Emacs always prompts. The only exception is when the buffer's coding-system is undecided and the buffer can be encoded using the language environment's default encoding. For example, if you start with a pure-ASCII text and then add Latin-1 characters to it, and your language environment is Latin-1, then Emacs will silently use Latin-1 encoding when you save the text. > [3] Any other hints or workarounds, considering this situation? > I really want to get rid of this prompt :( Just don't type characters that cannot be encoded with the buffer's file-coding-system ;-) > esp. since the prompt > shows up for not me but for an infobot, which is supposed to be run > noninteractively. Non-interactive Lisp programs can bind coding-system-for-write to something appropriate before they invoke functions that write to files. > I don't care too much how it stores any > international characters that may have shown up, as long as it stores > the 99.9% english part just fine---i just want emacs to select > somethigng and just do it. If the encoding of non-ASCII characters _really_ doesn't matter (but please think carefully about this and make a few experiments before you decide, since the results might surprise you), then bind coding-system-for-write to raw-text.