GNU bug report logs - #31236
[PATCH] Fix pre- and post-command-hook errors in term.el

Previous Next

Package: emacs;

Reported by: Karl Otness <karl <at> karlotness.com>

Date: Sun, 22 Apr 2018 05:41:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31236 in the body.
You can then email your comments to 31236 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31236; Package emacs. (Sun, 22 Apr 2018 05:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Karl Otness <karl <at> karlotness.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 22 Apr 2018 05:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Karl Otness <karl <at> karlotness.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Fix pre- and post-command-hook errors in term.el
Date: Sat, 21 Apr 2018 23:41:51 -0400
[Message part 1 (text/plain, inline)]
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
[0001-Fix-pre-and-post-command-hook-errors-in-term.el.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31236; Package emacs. (Sun, 22 Apr 2018 11:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 31236 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Karl Otness <karl <at> karlotness.com>
Cc: bug-gnu-emacs <bug-gnu-emacs-bounces+psainty=orcon.net.nz <at> gnu.org>,
 31236 <at> debbugs.gnu.org
Subject: Re: bug#31236: [PATCH] Fix pre- and post-command-hook errors in
 term.el
Date: Sun, 22 Apr 2018 23:48:38 +1200
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





Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sun, 22 Apr 2018 17:10:02 GMT) Full text and rfc822 format available.

Notification sent to Karl Otness <karl <at> karlotness.com>:
bug acknowledged by developer. (Sun, 22 Apr 2018 17:10:02 GMT) Full text and rfc822 format available.

Message #13 received at 31236-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: 31236-done <at> debbugs.gnu.org, karl <at> karlotness.com
Subject: Re: bug#31236: [PATCH] Fix pre- and post-command-hook errors in
 term.el
Date: Sun, 22 Apr 2018 20:09:22 +0300
> Date: Sun, 22 Apr 2018 23:48:38 +1200
> From: Phil Sainty <psainty <at> orcon.net.nz>
> Cc: bug-gnu-emacs <bug-gnu-emacs-bounces+psainty=orcon.net.nz <at> gnu.org>,
> 	31236 <at> debbugs.gnu.org
> 
> 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.

Pushed, thanks.

Karl, in the future please include a commit log message according to
the instructions in CONTRIBUTE.  (I fixed that for you this time.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31236; Package emacs. (Sun, 22 Apr 2018 18:56:01 GMT) Full text and rfc822 format available.

Message #16 received at 31236-done <at> debbugs.gnu.org (full text, mbox):

From: Karl Otness <karl <at> karlotness.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Phil Sainty <psainty <at> orcon.net.nz>, 31236-done <at> debbugs.gnu.org
Subject: Re: bug#31236: [PATCH] Fix pre- and post-command-hook errors in
 term.el
Date: Sun, 22 Apr 2018 14:54:59 -0400
Will do, my mistake. Thank you for fixing it up.

Karl

On Sun, Apr 22, 2018 at 1:09 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> Date: Sun, 22 Apr 2018 23:48:38 +1200
>> From: Phil Sainty <psainty <at> orcon.net.nz>
>> Cc: bug-gnu-emacs <bug-gnu-emacs-bounces+psainty=orcon.net.nz <at> gnu.org>,
>>       31236 <at> debbugs.gnu.org
>>
>> 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.
>
> Pushed, thanks.
>
> Karl, in the future please include a commit log message according to
> the instructions in CONTRIBUTE.  (I fixed that for you this time.)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 21 May 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 33 days ago.

Previous Next


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