all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Dima Kogan <dima@secretsauce.net>
Cc: 15494@debbugs.gnu.org, Michael Albinus <michael.albinus@gmx.de>
Subject: bug#15494: [PATCH] 24.3.50; Processes running under TRAMP can't cleanly write to the middle of a buffer
Date: Wed, 24 Feb 2016 15:07:12 +1100	[thread overview]
Message-ID: <87ziuqiwen.fsf@gnus.org> (raw)
In-Reply-To: <871u467oev.fsf@secretsauce.net> (Dima Kogan's message of "Mon, 30 Sep 2013 00:35:04 -0700")

Dima Kogan <dima@secretsauce.net> writes:

> Hi.
>
> I am observing that processes running over TRAMP overwrite all the
> buffer contents after (point). This is irrelevant in the usual case
> where the process output is going to the end of the buffer (there's
> nothing after the point in that case). This is also something that works
> fine with local (i.e. non-TRAMP) processes.
>
> To be clear, an example emacs invocation appears below. This populates
> the *scratch* buffer with
>
> a b c
> 1 2 3
>
> Then moves the point to the begging of the "1 2 3" line, and runs a
> TRAMP process to insert the text "inserted". I would expect the
> *scratch* buffer to end up with
>
> a b c
> inserted
> 1 2 3
>
> If the process runs without TRAMP, this is indeed what happens. With
> TRAMP, however, I get
>
> a b c
> inserted
>
> Note that with TRAMP the "1 2 3" line got deleted. The example invocation:
>
>  $ emacs -Q \
>    --eval \
>  '(defun test-filter(process output)
>          (with-current-buffer (process-buffer process) (insert output)))' \
>    --eval \
>  '(defun test-sentinel(process event)
>          )' \
>    --eval \
>  '(progn
>     (insert "a b c\n1 2 3\n")
>     (forward-line -1)
>     (cd "/sudo::/tmp")
>     (let ((process (start-file-process "echo" (get-buffer "*scratch*") "echo" "inserted")))
>       (set-process-sentinel process `test-sentinel)
>       (set-process-filter   process `test-filter)))'
>
> This creates a process filter that simply inserts the process output,
> and a sentinel that does nothing. The (cd "/sudo::/tmp") form is there
> to force the process to run with TRAMP. Every TRAMP-based path I've
> tried tickles this bug for me. Removing that form makes the process run
> without TRAMP, and I do not see the buggy behavior then.
>
> I'm observing this issue with the latest emacs24 release and with the
> latest emacs built from the sources as of 2013/09/30. Emacs 23.4.1
> appears to NOT have this bug. This is on a machine running Debian.
>
> I'm attaching a patch that fixes this issue for me. The cause appears to
> be a bit of code that deletes the system prompt from the TRAMP output.
> There's a bug in that code that deletes more than just the prompt in the
> case described above.

The patch makes sense to me.  Michael?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  parent reply	other threads:[~2016-02-24  4:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30  7:35 bug#15494: [PATCH] 24.3.50; Processes running under TRAMP can't cleanly write to the middle of a buffer Dima Kogan
2013-09-30  7:52 ` bug#15494: Improved patch Dima Kogan
2016-02-24  4:07 ` Lars Ingebrigtsen [this message]
2016-02-24  6:55   ` bug#15494: [PATCH] 24.3.50; Processes running under TRAMP can't cleanly write to the middle of a buffer Michael Albinus

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=87ziuqiwen.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=15494@debbugs.gnu.org \
    --cc=dima@secretsauce.net \
    --cc=michael.albinus@gmx.de \
    /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.