emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Flymake support for C/C++


From: Mark Oteiza
Subject: Re: [PATCH] Flymake support for C/C++
Date: Thu, 12 Oct 2017 11:50:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

address@hidden (João Távora) writes:

> +;; Flymake support for C/C++.
> +
> +;;; Code:
> +
> +(require 'subr-x) ; when-let*

Should only need it at compile time, then.

> +(defun cc-flymake-use-cc-directly ()
> +  "Build command for checking a file with a C(++) compiler."
> +  (unless (executable-find cc-flymake-program)
> +    (error "%s not found" cc-flymake-program))
> +  `(,cc-flymake-program
> +    "-fsyntax-only"
> +    ,@(cc-flymake--guess-flags cc-flymake-program)
> +    "-x" "c" "-"))

If we're handling multiple languages, a case for the major mode seems
appropriate:

 ...
 "-x" (pcase major-mode
        (`c-mode "c")
        ...)
 "-")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]