GNU bug report logs - #28687
25.2; Error using term-handle-ansi-terminal-messages

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Live System User <nyc4bos@HIDDEN>; Keywords: unreproducible moreinfo; dated Tue, 3 Oct 2017 15:20:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 28687 <at> debbugs.gnu.org:


Received: (at 28687) by debbugs.gnu.org; 16 Oct 2017 23:50:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 16 19:50:00 2017
Received: from localhost ([127.0.0.1]:44447 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1e4F8y-0001Qs-H1
	for submit <at> debbugs.gnu.org; Mon, 16 Oct 2017 19:50:00 -0400
Received: from mail-it0-f54.google.com ([209.85.214.54]:46809)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1e4F8x-0001Qc-5J
 for 28687 <at> debbugs.gnu.org; Mon, 16 Oct 2017 19:49:59 -0400
Received: by mail-it0-f54.google.com with SMTP id f187so363371itb.1
 for <28687 <at> debbugs.gnu.org>; Mon, 16 Oct 2017 16:49:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=7cDJH82ySOdrKrCEXMjcBjzee2kiL7mwN/J2lSHXBrE=;
 b=hgmUtOJ5Pkb8UwSKZntikgb72vGuSLhYp2ic39JXh8JJEioP+BFx7ZX6x4q7QGh3aG
 Xs8PiaYs36138ZBQpt5y4bmKcSzN+yAatU9fbjIz6p1gD5d3MqCtVicOHbur8fUDq06g
 miH7XcFwflfOklHosEsLNOEU8FbsnDrUi3IZPqHh58IvCI5ztidGsEfO3VXnOGdkLfWP
 th4DQRcBXa+Np3fg0d1srOa94k8pLqSbOgmqhnQdFqDk+doi5Z/6vXVGQp9m6i6HcUnW
 S5uAvGyFKaHDerdOlztzlNBiXGxyuCfA0DXrF+iaxBCe33zJZIkRz7uFoI9m3XbS1+fR
 nd5w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:from:to:cc:subject:references:date
 :in-reply-to:message-id:user-agent:mime-version;
 bh=7cDJH82ySOdrKrCEXMjcBjzee2kiL7mwN/J2lSHXBrE=;
 b=if9yLjn6kl/YJri/0OLmIlylTj0/tX9xPL5Il568ZjzfuY4XJPl76c9v2KX9hcQm7V
 /sCbI7ef6ZR/PewG539z+JWqJakOqLj7MAo87qTqRP4/sWkrRQ5q2oz8eQ4jO//DQOtv
 EDfR6NBpjyOhqfjhirRujniSKt2qpmbLcsvUvVvJoN4XTvP3Ad+VBZs1pAJYfV/zvOlk
 aH48L36rvL0bQtDReS5lGW7tTF57vOA1V25Tr0GGVAiDAg2Gw4lxjuJkLFrFB72nNRS7
 25aUDIkAeu2MvA3d4kSu+YzfYYj4ywCXqeed+eVq2276XM8oNLECfo38Ef+eiU8HKRS7
 4JAA==
X-Gm-Message-State: AMCzsaX6Wxk8qwgc5EbDvMGD4Af7hIGGR4E0IBDN2qQv5U19dEgGp2b7
 nvGW+dc9ZQolOQuhybtSTz+4zQ==
X-Google-Smtp-Source: ABhQp+RNJQYULjoREe3YnPpRbB1g7/WE7Qvmt0I/8sgzhTpbfitoO+c9wW/Q3SR4fF72praa2l0Yuw==
X-Received: by 10.36.154.66 with SMTP id l63mr3471115ite.118.1508197793295;
 Mon, 16 Oct 2017 16:49:53 -0700 (PDT)
Received: from zebian ([45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id f12sm201336itc.1.2017.10.16.16.49.51
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 16 Oct 2017 16:49:52 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Live System User <nyc4bos@HIDDEN>
Subject: Re: bug#28687: 25.2; Error using term-handle-ansi-terminal-messages
References: <87mv58b6np.fsf@HIDDEN> <87lgkhayct.fsf@HIDDEN>
 <877evvpll7.fsf@HIDDEN>
Date: Mon, 16 Oct 2017 19:49:51 -0400
In-Reply-To: <877evvpll7.fsf@HIDDEN> (Live System User's message of "Mon, 16
 Oct 2017 04:01:56 -0400")
Message-ID: <87lgkahcv4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 28687
Cc: 28687 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Live System User <nyc4bos@HIDDEN> writes:

> Noam Postavsky <npostavs@HIDDEN> writes:
>
>> Do you mean you have defined some new function?  Please post a complete
>> example, not just fragments.
>
>   No: I justed added those lines to the existing
>   `term-handle-ansi-terminal-messages`function:
>
> (defun term-handle-ansi-terminal-messages (message)
[...]
> 	    ((= command-code ?e)
> 	     (save-excursion
> 	      (find-file-other-window argument))

You have a missing paren here, is that a typo introduced when posting,
or is that what you ran?

And could you elaborate on the steps you take after that?  You said
something about an alias, but I couldn't tell if it's relevant or not.

>>
>>>         Most of the time thi works.
>>>         
>>>         When it doesn't work as expected,
>>
>> How often does it fail?
>
>   Enough to notice buy no enough to notice a pattern.

So how many times do I do "it" until I should expect to see a failure?
10?  100?  1000?

And what is "it" exactly?

>>> Debugger entered--Lisp error: (void-variable term-pending-delete-marker)
>>>   term-emulate-terminal(#<process test> "\nAnSiTe test\nAnSiTu liveuser\nAnSiTc /home/liveuser\nAnSiTh localhost.localdomain\n")
>>> 
>>
>> Seems like you might be running in the wrong buffer.
>> term-pending-delete-marker is only defined buffer-locally.
>
>   Since I use `find-file-other-window`, i.e. another buffer,
>   why don't I get that error every time that ANSI code is
>   processed instead of only occasionally?
>
>   When does `term-pending-delete-marker`kick in?
>
>   Shouldn't it only be a factor as I am typing chacaters and/or
>   interacting with the ansi-term?

It's referenced in term-emulate-terminal which is a process filter, so
it could be significant during output too.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#28687; Package emacs. Full text available.

Message received at 28687 <at> debbugs.gnu.org:


Received: (at 28687) by debbugs.gnu.org; 16 Oct 2017 08:02:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 16 04:02:06 2017
Received: from localhost ([127.0.0.1]:42441 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1e40Le-0008Nf-8u
	for submit <at> debbugs.gnu.org; Mon, 16 Oct 2017 04:02:06 -0400
Received: from omr-a003e.mx.aol.com ([204.29.186.57]:34809)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <nyc4bos@HIDDEN>) id 1e40Lc-0008NB-2V
 for 28687 <at> debbugs.gnu.org; Mon, 16 Oct 2017 04:02:04 -0400
Received: from mtaout-mca02.mx.aol.com (mtaout-mca02.mx.aol.com
 [172.26.221.78])
 by omr-a003e.mx.aol.com (Outbound Mail Relay) with ESMTP id 6FBBC3800099;
 Mon, 16 Oct 2017 04:01:58 -0400 (EDT)
Received: from localhost.localdomain (c-73-16-70-190.hsd1.ma.comcast.net
 [73.16.70.190])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mtaout-mca02.mx.aol.com (MUA/Third Party Client Interface) with ESMTPSA id
 03DAD38000083; Mon, 16 Oct 2017 04:01:57 -0400 (EDT)
From: Live System User <nyc4bos@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
Subject: Re: bug#28687: 25.2; Error using term-handle-ansi-terminal-messages
In-Reply-To: <87lgkhayct.fsf@HIDDEN> (Noam Postavsky's message
 of "Wed, 11 Oct 2017 22:33:54 -0400")
References: <87mv58b6np.fsf@HIDDEN> <87lgkhayct.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)
Date: Mon, 16 Oct 2017 04:01:56 -0400
Message-ID: <877evvpll7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
x-aol-global-disposition: G
X-AOL-VSS-INFO: 5800.7501/122092
X-AOL-VSS-CODE: clean
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.com;
 s=20150623; t=1508140918;
 bh=Zilx1DnjyGVYZpRPsSmqe8eWBj78rSmtKVLq4gZBH2s=;
 h=From:To:Subject:Message-ID:Date:MIME-Version:Content-Type;
 b=TJvg2jz9OVEFOW0rW+9+4vUu8TMzW7uoPYqUkuK7o9AqjcV0bKlbVnKsLklr3Nf8/
 symHv9uKmOXYxp9DQ4HADjUMyNsNCQqddUJz5dKijSRd6l5IOtTXwjM5uoYRNs0ZMP
 V2F5SVLfdu6HSpxR8vKpwiw1cW0/x+lo8Vh6tRjk=
x-aol-sid: 3039ac1add4e59e467751f7a
X-AOL-IP: 73.16.70.190
X-Spam-Score: -2.8 (--)
X-Debbugs-Envelope-To: 28687
Cc: 28687 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.8 (--)

--=-=-=
Content-Type: text/plain

Noam Postavsky <npostavs@HIDDEN> writes:

> tags 28687 + unreproducible moreinfo
> quit
>
> Live System User <nyc4bos@HIDDEN> writes:
>
>>         When trying to use `term-handle-ansi-terminal-messages`
>>         as a template, a new command code is defined:
>
> Do you mean you have defined some new function?  Please post a complete
> example, not just fragments.

  No: I justed added those lines to the existing
  `term-handle-ansi-terminal-messages`function:


--=-=-=
Content-Type: text/plain
Content-Disposition: attachment; filename=term-ansi.el
Content-Description: term-handle-ansi-terminal-messages addition

(defun term-handle-ansi-terminal-messages (message)
  ;; Is there a command here?
  (while (string-match "\eAnSiT.+\n" message)
    ;; Extract the command code and the argument.
    (let* ((start (match-beginning 0))
	   (command-code (aref message (+ start 6)))
	   (argument
	    (save-match-data
	      (substring message
			 (+ start 8)
			 (string-match "\r?\n" message
				       (+ start 8)))))
	   ignore)
      ;; Delete this command from MESSAGE.
      (setq message (replace-match "" t t message))

      ;; If we recognize the type of command, set the appropriate variable.
      (cond ((= command-code ?c)
	     (setq term-ansi-at-dir argument))
	    ((= command-code ?h)
	     (setq term-ansi-at-host argument))
	    ((= command-code ?u)
	     (setq term-ansi-at-user argument))
	    ((= command-code ?e)
	     (save-excursion
	      (find-file-other-window argument))
	    ;; Otherwise ignore this one.
	    (t
	     (setq ignore t)))

      ;; Update default-directory based on the changes this command made.
      (if ignore
	  nil
	(setq default-directory
	      (file-name-as-directory
	       (if (and (string= term-ansi-at-host (system-name))
					(string= term-ansi-at-user (user-real-login-name)))
		   (expand-file-name term-ansi-at-dir)
		 (if (string= term-ansi-at-user (user-real-login-name))
		     (concat "/" term-ansi-at-host ":" term-ansi-at-dir)
		   (concat "/" term-ansi-at-user "@" term-ansi-at-host ":"
			   term-ansi-at-dir)))))

	;; I'm not sure this is necessary,
	;; but it's best to be on the safe side.
	(if (string= term-ansi-at-host (system-name))
	    (progn
	      (setq ange-ftp-default-user term-ansi-at-save-user)
	      (setq ange-ftp-default-password term-ansi-at-save-pwd)
	      (setq ange-ftp-generate-anonymous-password term-ansi-at-save-anon))
	  (setq term-ansi-at-save-user ange-ftp-default-user)
	  (setq term-ansi-at-save-pwd ange-ftp-default-password)
	  (setq term-ansi-at-save-anon ange-ftp-generate-anonymous-password)
	  (setq ange-ftp-default-user nil)
	  (setq ange-ftp-default-password nil)
	  (setq ange-ftp-generate-anonymous-password nil)))))
  message)


--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


>
>>         Most of the time thi works.
>>=20=20=20=20=20=20=20=20=20
>>         When it doesn't work as expected,
>
> How often does it fail?

  Enough to notice buy no enough to notice a pattern.
=20=20
>
>>            1. I get the error:
>>=20
>>               if: Symbol=E2=80=99s value as variable is void:
>>               term-pending-delete-marker
>>=20
>> Debugger entered--Lisp error: (void-variable term-pending-delete-marker)
>>   term-emulate-terminal(#<process test> "\nAnSiTe test\nAnSiTu liveuser\=
nAnSiTc /home/liveuser\nAnSiTh localhost.localdomain\n")
>>=20
>
> Seems like you might be running in the wrong buffer.
> term-pending-delete-marker is only defined buffer-locally.

  Since I use `find-file-other-window`, i.e. another buffer,
  why don't I get that error every time that ANSI code is
  processed instead of only occasionally?

  When does `term-pending-delete-marker`kick in?

  Shouldn't it only be a factor as I am typing chacaters and/or
  interacting with the ansi-term?

  Thanks.


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#28687; Package emacs. Full text available.
Added tag(s) moreinfo and unreproducible. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 28687 <at> debbugs.gnu.org:


Received: (at 28687) by debbugs.gnu.org; 12 Oct 2017 02:34:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 11 22:34:08 2017
Received: from localhost ([127.0.0.1]:34689 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1e2TK3-0003HK-WA
	for submit <at> debbugs.gnu.org; Wed, 11 Oct 2017 22:34:08 -0400
Received: from mail-io0-f169.google.com ([209.85.223.169]:54864)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>)
 id 1e2TJy-0003Gd-Jj; Wed, 11 Oct 2017 22:34:03 -0400
Received: by mail-io0-f169.google.com with SMTP id h66so3904672ioh.11;
 Wed, 11 Oct 2017 19:34:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=S55rdPMVPardedHRbTUJmJvWOdWWQ5wufTUe7K1Kf5E=;
 b=KMTeKxTk6n/tjZFuENsmYSt9dN4VumWvPXdz9ShjAM7dfutvvKNghu+vs65RQpLZv8
 I5e1AxY9rnzWrO3BdtSspse2Ugpol1lNQBkYeQC67pfAMrfzbrjoDQS/es3wj/A6UybB
 AIBVqMOER/cGunoRLFQg2YANo8Fpx4Msb/McTxJdl65B9TafHDhpZkJ4qBO3pA5pIm9+
 +7OTaRB0/q1227KIWyLb+sgyfM8966k6sM4bBFguQtp9IvW79pl9pdre8gPBgQ0CDK/8
 xZEsO2EgokvXC/C0wDtvPrS8reqkJdRfl2U/DKr4tGqBokZgNO57mY0OZbc8BdhjqgRx
 Ryzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:from:to:cc:subject:references:date
 :in-reply-to:message-id:user-agent:mime-version
 :content-transfer-encoding;
 bh=S55rdPMVPardedHRbTUJmJvWOdWWQ5wufTUe7K1Kf5E=;
 b=TQI+gYSqWrN3wHS+49fMj/hKHSBvzUWuSDtmwxGLzwNAVJTLG/OQSuEi2wVS4jfxD/
 R0nQv/+VAQOqd6vAekdszFlh+osTvcdfjyhXxF2S5vEpFSMxohs7giq/rlgx+d2WL1IG
 xPqeS1HHk7/HovJ5BvUUqaywEya+0GDeCXAe6YAWhdNYcYsWEuGdrGZ6v/FYvWnpXsHZ
 zIpCvR3MOEw/2sfJSpry1rOPNCX7smS7gg9oLkJbKv6p6ThHRKRVgUQbC8OcguPj3iGy
 GS8piVcB6cSvVnwsnPfI5rFQ2iTfa1jy5FfT43wB65M+q7VzgEPazL/0IjE06SZa1R0N
 BBlg==
X-Gm-Message-State: AMCzsaX9YV4jGpZQm3FajKD1PoKBMzJHnI/ydLI6pTS4XJrUuUGeonLG
 4c/Nv9HP+oUmE4HgTyPbHUVqhA==
X-Google-Smtp-Source: ABhQp+Tv1E5S10YQZ7m0RtnAP6dAfIpClLZQa/xKRHWQPSUgwtcu/hHHZXYveObjkg/IubS/80YU2Q==
X-Received: by 10.107.192.132 with SMTP id q126mr1285085iof.181.1507775636626; 
 Wed, 11 Oct 2017 19:33:56 -0700 (PDT)
Received: from zebian ([45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id e37sm6530011ioi.70.2017.10.11.19.33.55
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Wed, 11 Oct 2017 19:33:55 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Live System User <nyc4bos@HIDDEN>
Subject: Re: bug#28687: 25.2; Error using term-handle-ansi-terminal-messages
References: <87mv58b6np.fsf@HIDDEN>
Date: Wed, 11 Oct 2017 22:33:54 -0400
In-Reply-To: <87mv58b6np.fsf@HIDDEN> (Live System User's message of "Tue, 03
 Oct 2017 11:19:38 -0400")
Message-ID: <87lgkhayct.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 28687
Cc: 28687 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

tags 28687 + unreproducible moreinfo
quit

Live System User <nyc4bos@HIDDEN> writes:

>         When trying to use `term-handle-ansi-terminal-messages`
>         as a template, a new command code is defined:

Do you mean you have defined some new function?  Please post a complete
example, not just fragments.

>         Most of the time thi works.
>=20=20=20=20=20=20=20=20=20
>         When it doesn't work as expected,

How often does it fail?

>            1. I get the error:
>=20
>               if: Symbol=E2=80=99s value as variable is void:
>               term-pending-delete-marker
>=20
> Debugger entered--Lisp error: (void-variable term-pending-delete-marker)
>   term-emulate-terminal(#<process test> "\nAnSiTe test\nAnSiTu liveuser\n=
AnSiTc /home/liveuser\nAnSiTh localhost.localdomain\n")
>=20

Seems like you might be running in the wrong buffer.
term-pending-delete-marker is only defined buffer-locally.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#28687; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Oct 2017 15:20:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 03 11:20:00 2017
Received: from localhost ([127.0.0.1]:46525 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dzOzH-0006FB-2u
	for submit <at> debbugs.gnu.org; Tue, 03 Oct 2017 11:20:00 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53119)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <nyc4bos@HIDDEN>) id 1dzOzE-0006Et-UT
 for submit <at> debbugs.gnu.org; Tue, 03 Oct 2017 11:19:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <nyc4bos@HIDDEN>) id 1dzOz8-00076Y-B7
 for submit <at> debbugs.gnu.org; Tue, 03 Oct 2017 11:19:51 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:44210)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <nyc4bos@HIDDEN>) id 1dzOz8-00076T-7Q
 for submit <at> debbugs.gnu.org; Tue, 03 Oct 2017 11:19:50 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44071)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <nyc4bos@HIDDEN>) id 1dzOz3-0001am-IF
 for bug-gnu-emacs@HIDDEN; Tue, 03 Oct 2017 11:19:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <nyc4bos@HIDDEN>) id 1dzOz0-00070y-8r
 for bug-gnu-emacs@HIDDEN; Tue, 03 Oct 2017 11:19:45 -0400
Received: from omr-m017e.mx.aol.com ([204.29.186.19]:53174)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <nyc4bos@HIDDEN>) id 1dzOz0-00070j-2S
 for bug-gnu-emacs@HIDDEN; Tue, 03 Oct 2017 11:19:42 -0400
Received: from mtaout-mad01.mx.aol.com (mtaout-mad01.mx.aol.com
 [172.26.221.205])
 by omr-m017e.mx.aol.com (Outbound Mail Relay) with ESMTP id 0D91138001F1
 for <bug-gnu-emacs@HIDDEN>; Tue,  3 Oct 2017 11:19:41 -0400 (EDT)
Received: from localhost.localdomain (c-73-16-70-190.hsd1.ma.comcast.net
 [73.16.70.190])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mtaout-mad01.mx.aol.com (MUA/Third Party Client Interface) with ESMTPSA id
 6B71B38000091
 for <bug-gnu-emacs@HIDDEN>; Tue,  3 Oct 2017 11:19:40 -0400 (EDT)
From: Live System User <nyc4bos@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.2; Error using term-handle-ansi-terminal-messages
Date: Tue, 03 Oct 2017 11:19:38 -0400
Message-ID: <87mv58b6np.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
x-aol-global-disposition: G
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.com;
 s=20150623; t=1507043981;
 bh=0k/LYVd1UNoVnO+S1J60MfLp5bg3RDa3O0S3aHFwaX4=;
 h=From:To:Subject:Message-ID:Date:MIME-Version:Content-Type;
 b=4Wpfk3Rgw9BgjzZbV9tNpKV3rMhT2/HsVd7zzygjnFhr2qfbDqgdVjZqPoE4YODF/
 HETRz7sAZbRC2en4absWF4VyWs/JKrGeDM9knJVQh48tTy/8uODfGQQmp7BUJ7Uw+J
 LROt4avfhqErvOaC3BiKXxEdUCPxqoRpXoLL8u/E=
x-aol-sid: 3039ac1addcd59d3aa8c1aa7
X-AOL-IP: 73.16.70.190
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)


Hi,

        When trying to use `term-handle-ansi-terminal-messages`
        as a template, a new command code is defined:

           ((=3D command-code ?e)
            (save-excursion
             (find-file-other-window argument))

        It gets invoked when string "\033AnSiTe" is sent, similar
        to this:

           echo -e "\033AnSiTe" test

        as well as with an alias defined for the process via
        `term-send-raw-string`:

                  (term-send-raw-string (format "
                    alias e=3D\'echo -e \"\\033AnSiTe\"\'
                   ")

        and invoked as:

           e test

        Most of the time thi works.
=20=20=20=20=20=20=20=20
        When it doesn't work as expected, one of the followig
        3 errors sometimes occurs:

           1. I get the error:

              if: Symbol=E2=80=99s value as variable is void:
              term-pending-delete-marker

Debugger entered--Lisp error: (void-variable term-pending-delete-marker)
  term-emulate-terminal(#<process test> "\nAnSiTe test\nAnSiTu liveuser\nAn=
SiTc /home/liveuser\nAnSiTh localhost.localdomain\n")


           2. The trailing "^M" of the argument gets swallowed up (omitted)
              before being passed to `term-handle-ansi-terminal-messages`,
              presumably by the function `term-send-raw-string`.
=20=20=20=20=20=20=20=20=20=20=20

           3. I get the error:

              term-send-raw-string: Not enough arguments for format string


        Thanks.





In GNU Emacs 25.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.20.10)
 of 2017-05-02 built on buildvm-17.phx2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.11803000
Configured using:
 'configure --build=3Dx86_64-redhat-linux-gnu
 --host=3Dx86_64-redhat-linux-gnu --program-prefix=3D
 --disable-dependency-tracking --prefix=3D/usr --exec-prefix=3D/usr
 --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdir=3D/etc
 --datadir=3D/usr/share --includedir=3D/usr/include --libdir=3D/usr/lib64
 --libexecdir=3D/usr/libexec --localstatedir=3D/var
 --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man
 --infodir=3D/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=3Dgtk3
 --with-gpm=3Dno --with-xwidgets --with-modules
 build_alias=3Dx86_64-redhat-linux-gnu host_alias=3Dx86_64-redhat-linux-gnu
 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=3Dformat-security
 -Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector-strong
 --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches
 -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric'
 LDFLAGS=3D-Wl,-z,relro
 PKG_CONFIG_PATH=3D:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=3Dibus
  locale-coding-system: utf-8-unix

Major mode: Buffer Menu

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
<mouse-6> is undefined
delete-backward-char: Text is read-only [2 times]
Quit [2 times]
Are you sure you want to quit reading news? (y or n) y
Saving /home/liveuser/.newsrc...done
Saving /home/liveuser/.newsrc.eld...
Saving file /home/liveuser/.newsrc.eld...
Wrote /home/liveuser/.newsrc.eld
Saving /home/liveuser/.newsrc.eld...done
Making completion list... [2 times]

Load-path shadows:
None found.

Features:
(shadow emacsbug sendmail shr-color color shr dom subr-x browse-url
debug nnagent nnml pp gnus-dup sort gnus-cite smiley ansi-color
mail-extr qp gnus-async gnus-bcklg gnus-ml disp-table cursor-sensor
nndraft nnmh nndoc mm-archive jka-compr timezone url-http url-gw
url-cache url-auth url-handlers utf-7 rfc2104 nnfolder network-stream
nsm starttls gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg nntp gnus-cache epa-file epa derived nnreddit mm-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse auth-source cl-seq eieio eieio-core
cl-macs url-vars json map seq byte-opt bytecomp byte-compile cl-extra
cconv gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap cl gv
sieve sieve-mode sieve-manage nnir gnus-sum gnus-group gnus-undo
gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc
parse-time gnus-spec gnus-int gnus-range message dired format-spec
rfc822 mml mml-sec password-cache epg epg-config mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
gmm-utils mailheader gnus-win gnus gnus-ems wid-edit nnoo nnheader
gnus-util mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib
mail-prsvr mail-utils time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting system-font-setting font-render-setting
xwidget-internal move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 236083 122162)
 (symbols 48 63122 319)
 (miscs 40 182 536)
 (strings 32 90731 96695)
 (string-bytes 1 2749359)
 (vectors 16 27592)
 (vector-slots 8 878323 106766)
 (floats 8 585 1448)
 (intervals 56 4719 696)
 (buffers 976 77)
 (heap 1024 61833 580652))




Acknowledgement sent to Live System User <nyc4bos@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#28687; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 17 Oct 2017 00:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.