From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Newsgroups: gmane.emacs.bugs Subject: bug#28808: [PATCH] Implement Python backend for Flymake Date: Sat, 14 Oct 2017 10:14:31 +0100 Message-ID: <87fuamks5k.fsf@gmail.com> References: <87bmlan4w6.fsf@gmail.com> <87zi8ulpzg.fsf_-_@gmail.com> <877evyywjs.fsf@metapensiero.it> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507972516 6015 195.159.176.226 (14 Oct 2017 09:15:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 14 Oct 2017 09:15:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 28808@debbugs.gnu.org To: Lele Gaifax Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 14 11:15:08 2017 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 1e3IXD-0008Ux-Mn for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Oct 2017 11:15:07 +0200 Original-Received: from localhost ([::1]:53312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3IXH-0006IH-UZ for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Oct 2017 05:15:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3IXB-0006Hc-Vz for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 05:15:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3IX8-0003O4-Qy for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 05:15:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58375) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3IX8-0003Ng-MJ for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 05:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e3IX8-0003n9-2L for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 05:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2017 09:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28808 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 28808-submit@debbugs.gnu.org id=B28808.150797248214526 (code B ref 28808); Sat, 14 Oct 2017 09:15:02 +0000 Original-Received: (at 28808) by debbugs.gnu.org; 14 Oct 2017 09:14:42 +0000 Original-Received: from localhost ([127.0.0.1]:38822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3IWn-0003mE-Qz for submit@debbugs.gnu.org; Sat, 14 Oct 2017 05:14:42 -0400 Original-Received: from mail-wm0-f54.google.com ([74.125.82.54]:52759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3IWm-0003m1-78 for 28808@debbugs.gnu.org; Sat, 14 Oct 2017 05:14:40 -0400 Original-Received: by mail-wm0-f54.google.com with SMTP id k4so25576302wmc.1 for <28808@debbugs.gnu.org>; Sat, 14 Oct 2017 02:14:40 -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=idX8iv0XCO86IhYCXkiXY7Qlpr1wmIxEaZmWnEVpo60=; b=s8Ro9asuDLCuHGhq0v4hztNatt5pWtoCoj1ChbsFFWHn+UhfCRp8QntGQ601IvrSfR tYJqgfzduqnee8CKpdeWhrd+/1mvSLldJwufbf9WHfQ9kfMy4dgsBKQV0GYHZTpk3U6Z Q2P3TYzygVqQtpxe3Oi8XtAEw8fe1wAI+UziRFt0LB8lXe3dSX3VTBsMDNDM6AWwFkD2 wddBNIgi3hqWI161WftupOhnnfCzDjMVOKZt6Y+iN8w5PT49Nj2jcni3lPViyrA8yy2+ KAzRYJ4hpjBXlHTWVWBwS8CRmtleJeejhgr8ccz7RM9RV/Qnoby3WyCuHsFcfM9YYwyF DTRw== 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=idX8iv0XCO86IhYCXkiXY7Qlpr1wmIxEaZmWnEVpo60=; b=r/YGqOKw8uFzrs7nhnVpqLFpYpr+x4c1y8LqQgUna2DbKM3bh440PzTgNLRzm66ILE +ZfqAkIMxbzY/FxCdDHAbLh/2K8rrVfwK/GKAuEjNef2lLnS9eLDOJmS894laVBgI4nR miJgJwtB4IQeTAvIvyZbq0iQ+Bx0b/Z0E1tkzqAlG7Qbwpt933RaPD8vCgrc7jIxf2A5 FKl8DqjnKxiPcZgNca5ZogmVtBjaVvy3cGWiibnP0Csf80r4TjF/Qdy2ZYzJBBuilDZT qId6Re1zTR1aPoUiR6XdP5dA0sHrNKN7eAMX4osnIsOzxYULCtji15B2BcFRMXFl8Cdm 2c+w== X-Gm-Message-State: AMCzsaVrX5IYnWXDtTG+XdFfZm8UoHOZ70lJ7XoEfB9LfKPvP1jbXhiO 9Tv6Tb46Mc1TDNPsS3sYjMqJdRRYn1g= X-Google-Smtp-Source: ABhQp+Q7c2flsjIC5jpslZykMfoj7gjYQcCf+ioqS2D/AGqw8+hgskSLaic1NEdyUtqOCz2fv4OX/A== X-Received: by 10.28.109.23 with SMTP id i23mr3158567wmc.32.1507972474171; Sat, 14 Oct 2017 02:14:34 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id 67sm3777490wmw.22.2017.10.14.02.14.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Oct 2017 02:14:33 -0700 (PDT) In-Reply-To: <877evyywjs.fsf@metapensiero.it> (Lele Gaifax's message of "Sat, 14 Oct 2017 10:15:51 +0200") 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:138393 Archived-At: Hi Lele, Lele Gaifax writes: >> A common trick here that old flymake (and also compile.el) use is to >> define the variable's value as list (REGEXP LINE COLUMN TYPE >> MESSAGE). > > I will try to better understand this, as I failed to see the benefit of adding > that indirection... maybe the compile.el functionality is older than the > ability to use explicit group numbers in the regexp? The benefit is that if I switch to a checker that doesn't provide COLUMN, for example, I won't be locked out with your expression. Likewise if I do switch to a checker that emits errors where I can clearly identify a TYPE. > I'm curious here: why the need of autoload cookie, if the (only?) caller site > lives in the very same source file? And if that's not only caller, why marking > it private with the double dash? Sorry for the noise. There is no need for the autoload cookie. I thought you were changing a different file than flymake. Don't use the cookie, use the double dash. > > More importantly: if we unconditionally activate the Flymake feature, instead > of being an user's choice, then the python--flymake-setup function may go > away, and the add-hook moved inside the python-mode function, it already > contains lot of those... That makes sense. But we don't (yet) "unconditionally activate" Flymake, we simply set up the buffer so that a later activation of Flymake will be met with agreeable conditions. > See http://endlessparentheses.com/get-in-the-habit-of-using-sharp-quote.html > for what I considered a "sound reason" :) Obviously, I use sharp quote myself, just not in add-hook, as that is the style I am familiar with. But if that is the style of python.el, that's a good reason. It's not in the rest of emacs. But I can explain what it bothered me: As you know, in the specific Flymake-case, backends are functions. You might be tempted to put a closure, like a (lambda (report-fn) ...) in flymake-diagnostic-functions. If you do that everything will work, except for the interactive messages that mention names of backends, where intead of the name of the symbol you see something very ugly like #f(compiled-function (report-fn) #) So, for now, as a good practice, I thought it better to use just ' so as not to encourage others to put closures there. Eventually, once function-put starts working for non-symbol functions and I can set a name property there, closures will probably not only be accepted but encouraged.