From: Dmitri Paduchikh <dpaduchikh@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 25365@debbugs.gnu.org
Subject: bug#25365: 25.1; Coding system for bookmarks and desktop
Date: Tue, 10 Jan 2017 01:34:18 +0500 [thread overview]
Message-ID: <87tw98x99x.fsf@gmail.com> (raw)
In-Reply-To: <83eg0cdq68.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 09 Jan 2017 20:49:35 +0200")
Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Dmitri Paduchikh <dpaduchikh@gmail.com>
>> Cc: 25365@debbugs.gnu.org
>> Date: Mon, 09 Jan 2017 22:07:49 +0500
>>
>> It may be hard to know what is happening if it is designed to happen
>> automatically. So, if you insist on supporting user choice here, please
>> consider the following patch. It adds the check of workability of the chosen
>> codec unless it is given directly by user in which case the usual procedure
>> applies, or the codec is omnipotent. In the case of encodability problems it
>> will fallback to utf-8-emacs.
EZ> With the proposed patch, the fallback utf-8-emacs will happen
EZ> silently, so the user will have no idea that her selected encoding was
EZ> ignored, isn't it so? If so, I don't think it's a good idea to do
EZ> that, when the user explicitly asks for a particular encoding.
It is a choice between data loss (see below) and using another encoding.
The former seems worse to me.
EZ> Come to think of that, I actually don't understand why anything is
EZ> needed in addition to the current code: if the user-chosen encoding
EZ> cannot safely encode the bookmark file, Emacs will refuse to save
the EZ> file, and will insist on the user providing a safe encoding.
Only when user is specifying encoding through C-x RET c right now. Next
time, when the encoding is chosen automatically this check won't be
done. Try the following experiment: mark some non-ASCII character and
evaluate this form by M-:.
(let ((coding-system-for-write 'us-ascii))
(shell-command-on-region (region-beginning) (region-end) "od -A n -t x1"))
The output is " 3f". I guess that exact choice of a replacement
character depends on the coding system.
EZ> E.g., set a bookmark in TUTORIAL.ru, and then try saving the
EZ> bookmark file using the Latin-1 encoding. I just tried something
EZ> like that, and the effect was exactly as I expected: Emacs requested
EZ> me to provide another encoding.
Try this in different order. Assuming your patch applied, save bookmarks
using latin-1. Suppose this operation passes successfully and bookmarks
have been saved using latin-1. Then bookmark TUTORIAL.ru and save again
not specifying encoding.
With best regards
Dmitri Paduchikh
next prev parent reply other threads:[~2017-01-09 20:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 12:37 bug#25365: 25.1; Coding system for bookmarks and desktop Dmitri Paduchikh
2017-01-06 14:56 ` Dmitri Paduchikh
2017-01-07 12:46 ` Eli Zaretskii
2017-01-08 9:39 ` Dmitri Paduchikh
2017-01-08 15:45 ` Eli Zaretskii
2017-01-09 17:07 ` Dmitri Paduchikh
2017-01-09 18:49 ` Eli Zaretskii
2017-01-09 20:34 ` Dmitri Paduchikh [this message]
2017-01-10 15:49 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tw98x99x.fsf@gmail.com \
--to=dpaduchikh@gmail.com \
--cc=25365@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.