From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#32390: [ipython 6.x] unmatched quotes break fontification in run-python Date: Wed, 05 Sep 2018 22:32:04 -0400 Message-ID: <8736ungxuj.fsf_-_@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536201073 32075 195.159.176.226 (6 Sep 2018 02:31:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Sep 2018 02:31:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 32390@debbugs.gnu.org To: Carlos Pita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 06 04:31:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxk4a-0008E7-Ez for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Sep 2018 04:31:08 +0200 Original-Received: from localhost ([::1]:59039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxk6g-00054i-2n for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Sep 2018 22:33:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxk6T-00050v-Vv for bug-gnu-emacs@gnu.org; Wed, 05 Sep 2018 22:33:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxk6Q-0002Id-Bv for bug-gnu-emacs@gnu.org; Wed, 05 Sep 2018 22:33:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxk6Q-0002Hv-1n for bug-gnu-emacs@gnu.org; Wed, 05 Sep 2018 22:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fxk6P-00022q-On for bug-gnu-emacs@gnu.org; Wed, 05 Sep 2018 22:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Sep 2018 02:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32390 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 32390-submit@debbugs.gnu.org id=B32390.15362011335986 (code B ref 32390); Thu, 06 Sep 2018 02:33:01 +0000 Original-Received: (at 32390) by debbugs.gnu.org; 6 Sep 2018 02:32:13 +0000 Original-Received: from localhost ([127.0.0.1]:47551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxk5d-0001YH-4M for submit@debbugs.gnu.org; Wed, 05 Sep 2018 22:32:13 -0400 Original-Received: from mail-qk1-f169.google.com ([209.85.222.169]:33084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxk5b-0001U2-Mr for 32390@debbugs.gnu.org; Wed, 05 Sep 2018 22:32:11 -0400 Original-Received: by mail-qk1-f169.google.com with SMTP id z78-v6so6357039qka.0 for <32390@debbugs.gnu.org>; Wed, 05 Sep 2018 19:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Ayy+U5VzrjkWe0q7LjMRWTXwOw5RG8PBoL36fQW0GxI=; b=KhUwqm2dtkCgZiSbGElXaykTDjYaG7Y0Ow2Th6QLIsNXzu4stnssphYRyv0rXul4G0 AResS6dP1IDP7HjrBOcrKMF+4UgHa/NweUeGe/d3hfIrjsutnpgHmNGJnB+mBo1vw2qL KcvXFtRe2gOG+80AKG8JhpcjsSYVpdaMKxnhdbr8nA9wK865YazC37e3xorMrhxalDVd TEWXqtmILofp1aPEYr3RQ/5/fFluvc8HkZ0pcP1niux2ZIN5jew3HKYC/WNeVf5GQrD9 TBcat2hjUq69h+n+aABTNf9ZP/vz8P0Uw9xUhN6yCXvu0YkH0vedQitc0HpAu/ehctJ3 XvXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Ayy+U5VzrjkWe0q7LjMRWTXwOw5RG8PBoL36fQW0GxI=; b=HeLWaP/j+39R/bzqE/ITlrZ77knDdRuQO9uJUIjN5WnnXgBQnvLltZbDSx41tZRR6D itpftES9eZ6ZMjRRC4hF55yLrMkfYy2bB+DkYkQnR5dYrWZtAmU+uWnSrhElLlYqgqdn 1IZe1JK9eej6OIxKCtyetj+E8vCew89mWNnlMHols7OMVmHEhj0WGKGoQv8B5fFoEq3t x7jUIy4Trt2W0heeNgJVt9sU5eEFoXsGxCPE70K5hSrG3lwymfPwp3aLIR2aucXNi6tQ 4cRJlGDl2+AeiJPz92PPpf665h5rc9BmdHT0WELWhzlPnAmXgeM/PTHVZ1W66tEEVtAz 8gZQ== X-Gm-Message-State: APzg51DYiRJjd7KC2bsxkmL2C0HFuKdHXqNAgdoS/SlusrQpQW50GXNL cNh779Vj0t+EAbAcUlBji8IHzY+u X-Google-Smtp-Source: ANB0VdbEW2gtCn6dkuopGwEKxnzB1x8OJkvLx+Zqh8yJvhmQUWzPUK1RDUHlXzDu7mD17xeja4uSOQ== X-Received: by 2002:a37:8ac5:: with SMTP id m188-v6mr403756qkd.297.1536201126256; Wed, 05 Sep 2018 19:32:06 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id p18-v6sm2493227qtp.3.2018.09.05.19.32.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Sep 2018 19:32:05 -0700 (PDT) In-Reply-To: (Carlos Pita's message of "Tue, 7 Aug 2018 16:52:44 -0300") 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: 208.118.235.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:150067 Archived-At: Carlos Pita writes: > Why not simply: > > (python-shell-comint-end-of-output-p > (ansi-color-filter-apply output))) > > ? > > What is the problem when just an input prompt is retrieved (that is, > the 0 case in (nil 0))? I guess that's the "not just a prompt" in the comment: ;; Is end of output and is not just a prompt. But it seems that python.el is assuming a certain chunking of output from the subprocess, which is really not a safe assumptiong. And ipython 6 breaks it. > The current condition is also failing for multiline input. Consider: > > > In [154]: def f(): > ...: 'ewewe > ...: > > output is " ...:" so it's not considered just an input prompt > (because of the preceding whitespace) and so the font lock buffer is > wrongly cleaned up (indeed, this is the only case I'm able to figure > out for which you don't want to cleanup the buffer). > > I think the condition should be reformulated to match any expression > that ends with an input prompt excluding a continuation prompt. This > would fix both problems: > > 1. An expression that is just an input prompt (for example, ansi > filtered errors) will trigger a cleanup. > 2. A continuation input prompt will not be considered the start of > a new input. This sounds quite sensible to me.