tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: perl local decoding leads to empty buffers


From: Michael Albinus
Subject: Re: perl local decoding leads to empty buffers
Date: Mon, 22 Apr 2013 12:27:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

David Smith <address@hidden> writes:

Hi David,

> Indeed my workaround was incomplete. There were two other small issues
> related to handling decode commands. I've attached a patch that works
> completely for me. Please take a look.

Thanks for the report. The "pack" encoding/decoding is rarely used these
days; that's why nobody has seen this error yet. 

Well, your patch looks good, but it is incomplete:

> --- /tmp/tramp-sh.el.orig     2013-04-20 13:04:19.218624784 -0700
> +++ /tmp/tramp-sh.el  2013-04-20 13:35:30.310631054 -0700
> @@ -2963,7 +2963,8 @@
>                 ;; epa-file gets confused.
>                 (let (file-name-handler-alist
>                       (coding-system-for-write 'binary))
> -                 (write-region (point-min) (point-max) tmpfile2))
> +                    (with-current-buffer (tramp-get-buffer v)
> +                      (write-region (point-min) (point-max) tmpfile2)))
>                 (tramp-with-progress-reporter
>                     v 3 (format "Decoding remote file %s with command %s"
>                                 filename loc-dec)

That's good. It did work by accident only until now.

> @@ -3229,7 +3230,7 @@
>                     (tramp-send-command
>                      v
>                      (format
> -                     (concat rem-dec " <<'EOF'\n%sEOF")
> +                     (concat rem-dec ">%s <<'EOF'\n%sEOF")
>                       (tramp-shell-quote-argument localname)
>                       (buffer-string)))
>                     (tramp-barf-unless-okay

This I haven't changed. Instead ...

> @@ -5018,8 +5019,7 @@
>              "(%s <%%s | \"%s\")"
>            "(%s <%%s | %s)")
>          compress coding))
> -      ((string-match "decoding" prop)
> -       (format "%s >%%s" coding))
> +      ((string-match "decoding" prop) coding)
>        (t
>         (format "%s <%%s" coding)))))))

... I distinguish here for local and remote decoding.

Furthermore, you must also handle the case

    (and compress (string-match "decoding" prop))

intended for larger files, which are zipped prior encoding. I have
committed a modified patch to the Tramp and Emacs repositories. You can
check the current version of tramp-sh.el from there. Note, that Tramp
lives in git now.

> Cheers,
> David

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]