From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Carlos Pita Newsgroups: gmane.emacs.bugs Subject: bug#33959: 26.1.90; python.el font-lock buffer wreaks havoc when company is enabled Date: Tue, 16 Apr 2019 19:14:55 -0300 Message-ID: References: <87zhp5ch5n.fsf_-_@gmail.com> <87pnply5da.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="236308"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 33959@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 17 00:16:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGWNC-000zNI-Mn for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Apr 2019 00:16:14 +0200 Original-Received: from localhost ([127.0.0.1]:43539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGWNB-0005dX-ON for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Apr 2019 18:16:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGWN5-0005d5-85 for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2019 18:16:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGWN3-0003hK-Bb for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2019 18:16:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53371) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hGWN0-0003eK-3a for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2019 18:16:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hGWMz-000784-SZ for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2019 18:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Carlos Pita Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Apr 2019 22:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33959 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 33959-submit@debbugs.gnu.org id=B33959.155545291727347 (code B ref 33959); Tue, 16 Apr 2019 22:16:01 +0000 Original-Received: (at 33959) by debbugs.gnu.org; 16 Apr 2019 22:15:17 +0000 Original-Received: from localhost ([127.0.0.1]:38682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hGWMG-00076z-MP for submit@debbugs.gnu.org; Tue, 16 Apr 2019 18:15:16 -0400 Original-Received: from mail-yb1-f178.google.com ([209.85.219.178]:39577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hGWMC-00076h-UY for 33959@debbugs.gnu.org; Tue, 16 Apr 2019 18:15:15 -0400 Original-Received: by mail-yb1-f178.google.com with SMTP id x71so7840715ybe.6 for <33959@debbugs.gnu.org>; Tue, 16 Apr 2019 15:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=StFmofN0tNf6tSbMfz6j87a2oAyxLOchlsDs2Yojs7Y=; b=h3h8s5Uj+YuRlc+u9sbLECvV3jS8zEXP7IddDBUBOf3p5dTbhKJm8xlQi9IN6pswBC j4XQaesiqMJA1L9CifQUQvhctb1AryWXMqaxW7hDh3PrVHiY465bhJ29VtlOliaPuDxb mzjMyQoUaK30Y9ITkblKgFNS25h1pha/rI8ngRABSi3fBq4CKQwL7HYbxSQUjdsSR+DH 7AdgOX0utTu1NlYkDRA1hi9pppJqbe73ohNSMy4AOvkHjS3JuYlHV4NvzHjKYwxNrmPR qmtdVyusg9HKVXtMtGbXBT9HJfyGt2C/aXaj/KlY6P1nIyNu7Cii30AKUGOrzyZA3vTR yHpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=StFmofN0tNf6tSbMfz6j87a2oAyxLOchlsDs2Yojs7Y=; b=Ux2Rs2X459bVVxhYUJUiSUeCXcwH+26QDH++b0SN93A15kUxIXmrZFSjyI8A95uc2F Md7Ewd2gBGQ8S5XVc3YfvI2UiwmznbYkn4+eA/mGBq0KvT5KG9hQfOaV137RqvlMbwjl 2c/prbGU1ma0n2hCMW+tyxl2W6BONba0aO9jKDVhay3wkIRWpnQle4YiNZWfAiTazM8c GvB+cY+yyYhlHc/h6N+0Q38Cw/7xiIU00xFg4z2L/Xxbi6Yjl+N+2AcmJ2L76mojco6D mwMLW7mG1lXYrzkwdLgegfCFKiUMiNlwDPlPS8JPlIGXMm1FjK9SX5mnLPfW9lVJ2zHq QG8g== X-Gm-Message-State: APjAAAWddZxe6ZmDafFpwPJlIFaQNGxA3XUnHvPUSOAIeVjLEXT5e0Wy yHyuVXBWL2hGU6uyFFefoT17YQR5Lxa9+KglkBQ= X-Google-Smtp-Source: APXvYqyHXxmV1Q5glK+xnHaXuc2pmqNXo+hzvx6VPILtu4mZ6zXLTtezA4JwcDUJB58/H1AZs5vo5C+yRoT8R95GS2Y= X-Received: by 2002:a25:850e:: with SMTP id w14mr1547120ybk.13.1555452907340; Tue, 16 Apr 2019 15:15:07 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:157748 Archived-At: I'm unable to get your output, here the font lock buffer always contains one line. Nevertheless, I don't quite understand your example. Here: In [14]: 1 + len('123') + 99 + len('aa') In [14]: 1 + len('123') + 99 + len('aa') Out[14]: 105 How do you manage to have two input lines with the same prompt number? Is that an artifact of copy pasting from the REPL? If it is, if your example just consists of successively sending the line `1 + len('123') + 99 + len('aa')` many times, I'm unable to reproduce the case (after my patch is applied, that is, with this definition (defun python-shell-font-lock-comint-output-filter-function (output) "Clean up the font-lock buffer after any OUTPUT." (unless (string= output "") (if (let ((output (ansi-color-filter-apply output))) (and (python-shell-comint-end-of-output-p output) (not (string-match "\\.\\.\\." output)))) ;; If output ends with an initial (not continuation) input prompt ;; then the font-lock buffer must be cleaned up. (python-shell-font-lock-cleanup-buffer) ;; Otherwise just add a newline. (python-shell-font-lock-with-font-lock-buffer (goto-char (point-max)) (newline))) output)) ) On Tue, Apr 16, 2019 at 7:08 PM Carlos Pita wrote: > > > The above state happens after I've applied your patch #2. > > Ah, ok! I hadn't understood that was *after* applying the patch. Let > me try to reproduce your example then.