From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Live System User Newsgroups: gmane.emacs.bugs Subject: bug#28687: 25.2; Error using term-handle-ansi-terminal-messages Date: Mon, 16 Oct 2017 04:01:56 -0400 Message-ID: <877evvpll7.fsf@aol.com> References: <87mv58b6np.fsf@aol.com> <87lgkhayct.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1508141005 13999 195.159.176.226 (16 Oct 2017 08:03:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Oct 2017 08:03:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 28687@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 16 10:03:18 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e40Me-0001Tv-6i for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Oct 2017 10:03:08 +0200 Original-Received: from localhost ([::1]:59833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e40Ml-00083f-Mu for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Oct 2017 04:03:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e40Mf-00083Z-Rw for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 04:03:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e40MZ-0002Rb-Og for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 04:03:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33760) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e40MZ-0002RS-Ix for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 04:03:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e40MZ-0008Os-5n for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 04:03:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Live System User Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Oct 2017 08:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28687 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: unreproducible moreinfo Original-Received: via spool by 28687-submit@debbugs.gnu.org id=B28687.150814092632224 (code B ref 28687); Mon, 16 Oct 2017 08:03:02 +0000 Original-Received: (at 28687) by debbugs.gnu.org; 16 Oct 2017 08:02:06 +0000 Original-Received: from localhost ([127.0.0.1]:42441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e40Le-0008Nf-8u for submit@debbugs.gnu.org; Mon, 16 Oct 2017 04:02:06 -0400 Original-Received: from omr-a003e.mx.aol.com ([204.29.186.57]:34809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e40Lc-0008NB-2V for 28687@debbugs.gnu.org; Mon, 16 Oct 2017 04:02:04 -0400 Original-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) Original-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) In-Reply-To: <87lgkhayct.fsf@users.sourceforge.net> (Noam Postavsky's message of "Wed, 11 Oct 2017 22:33:54 -0400") 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138503 Archived-At: --=-=-= Content-Type: text/plain Noam Postavsky writes: > tags 28687 + unreproducible moreinfo > quit > > Live System User 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(# "\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. --=-=-=--