From 85777a56c67438876561994dceb0628b699254d8 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Wed, 28 Jun 2017 02:01:41 -0500
Subject: [PATCH] Add A (action) and E (echo) parameters to M118

---
 Marlin/Marlin_main.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index d695b273ef..a3045b9001 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -7994,9 +7994,13 @@ inline void gcode_M117() { lcd_setstatus(parser.string_arg); }
 
 /**
  * M118: Display a message in the host console.
+ *
+ *  A  Append '// ' for an action command, as in OctoPrint
+ *  E  Have the host 'echo:' the text
  */
 inline void gcode_M118() {
-  SERIAL_ECHO_START();
+  if (parser.boolval('E')) SERIAL_ECHO_START();
+  if (parser.boolval('A')) SERIAL_ECHOPGM("// ");
   SERIAL_ECHOLN(parser.string_arg);
 }