From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#31062: 26.0.91; warning on UTF-8 encoding of unibyte text Date: Sun, 08 Apr 2018 11:49:12 +0200 Message-ID: References: <83sh8a3hig.fsf@gnu.org> <83r2nt1oeo.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1523180830 13583 195.159.176.226 (8 Apr 2018 09:47:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 8 Apr 2018 09:47:10 +0000 (UTC) Cc: 31062@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 08 11:47:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f56ue-0003QD-S0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Apr 2018 11:47:05 +0200 Original-Received: from localhost ([::1]:40722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f56wh-0001K2-37 for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Apr 2018 05:49:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f56wb-0001Jn-Ay for bug-gnu-emacs@gnu.org; Sun, 08 Apr 2018 05:49:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f56wY-0006gg-8J for bug-gnu-emacs@gnu.org; Sun, 08 Apr 2018 05:49:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f56wY-0006g0-4A for bug-gnu-emacs@gnu.org; Sun, 08 Apr 2018 05:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f56wX-0003EJ-Kw for bug-gnu-emacs@gnu.org; Sun, 08 Apr 2018 05:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Apr 2018 09:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31062 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31062-submit@debbugs.gnu.org id=B31062.152318088412352 (code B ref 31062); Sun, 08 Apr 2018 09:49:01 +0000 Original-Received: (at 31062) by debbugs.gnu.org; 8 Apr 2018 09:48:04 +0000 Original-Received: from localhost ([127.0.0.1]:41903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f56vc-0003DA-Ay for submit@debbugs.gnu.org; Sun, 08 Apr 2018 05:48:04 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:42684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f56va-0003Cg-QS for 31062@debbugs.gnu.org; Sun, 08 Apr 2018 05:48:03 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id E156D22702 for <31062@debbugs.gnu.org>; Sun, 8 Apr 2018 09:49:05 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= content-transfer-encoding:content-type:content-type:mime-version :references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1523180945; x=1524044946; bh=ZRa69nilXW0y+ +5K1RfZ3QvujgCzbHIhGSmMcyJVp2k=; b=EMaYMTxjyp9qSLrnxkjuoBYu4u+y2 /RfM4aOpCXUsYWHurURuOLkdwheWMggSqGB2wgYFDyWRblrJ4D2udT765+Hlo2rb gbVKRBKYtEvYRxejTEUt8UnSjp5+acGIZ/G52wN2Zz7gktnei9b82OOM96+tx9bq YG5uadSym0Zkkk= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id fdhPqqQB7yP8 for <31062@debbugs.gnu.org>; Sun, 8 Apr 2018 09:49:05 +0000 (UTC) Original-Received: from gray (202.100.1.85.dynamic.wline.res.cust.swisscom.ch [85.1.100.202]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id C447A226F0; Sun, 8 Apr 2018 09:49:04 +0000 (UTC) In-reply-to: <83r2nt1oeo.fsf@gnu.org> (message from Eli Zaretskii on Thu, 05 Apr 2018 21:47:11 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144989 Archived-At: > Date: Thu, 05 Apr 2018 21:47:11 +0300 > From: Eli Zaretskii > > > > These default coding systems were tried to encode text in the buffer > > > 'test', but failed for the listed (POSITION . CODEPOINT) elements: > > > > to make that clear to the user? > > Feel free to suggest a patch, but the list includes the coding-systems > tried, not just positions and codepoints. That's true, but after looking at the code of select-safe-coding-system-interactively, it seems that the "rejected" list is also printed in the same run as "unsafe", and "rejected" is indeed a list of coding systems. (insert "These default coding systems were tried to encode" (if (stringp from) (concat " \"" (if (> (length from) 10) (concat (substring from 0 10) "...\"") (concat from "\""))) (format-message " text\nin the buffer `%s'" bufname)) ":\n") (let ((pos (point)) (fill-prefix " ")) (dolist (x (append rejected unsafe)) ← "rejected" printed here (princ " ") (princ x)) (insert "\n") (fill-region-as-paragraph pos (point))) Strangely, the "rejected" list is then printed again, if it's non-nil: (when rejected (insert "These safely encode the text in the buffer, but are not recommended for encoding text in this context, e.g., for sending an email message.\n ") (dolist (x rejected) (princ " ") (princ x)) (insert "\n")) One solution might be to only print the "rejected" list in this second form, and in the first form explain more clearly what is the meaning of the elements in the "unsafe" list.