[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New Flymake rewrite in emacs-26
From: |
João Távora |
Subject: |
Re: New Flymake rewrite in emacs-26 |
Date: |
Wed, 11 Oct 2017 13:25:22 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) |
Noam Postavsky <address@hidden> 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")
- Re: New Flymake rewrite in emacs-26, (continued)
- Re: New Flymake rewrite in emacs-26, João Távora, 2017/10/10
- Re: New Flymake rewrite in emacs-26, Eli Zaretskii, 2017/10/10
- Re: New Flymake rewrite in emacs-26, João Távora, 2017/10/10
- Re: New Flymake rewrite in emacs-26, Eli Zaretskii, 2017/10/10
- Re: New Flymake rewrite in emacs-26, João Távora, 2017/10/10
- Re: New Flymake rewrite in emacs-26, Noam Postavsky, 2017/10/10
- Re: New Flymake rewrite in emacs-26, João Távora, 2017/10/10
- Re: New Flymake rewrite in emacs-26, Noam Postavsky, 2017/10/10
- Re: New Flymake rewrite in emacs-26, Eli Zaretskii, 2017/10/11
- Re: New Flymake rewrite in emacs-26, Noam Postavsky, 2017/10/11
- Re: New Flymake rewrite in emacs-26,
João Távora <=
- Re: New Flymake rewrite in emacs-26, Eli Zaretskii, 2017/10/11
- Re: New Flymake rewrite in emacs-26, João Távora, 2017/10/11
- Re: New Flymake rewrite in emacs-26, Eli Zaretskii, 2017/10/11
- Re: New Flymake rewrite in emacs-26, João Távora, 2017/10/11
- Re: New Flymake rewrite in emacs-26, Romanos Skiadas, 2017/10/11
- Re: New Flymake rewrite in emacs-26, guillaume papin, 2017/10/11
- Re: New Flymake rewrite in emacs-26, João Távora, 2017/10/12
- Re: New Flymake rewrite in emacs-26, Stefan Monnier, 2017/10/11
- Re: New Flymake rewrite in emacs-26, João Távora, 2017/10/12
- Re: New Flymake rewrite in emacs-26, Stefan Monnier, 2017/10/12