unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Don Hopkins <don@donhopkins.com>, Lars Ingebrigtsen <larsi@gnus.org>
Cc: 3735@debbugs.gnu.org, dsb@smart.net, Chong Yidong <cyd@gnu.org>,
	18135@debbugs.gnu.org, Don Hopkins <don@donhopkins.com>
Subject: bug#18135: bug#3735: shell-mode editing, movement, and command entry broken by prompt/output changes
Date: Sun, 05 Dec 2021 17:13:06 +0100	[thread overview]
Message-ID: <87bl1v3u99.fsf@miha-pc> (raw)
In-Reply-To: <33D68609-31C2-465C-8718-667B5F51B50E@donhopkins.com>

[-- Attachment #1: Type: text/plain, Size: 2033 bytes --]

Don Hopkins <don@donhopkins.com> writes:

> Thanks for looking into this! 
>
> I can’t reproduce the problem through that recipe, but weird things still happen in other situations. 
>
> Try putting “ -la” in the kill buffer and then yanking it instead of typing it at the end of the output of “echo ls”. 
>
> It totally ignores the whole line, as if you entered an empty line.
>
> But the thing that usually happens to me is that it enters the text that I yanked, but I’m not sure what the exact conditions to trigger it are. 
>
> But at any rate, yanking “ -la” and hitting return should have the exact same behavior as typing “ -la” and hitting return, so it’s probably caused by the same underlying problem.
>
> I’ll let you know if I figure out other test cases that get it to enter the text you yanked but not the text before that. It usually has something to do with yanking text, possibly at the end or also in the middle of the line.

Reproducer:

- copy " -la" into kill ring
- type "echo ls" into M-x shell
- (Shell gives output line "ls".)
- Go up to output line "ls" (C-p).
- yank " -la"
- press C-b
- the line now "ls -la" with point after "l"
- press RET

Only " -la" is sent to the process instead of "ls -la"

This is because the 'field' text property of "ls" is 'output' but the
" -la" is inserted with insert-for-yank and doesn't have a 'field' text
property.

A similar thing happens if we insert a space using M-SPC
(just-one-space) in the middle of process output. The space is inserted
with 'insert' and doesn't inherit the 'field' text property of the
surrounding text.

This didn't cause a problem in older Emacs because the field text
property wasn't used yet at that time in comint.

I am willing to write up a patch to fix this. I'm thinking of having
comint-mode register a function in after-change-functions to mark text
inserted in the 'output' field as 'output'. Would this be okay or are
there any obvious flaws with this approach?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  reply	other threads:[~2021-12-05 16:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 12:52 bug#18135: Emacs bug # 3735 definitely not fixed (5 years later) Don Hopkins
2017-05-06 14:46 ` Chong Yidong
2021-12-04 21:15   ` bug#18135: bug#3735: shell-mode editing, movement, and command entry broken by prompt/output changes Lars Ingebrigtsen
2021-12-04 22:18     ` Don Hopkins
2021-12-05 16:13       ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-12-05 19:27         ` Lars Ingebrigtsen
2021-12-07 16:57           ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-07 20:16             ` bug#3735: " Lars Ingebrigtsen
2021-12-08  0:20               ` Don Hopkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl1v3u99.fsf@miha-pc \
    --to=bug-gnu-emacs@gnu.org \
    --cc=18135@debbugs.gnu.org \
    --cc=3735@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=don@donhopkins.com \
    --cc=dsb@smart.net \
    --cc=larsi@gnus.org \
    --cc=miha@kamnitnik.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).