From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: Flymake refactored Date: Thu, 05 Oct 2017 03:08:24 +0100 Message-ID: <874lre2von.fsf@gmail.com> References: <87h8vmj3tr.fsf@lolita> <1507138648.1972.0@smtp.gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1507169354 27386 195.159.176.226 (5 Oct 2017 02:09:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Oct 2017 02:09:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: jwiegley@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, dgutov@yandex.ru, Steve Purcell , sdl.web@gmail.com To: Simen =?utf-8?Q?Heggest=C3=B8yl?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 05 04:09:08 2017 Return-path: Envelope-to: ged-emacs-devel@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 1dzvb1-0006Li-9x for ged-emacs-devel@m.gmane.org; Thu, 05 Oct 2017 04:09:07 +0200 Original-Received: from localhost ([::1]:37472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzvb8-0001u7-7O for ged-emacs-devel@m.gmane.org; Wed, 04 Oct 2017 22:09:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzvaV-0001tx-Kr for emacs-devel@gnu.org; Wed, 04 Oct 2017 22:08:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzvaQ-0006bW-Gl for emacs-devel@gnu.org; Wed, 04 Oct 2017 22:08:35 -0400 Original-Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:53977) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzvaQ-0006al-8m for emacs-devel@gnu.org; Wed, 04 Oct 2017 22:08:30 -0400 Original-Received: by mail-wm0-x234.google.com with SMTP id q132so26433493wmd.2 for ; Wed, 04 Oct 2017 19:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=H1SzonEupp6HGYnwi+7tuDX/k25Bl1+8pZGDfXl9dOs=; b=W8v5Rrc4iqgtQRCxxV/ysuNLB/Ah3GUiyLJd5YHbN/EFCVz2K4VmQxAJX+cQ4xVsMz 7orf3K0ymLyWIA/vLk//wiCVc1zgG2XIfGAnFpbW1Xk3QugWzqCGRq4CsiNkuIWlVNYb n381G000Iv2fxN4tDb+utNnBcBtVThvA6rnw+u+R9X7Ml8/Oez8Ac4QvEBvGUqrMn+g+ vxRsLZ0UhxGIAe7GIt4KzZir2aJZu6fdyZNGcPdkoxtSyLjKdT30lxPdauALc5pREgJ1 jK+BaNfxqtnPv6dJGB/u/8NP97Tt1VBiTnVaqbp2APfKT11cKaxGaMjF1EdHayT5FpPg Fcug== 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:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=H1SzonEupp6HGYnwi+7tuDX/k25Bl1+8pZGDfXl9dOs=; b=Iv4Rh1oCQEUMID+B3yHxndTyRnPDLTHk9oz2FHleg1aLL7adHkcwI8a46CsVfaiWFv 5Lho/gKWKpzczZN4eLf8pq0LbmrJKvLU23LqWqFswTFL4LjvjGyYou4uDKyl+mvEfYJ7 PuO05ENeOLakxk9iHEcs4cmDvD6CAxA6TF9lqfNpk5PgqDXRO/O22Qzg0ARNWF7QA0oY 4+CiaeE2pgwFUmG8O82HtAt6l8ghV42HqtGVOvFBByan/6FxTVTUFixoidOXntAa+rNV A47po7+nrcHYUoOJVLQRmcc1CYo9Dqhk6gjXvlr41amIJZ8CgRRTnT/IST33RJAvJPAY af8Q== X-Gm-Message-State: AMCzsaXnJQ2U2qzyoORbLhL9MiGAieiXH1aBGfDgxey8vvG41IZd5IOh n3RibTjUGpnV14bL0Pg27rk= X-Google-Smtp-Source: AOwi7QCQXLHT/YtWaVZJ5BAywOFQVwEHtp0Ca3wP6RsTFK8BeqpRyznRZkOFZ1h9sSXtW9eI4DtOlA== X-Received: by 10.28.174.80 with SMTP id x77mr18810532wme.83.1507169309059; Wed, 04 Oct 2017 19:08:29 -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 k126sm144199wmd.1.2017.10.04.19.08.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2017 19:08:27 -0700 (PDT) In-Reply-To: <1507138648.1972.0@smtp.gmail.com> ("Simen \=\?utf-8\?Q\?Heggest\?\= \=\?utf-8\?Q\?\=C3\=B8yl\=22's\?\= message of "Wed, 04 Oct 2017 19:37:28 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219096 Archived-At: Simen Heggest=C3=B8yl writes: > (I haven't really used Flymake or flymake-easy, so please excuse me if > the following question doesn't make any sense.) > > Would it make sense to merge flymake-easy into Flymake while you're at > it, if it makes Flymake easier to use out of the box (as the package > name suggests)? You question makes sense, but I don't favor doing that for two reasons: * It would detract from the new API I'm trying to promote; * It keeps Emacs tied to the legacy backend; Of course if flymake-easy decides to hook onto the new API and still provide its declarative interface, I have nothing against that. But I hope the new API is simple enough to render even that superfluous. For example, here's a decent Ruby checker under 40 lines that does the same as MELPA's flymake-ruby.el (which is based on flymake-easy), but using the new API and without creating any temporary files. Jo=C3=A3o (defvar-local ruby--flymake-proc nil) (defun ruby-flymake (report-fn &rest _args) (unless (executable-find (car ruby-flymake-command)) (error "Cannot find a suitable ruby"= )) ;; Kill any obsolete processes, then create a new (when (process-live-p ruby--flymake-proc) (kill-process ruby--flymake-pro= c)) (let ((source (current-buffer))) (save-restriction (widen) (setq ruby--flymake-proc (make-process :name "ruby-flymake" :noquery t :connection-type 'pipe :buffer (generate-new-buffer " *ruby-flymake*") :command '("ruby" "-w" "-c") :sentinel (lambda (proc _event) (unwind-protect (with-current-buffer (process-buffer proc) (goto-char (point-min)) (cl-loop while (search-forward-regexp "^\\(?:.*.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" nil t) for msg =3D (match-string 2) for (beg . end) =3D (flymake-diag-region source (string-to-number (match-string 1)= )) for type =3D (if (string-match "^warning" msg) :warning :error) collect (flymake-make-diagnostic source beg end type msg) into diags finally (funcall report-fn diags))) (kill-buffer (process-buffer proc)))))) (process-send-region ruby--flymake-proc (point-min) (point-max)) (process-send-eof ruby--flymake-proc)))) > > -- Simen