From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christopher Schmidt Newsgroups: gmane.emacs.bugs Subject: bug#14744: 24.3.50; Flickering mouse-face on process output Date: Sat, 3 Aug 2013 13:25:39 +0100 (BST) Message-ID: <87k3k37yg6@ch.ristopher.com> References: <87r4flzshg@ch.ristopher.com> <83k3lde4v7.fsf@gnu.org> <87ip0xw8nw@ch.ristopher.com> <83d2r5dtzk.fsf@gnu.org> <87txkhf52j@ch.ristopher.com> <838v1tdlhh.fsf@gnu.org> <87vc3n861z@ch.ristopher.com> <83ioznxdq2.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1375532837 25146 80.91.229.3 (3 Aug 2013 12:27:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Aug 2013 12:27:17 +0000 (UTC) To: 14744@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 03 14:27:17 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V5avT-0003Yr-A5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Aug 2013 14:27:15 +0200 Original-Received: from localhost ([::1]:43227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5avS-0003Pc-J6 for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Aug 2013 08:27:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5avM-0003PT-4V for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 08:27:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5avH-0001a0-Af for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 08:27:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5avH-0001Zt-7Q for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 08:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V5avF-0002cI-UU for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 08:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christopher Schmidt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Aug 2013 12:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14744 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13755327729971 (code B ref -1); Sat, 03 Aug 2013 12:27:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Aug 2013 12:26:12 +0000 Original-Received: from localhost ([127.0.0.1]:37844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V5auM-0002ad-Lo for submit@debbugs.gnu.org; Sat, 03 Aug 2013 08:26:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55352) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V5auI-0002a3-Eg for submit@debbugs.gnu.org; Sat, 03 Aug 2013 08:26:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5au8-0001OC-Jb for submit@debbugs.gnu.org; Sat, 03 Aug 2013 08:25:57 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5au8-0001O6-G2 for submit@debbugs.gnu.org; Sat, 03 Aug 2013 08:25:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5au3-0003Mj-Tv for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 08:25:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5aty-0001Lb-FK for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 08:25:47 -0400 Original-Received: from ristopher.com ([146.185.21.93]:45519 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5atx-0001KR-MG for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 08:25:41 -0400 Original-Received: by saturn.ch.ristopher.com (Postfix, from userid 0) id 87D94203E4; Sat, 3 Aug 2013 13:25:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com; s=mail; t=1375532739; bh=YSoCUlz010qcBWKj9ovzACVgE5hNW4dDkSTgHFWkBCY=; h=From:To:Subject:In-Reply-To:Message-ID:References:MIME-Version: Content-Type:Date; b=VETJSpMcpJs4kB/ClenMApQ+wGUN5d9UTufMubmjvv6VFy2H0Apf+kt+jVtmdb1kD jSP9BNzy6Os72pF1EfiSS7VGvLk4SjFjCeuGojDd4y6F92hFRVm/qhv/5EJz2hab9C DeOih1Bmv9O2oGVMbMju19GVKTVL+obaWvhN7X/w= In-Reply-To: <83ioznxdq2.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 03 Aug 2013 13:36:53 +0300") Mail-Followup-To: bug-gnu-emacs@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:76925 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > In the absence of a solution for all of them, fixing some of them > would be good nevertheless. comint is a widely used infrastructure, > so modifying it is likely to solve quite a few of those cases. How about this: --=-=-= Content-Type: text/x-diff Content-Disposition: inline --- lisp/comint.el +++ lisp/comint.el @@ -636,7 +636,7 @@ (setq-local comint-last-input-start (point-min-marker)) (setq-local comint-last-input-end (point-min-marker)) (setq-local comint-last-output-start (make-marker)) - (make-local-variable 'comint-last-prompt-overlay) + (make-local-variable 'comint-last-prompt) (make-local-variable 'comint-prompt-regexp) ; Don't set; default (make-local-variable 'comint-input-ring-size) ; ...to global val. (make-local-variable 'comint-input-ring) @@ -1902,21 +1902,24 @@ "If nil, Comint will interpret `carriage control' characters in output. See `comint-carriage-motion' for details.") -;; When non-nil, this is an overlay over the last recognized prompt in -;; the buffer; it is used when highlighting the prompt. -(defvar comint-last-prompt-overlay nil) +(defvar comint-last-prompt nil + "Markers pointing to the last prompt. +If non-nil, a cons cell containing markers. The car points to +the start, the cdr to the end of the last prompt recognized.") (defun comint-snapshot-last-prompt () - "`snapshot' any current `comint-last-prompt-overlay'. -Freeze its attributes in place, even when more input comes along -and moves the prompt overlay." - (when comint-last-prompt-overlay - (let ((inhibit-read-only t)) - (with-silent-modifications - (add-text-properties - (overlay-start comint-last-prompt-overlay) - (overlay-end comint-last-prompt-overlay) - (overlay-properties comint-last-prompt-overlay)))))) + "Snapshot the current `comint-last-prompt'. +Freezes the `font-lock-face' text property in place." + (when comint-last-prompt + (with-silent-modifications + (add-text-properties + (car comint-last-prompt) + (cdr comint-last-prompt) + '(font-lock-face comint-highlight-prompt))) + ;; Reset comint-last-prompt so later on comint-output-filter does + ;; not remove the font-lock-face text property of the previous + ;; (this) prompt. + (setq comint-last-prompt nil))) (defun comint-carriage-motion (start end) "Interpret carriage control characters in the region from START to END. @@ -2063,20 +2066,15 @@ (add-text-properties prompt-start (point) '(read-only t rear-nonsticky t front-sticky (read-only))))) - (unless (and (bolp) (null comint-last-prompt-overlay)) - ;; Need to create or move the prompt overlay (in the case - ;; where there is no prompt ((bolp) == t), we still do - ;; this if there's already an existing overlay). - (if comint-last-prompt-overlay - ;; Just move an existing overlay - (move-overlay comint-last-prompt-overlay - prompt-start (point)) - ;; Need to create the overlay - (setq comint-last-prompt-overlay - (make-overlay prompt-start (point))) - (overlay-put comint-last-prompt-overlay - 'font-lock-face 'comint-highlight-prompt)))) - + (when comint-last-prompt + (remove-text-properties (car comint-last-prompt) + (cdr comint-last-prompt) + '(font-lock-face))) + (setq comint-last-prompt + (cons (copy-marker prompt-start) (point-marker))) + (add-text-properties (car comint-last-prompt) + (cdr comint-last-prompt) + '(font-lock-face comint-highlight-prompt))) (goto-char saved-point))))))) (defun comint-preinput-scroll-to-bottom () --=-=-= Content-Type: text/plain Christopher --=-=-=--