From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#47603: comint sets '(rear-nonsticky t) on entire prompt, disabling 'cursor-intangible Date: Mon, 12 Apr 2021 22:49:55 -0400 Message-ID: References: <3D036269-3D25-4F05-8B1E-BF9CB1956326@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22221"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 47603-done@debbugs.gnu.org To: JD Smith Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 13 04:51:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lW98y-0005gs-7o for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Apr 2021 04:51:12 +0200 Original-Received: from localhost ([::1]:39370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW98x-00077B-7c for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Apr 2021 22:51:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW98o-00073l-GG for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2021 22:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lW98o-0004iR-7r for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2021 22:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lW98o-0002Z4-6u for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2021 22:51:02 -0400 Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Apr 2021 02:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 47603 X-GNU-PR-Package: emacs Mail-Followup-To: 47603@debbugs.gnu.org, monnier@iro.umontreal.ca, jdtsmith@gmail.com Original-Received: via spool by 47603-done@debbugs.gnu.org id=D47603.16182822079780 (code D ref 47603); Tue, 13 Apr 2021 02:51:01 +0000 Original-Received: (at 47603-done) by debbugs.gnu.org; 13 Apr 2021 02:50:07 +0000 Original-Received: from localhost ([127.0.0.1]:58571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lW97u-0002Xg-Sj for submit@debbugs.gnu.org; Mon, 12 Apr 2021 22:50:07 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lW97s-0002X6-9h for 47603-done@debbugs.gnu.org; Mon, 12 Apr 2021 22:50:04 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id BB95F1001D2; Mon, 12 Apr 2021 22:49:58 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E043D100040; Mon, 12 Apr 2021 22:49:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1618282196; bh=E91dfZ1T7caPuGW+NfcgopdBXJNJEFo+6JRogWVoHRk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=K7/k2AP9dxLxz4Z+EV8r1wGu4kRfyMgI5eKWzZzTTequykOXSW8ZnAya4vj4oZ0Sz Af33V1xFKwpNavAW+6uSwvB6df5VzPn2QYtaPTOP2SBbcnWyZjLaZvvT4t5xsow2qt 7sdi9VsclLNXXlgAdylv9+ETVv0lVkFh7dYDxR8HyAAdlwUnL/JNwz0xV5NjaaCsYS wnwn4MwVPAwi5/em8uj/S8zm/A4rLPpLu91QdTibaOxXDjfZInlnGoRAjiVCwGOmd0 YL2OcV2zxOreYkdp+ed3XWP+uVBHz0Tnn1lwLfATdoieUnZ18mTFzZOJUsBJkzODvs xA4QW5SpR6bQA== Original-Received: from alfajor (104-222-126-84.cpe.teksavvy.com [104.222.126.84]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B164C1204C5; Mon, 12 Apr 2021 22:49:56 -0400 (EDT) In-Reply-To: <3D036269-3D25-4F05-8B1E-BF9CB1956326@gmail.com> (JD Smith's message of "Mon, 5 Apr 2021 14:07:17 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203942 Archived-At: > Comint sets =E2=80=98(rear-nonsticky t) on the entire detected prompt tex= t, which > prevents `cursor-intangible from functioning correctly when applied to the > prompt. As Stefan put it: I fixed it a while back but forgot the `font-lock-face` property in the list of properties to add to `rear-nonstick` so I just added the patch below to `master`. I believe this should now do it. Stefan diff --git a/lisp/comint.el b/lisp/comint.el index 2745c5a26f..b90e6354d8 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1797,6 +1797,9 @@ comint-add-to-input-history (min size (- comint-input-ring-size size))))) (ring-insert comint-input-ring cmd))) =20 +(defconst comint--prompt-rear-nonsticky + '(field inhibit-line-move-field-capture read-only font-lock-face)) + (defun comint-send-input (&optional no-newline artificial) "Send input to process. After the process output mark, sends all text from the process mark to @@ -1916,8 +1919,8 @@ comint-send-input (unless (or no-newline comint-use-prompt-regexp) ;; Cover the terminating newline (add-text-properties end (1+ end) - '(rear-nonsticky - (field inhibit-line-move-field-captur= e read-only) + `(rear-nonsticky + ,comint--prompt-rear-nonsticky field boundary inhibit-line-move-field-capture t))))) =20 @@ -2124,10 +2127,10 @@ comint-output-filter (unless comint-use-prompt-regexp (with-silent-modifications (add-text-properties comint-last-output-start (point) - '(front-sticky + `(rear-nonsticky + ,comint--prompt-rear-nonsticky + front-sticky (field inhibit-line-move-field-capture) - rear-nonsticky - (field inhibit-line-move-field-capture read-only) field output inhibit-line-move-field-capture t)))) =20 @@ -2157,8 +2160,8 @@ comint-output-filter 'font-lock-face 'comint-highlight-prompt) (add-text-properties prompt-start (point) - '(rear-nonsticky - (field inhibit-line-move-field-capture read-= only)))) + `(rear-nonsticky + ,comint--prompt-rear-nonsticky))) (goto-char saved-point))))))) =20 (defun comint-preinput-scroll-to-bottom ()