unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Vincent Belaïche" <vincent.belaiche@gmail.com>
To: monnier@iro.umontreal.ca
Cc: 34350@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#34350: 27.0.50; ediff-revision broken with SVN backend + non ascii chars both in directory and in filename
Date: Mon, 11 Feb 2019 22:20:20 +0100	[thread overview]
Message-ID: <84r2cec99n.fsf@gmail.com> (raw)
In-Reply-To: <jwva7j6rmep.fsf-monnier+emacsbugs@gnu.org>


Le 08/02/2019 à 22:50, Stefan Monnier a écrit :
>>> I think intuitively, in terms of encoding for the file's contents
>>> the backends should always return a byte-sequence (i.e. with
>>> no-conversion) and the front-end should then decide how to decode it
>>> (e.g., obeying the -*- coding -*- cookie and such).
>> Why do we need to leave this to the front end?
>
> So that it's not half-implemented differently in every backend.
>
>> It's a waste of cycles to do decoding manually in Lisp,
>
> It'd be better to decode "on the fly" rather than first insert the
> byte stream in a buffer and then decode it.  No doubt.  But I can't
> see how to do that and handle -*-coding-*-, auto-coding-regexp-alist,
> and friends.
>
>> and it also pushes this obscure art to application levels,
>
> The "front-end" is `vc-find-revision`.  All other code should be
> layered on top of that one, so it's done at only one place.  If that
> doesn't work (because vc-find-revision is not flexible enough) then we
> should move this decoding code to a middle-layer between
> vc-find-revision and (vc-call find-revision ...) that all users of
> `find-revision` can then use.
>
>> insist on any encoding, except where the VCS requires it, and it
>
> I don't know of any VCS that enforces any kind of encoding on the
> files it manages.  AFAIK they pretty much all manage files made of
> lines where the lines are made of bytes (with some extra
> accommodations for files not made of lines).  Some try to handle
> line-end conversion to some extent, but that doesn't really affect us
> anyway.
>
>
>         Stefan

Hello,

Just one simple question : why do we need some specific code in
vc-find-revision to be in charge of selecting the coding scheme and
doing the decoding.

My understanding is that, say for svn backend, what you want to do is
to get the same as

1) svn --non-interactive cat  my_non_ascii_named_file.tex  > temp_file

2) visit temp_file


Instead of doing that redirection into a temporary file, « svn
--non-interactive cat my_non_ascii_named_file.tex » is executed in a
process, and the output is directly inserted into a buffer. Hence the
troubles…

Why not use a temporary file ?

I understand that a temporary file has several drawbacks :

1) it is probably slower, at least for small files,

2) you have to do some clean-up

3) there is a potential security breach to leave tacks on a system file.


Having had a look at find-file lisp code, I noticed that under the hood,
the function insert-file-content is what does the real job of converting
the file bytes to a buffer. Now, looking at the C code of
Finsert_file_contents in fileio.c, I noticed that there is some
provision for not regular files, like pipes.

I was wondering whether there was some intention at some point of time
to use that function in order to recollect in a unified way the output
of a process into a buffer.

Wouldn't that help with our decoding issues ?

  V.








  parent reply	other threads:[~2019-02-11 21:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 19:52 bug#34350: 27.0.50; ediff-revision broken with SVN backend + non ascii chars both in directory and in filename Vincent Belaïche
2019-02-07 15:41 ` Eli Zaretskii
2019-02-07 22:27   ` Vincent Belaïche
2019-02-08  7:02     ` Eli Zaretskii
2019-02-07 15:50 ` Eli Zaretskii
2019-02-08 16:08   ` Stefan Monnier
2019-02-08 21:18     ` Eli Zaretskii
2019-02-08 21:50       ` Stefan Monnier
2019-02-08 22:10         ` Eli Zaretskii
2019-02-08 23:03           ` Stefan Monnier
2019-02-09  9:01             ` Eli Zaretskii
2019-02-09 13:12               ` Stefan Monnier
2019-02-09 13:42                 ` Eli Zaretskii
2019-02-09 14:03                   ` Stefan Monnier
2019-02-11 21:20         ` Vincent Belaïche [this message]
2019-02-11 22:00           ` Stefan Monnier
2019-02-08 17:25   ` Dmitry Gutov
2019-02-08 21:45     ` Eli Zaretskii
2019-02-09  7:58       ` Dmitry Gutov
2019-02-09  8:23         ` Eli Zaretskii
2019-02-10 19:52         ` Vincent Belaïche

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84r2cec99n.fsf@gmail.com \
    --to=vincent.belaiche@gmail.com \
    --cc=34350@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).