From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#31236: [PATCH] Fix pre- and post-command-hook errors in term.el Date: Sun, 22 Apr 2018 23:48:38 +1200 Message-ID: <2d991a6252dce5fd911a26e6a994a666@webmail.orcon.net.nz> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1524397626 29826 195.159.176.226 (22 Apr 2018 11:47:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Apr 2018 11:47:06 +0000 (UTC) User-Agent: Orcon Webmail Cc: bug-gnu-emacs , 31236@debbugs.gnu.org To: Karl Otness Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 22 13:47:02 2018 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 1fADSO-0007dN-T0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Apr 2018 13:47:01 +0200 Original-Received: from localhost ([::1]:51338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fADUV-00035B-Io for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Apr 2018 07:49:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fADUP-00033p-NN for bug-gnu-emacs@gnu.org; Sun, 22 Apr 2018 07:49:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fADUM-00088O-Lv for bug-gnu-emacs@gnu.org; Sun, 22 Apr 2018 07:49:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55802) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fADUM-000889-J7 for bug-gnu-emacs@gnu.org; Sun, 22 Apr 2018 07:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fADUM-0001Jq-73 for bug-gnu-emacs@gnu.org; Sun, 22 Apr 2018 07:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Apr 2018 11:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31236 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 31236-submit@debbugs.gnu.org id=B31236.15243977245043 (code B ref 31236); Sun, 22 Apr 2018 11:49:02 +0000 Original-Received: (at 31236) by debbugs.gnu.org; 22 Apr 2018 11:48:44 +0000 Original-Received: from localhost ([127.0.0.1]:35466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fADU3-0001JG-OT for submit@debbugs.gnu.org; Sun, 22 Apr 2018 07:48:43 -0400 Original-Received: from smtp-2.orcon.net.nz ([60.234.4.43]:33470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fADU1-0001J8-Sg for 31236@debbugs.gnu.org; Sun, 22 Apr 2018 07:48:42 -0400 Original-Received: from [10.253.37.70] (port=35304 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1fADTy-0001k7-VM; Sun, 22 Apr 2018 23:48:39 +1200 Original-Received: from [150.107.175.173] via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Sun, 22 Apr 2018 23:48:38 +1200 In-Reply-To: X-Sender: psainty@orcon.net.nz X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- 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:145665 Archived-At: Bug and proposed fix confirmed and tested here. This was an oversight on my part from #24837. The suggested patch seems sensible to me. If others agree, I think this should be committed to the emacs-26 branch. -Phil On 2018-04-22 15:41, Karl Otness wrote: > As far as I can tell there isn't an existing bug report for this > issue. It is very minor but I have attached a fix. This affects Emacs > 26.1-rc1 `term' and `ansi-term'. In char mode term installs functions > in both pre- and post-command-hooks. After the process exits both of > these hooks produce errors and then are removed by Emacs after > printing a message. > > Both of these hooks are re-installed when entering char mode and > removing them if they are not present will do nothing. To produce this > change, I took the remove-hook lines used when entering line mode and > placed them in `term-handle-exit'. > > To reproduce the issue in 26.1, M-x term, exit the running process and > execute any command (i.e. move point). In *Messages* there should be > the following lines: > > Error in pre-command-hook (term-set-goto-process-mark): > (wrong-type-argument processp nil) > Error in post-command-hook (term-goto-process-mark-maybe): > (wrong-type-argument processp nil) > > The error seems to come up from `process-mark'. After this change, > these errors no longer appear as the hooks are removed. I have > attached a patch which applies this change to current master. > > Thank you, > Karl