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: New Flymake rewrite in emacs-26 Date: Wed, 11 Oct 2017 13:25:22 +0100 Message-ID: <87tvz57txp.fsf@gmail.com> References: <8760bwz5qf.fsf@gmail.com> <83infw1dkz.fsf@gnu.org> <87efqbb35x.fsf@gmail.com> <831smbqe70.fsf@gnu.org> <87tvz79h0s.fsf@gmail.com> <83wp43ov7s.fsf@gnu.org> <87bmlf9dh3.fsf@gmail.com> <83tvz7ot1o.fsf@gnu.org> <87y3oj7x60.fsf@gmail.com> <87a80y8s3s.fsf@gmail.com> <83y3oinf2y.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507724742 11070 195.159.176.226 (11 Oct 2017 12:25:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Oct 2017 12:25:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: Lele Gaifax , Emacs developers , Mark Oteiza , Stefan Monnier , Eli Zaretskii , Leo Liu To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 11 14:25:32 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 1e2G4n-0001mN-Ie for ged-emacs-devel@m.gmane.org; Wed, 11 Oct 2017 14:25:29 +0200 Original-Received: from localhost ([::1]:40803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2G4v-00086t-0b for ged-emacs-devel@m.gmane.org; Wed, 11 Oct 2017 08:25:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2G4o-00086l-PG for emacs-devel@gnu.org; Wed, 11 Oct 2017 08:25:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2G4k-0003ZX-RC for emacs-devel@gnu.org; Wed, 11 Oct 2017 08:25:30 -0400 Original-Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:49838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2G4k-0003Z6-Kv; Wed, 11 Oct 2017 08:25:26 -0400 Original-Received: by mail-wm0-x229.google.com with SMTP id b189so4180670wmd.4; Wed, 11 Oct 2017 05:25:26 -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=Msk1OrDpddUwg9PUKp38xz1Nsmty8H5YuxWrluNGTpY=; b=TaO7MuZarWzhoqmVNevcQj0CoRE5yskgUSP2c+eh5bGomPW62upEkAeKGwWkM4BWVc eB33ABC+xy6mIqpSinhfL+eVTLX5HQaTftAGor2gtGVq446Aa4cAGZqsDxy75QHTgyGc vEJnVBN0G0JBIN1x3mB0eAKszYOIIwOK06PwTjxHU1/PyXu2gdjYKvpoZctZxxQYDqPs xSsQ+pcBEOGJarC6BvalLwjtcCcA2N0fxj2EWUjZqGY5YAn68L3j4NQY2erBEIQHK5br 6t3tJyMSdZ9LK8GGRHaxaheb9nW3GlsQmZCYQau4fKDYagsXvZWCgxZs1YKrCo+7KmJx TxuQ== 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=Msk1OrDpddUwg9PUKp38xz1Nsmty8H5YuxWrluNGTpY=; b=ZoGz6wW+RQjtCVRgL9UJ8F887f0L2m3Zl3eCf/GO2ogihSUvhxVTeXOg7XN8VmQNkv rtapasUdIi0kO2cOVDrrL2FdPsrjv5pxuhWhapmUNn+G18IXCqRkEDbx8u3iHd23Sn96 aAmwIVsH4c2tAmUqGSl7YRp9AT7sBhDshz8buHQ1wbFGL7QCAuE6gIpC43UpTI9Z2EHa UVf4UOJJ7+y3ipxiYZ7kwZwkGkRaFw8KClQHK85iMqU0hUUPV4cjGovfWclYbdbn+my8 bRmKLJS7lPFbX25PTww5t+ViTnbuDd/caXwrHDRZJdXNL3O5uiwUhyZADRuYFHww/09y LWjA== X-Gm-Message-State: AMCzsaU4CPlyFDfU/EUbd0Gwvj41PtOGCtgAv883pvbkgv1lOECgEnMQ PvhPPhiIUZ/JO4/hY2x3DdA= X-Google-Smtp-Source: AOwi7QCX9uPqOtFMeijNiySJCk6JhCpWiK7dht8/MGdAJgykdaCd1MdGIS+1sIDFFx+CfNS2PoEQVw== X-Received: by 10.28.145.72 with SMTP id t69mr13390629wmd.113.1507724725184; Wed, 11 Oct 2017 05:25:25 -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 x15sm11253403wma.32.2017.10.11.05.25.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Oct 2017 05:25:24 -0700 (PDT) In-Reply-To: (Noam Postavsky's message of "Wed, 11 Oct 2017 08:16:43 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::229 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:219373 Archived-At: Noam Postavsky writes: >>> Another possibility is to put an echoing command in front and exploit >>> the shell's parsing directly, e.g., >>> >>> printf '%s\0' gcc -c -Demacs -I. -I. -I../lib -I../ ... I tried with Emacs itself, as you suggested. It works, and may be a start, but: * is very slow (only needs to run once though) * no idea if it works for windows (it should if shell-command DTRT) * generally looks brittle. Among other things it takes advantage of an undocumented "--" command-line arg. (defun flymake--gcc-heroic-unescape (string) (with-temp-buffer (let ((error-buffer (current-buffer))) (with-temp-buffer (cond ((zerop (shell-command (format "%s -Q --batch --eval \"%s\" -- %s" (expand-file-name invocation-name invocation-directory) "(mapc 'print (nthcdr 4 command-line-args))" string) (current-buffer) error-buffer)) (goto-char (point-min)) (cl-loop with eof = (make-symbol "eof") for form = (condition-case err (read (current-buffer)) (error eof)) while (not (eq form eof)) collect form)) (t (with-current-buffer error-buffer (error (buffer-string))))))))) (flymake--gcc-heroic-unescape "bla\\ bla") ; ("bla bla") (flymake-gcc-heroic-unescape "bla bla") ;("bla" "bla")