Emacs compilation mode

Hi all,

I am a long time Emacs user, and I was delighted to find the platformio command line tools to replace the Arduino IDE for my Arduino project.

Is there a simple way to suppress the color formatting “pio run” produces when running the compiler? It is messing up the regexps Emacs is using to parse error messages. I tried looking in the documentation and even rummaged around the sources, but did not find anything relevant.

Alternatively if someone has working entries for compilation-error-regexp-alist that would be appreciated.

Have you seen this Redirecting... ?

I’m trying to figure out how to get PlatformIO to work with Emacs. I have followed the instructions from Emacs — PlatformIO latest documentation and everything appears to be installed in my Emacs config just fine. However the instructions end with step 4: “Import project in IDE.”

What does that mean with Emacs? How do I do that? I have all the Elisp code installed and the project created on my disk (under Ubuntu if that matters) but then what? I have no clue how to actually get emacs to see that this is a PlatformIO project.

Drew Moseley

@richieHH could you help?

I revisited this and found that if I create an empty .projectile file in the directory where my sources reside then it seems to work. I guess I need to understand projectile mode a bit better.

Hii everyone I am facing the same problem. please give some suggestion to us.

Look into using lsp. Add your board’s platform package directory (under ~/.platformio) to your lsp settings for your lsp project (I use .projectile in the root) when lsp prompts you. Also you need to generate a compile_comands.json (pio run -t compiledb) and then symlink that (its under .pio somewhere) into your project root. That should get you going. Oh, I use clangd for lsp with C btw.

Did you get anywhere with this? My platformio-compilation-mode buffers are full of horrible control codes.
eg
e[0mCONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_f030r8.html