Subject: bug#67023: comint comments commend field=input

From: JD Smith <[email-masked]>
Date: Thu, 9 Nov 2023 13:24:36 -0500

comint.el contains the following comment at line 1959, applicable when comint-use-prompt-regexp=nil:

                ;; Give old user input a field property of `input', to
                ;; distinguish it from both process output and unsent
                ;; input.  The terminating newline is put into a special
                ;; `boundary' field to make cursor movement between input
                ;; and output fields smoother.

But this is not actually done.  Just as for unsent input at the process mark, old input has text property field=nil.

I traced it back and this change was made in Emacs 22, at the same time overlay properties for the various comint fields were replaced by text properties.  Perhaps this is the desired behavior, and only fixing the comments is required.  However, the stated rationale to “distinguish from output and current unsent input” still seems applicable.  

Note that `comint-next-prompt’ checks explicitly for a null field value to know when it has moved past a prompt.  Comments in that function erroneously mention field=nil as pertaining only to unsent input at the end of the comint buffer.