From 8186c96089174c032372ea0a1c62de6e1c6b05cc Mon Sep 17 00:00:00 2001 From: Dan Kessler Date: Tue, 1 Feb 2022 09:28:42 -0500 Subject: [PATCH] Change control codes in MPI protocol As suggested in discussion of #1182, adopt the following protocol for MPI `SOH header STX payload ETX` also use octal codes in elisp for better readability --- etc/ESSR/R/mpi.R | 2 +- lisp/ess-tracebug.el | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/ESSR/R/mpi.R b/etc/ESSR/R/mpi.R index 6f803549e..09a5ec825 100644 --- a/etc/ESSR/R/mpi.R +++ b/etc/ESSR/R/mpi.R @@ -7,7 +7,7 @@ else as.character(el) }) payload <- paste(dots, collapse = "") - cat(sprintf("\034%s\036%s\035", head, payload)) + cat(sprintf("\001%s\002%s\003", head, payload)) } .ess_mpi_message <- function(msg){ diff --git a/lisp/ess-tracebug.el b/lisp/ess-tracebug.el index 887308705..87a55b981 100644 --- a/lisp/ess-tracebug.el +++ b/lisp/ess-tracebug.el @@ -1183,9 +1183,9 @@ Kill the *ess.dbg.[R_name]* buffer." ;; http://jkorpela.fi/chars/c0.html ;; https://en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences -(defvar ess-mpi-message-start-delimiter "") -(defvar ess-mpi-message-field-separator "") -(defvar ess-mpi-message-end-delimiter "") +(defvar ess-mpi-message-start-delimiter "\001") +(defvar ess-mpi-message-field-separator "\002") +(defvar ess-mpi-message-end-delimiter "\003") (define-obsolete-variable-alias 'ess-mpi-alist 'ess-mpi-handlers "ESS 19.04") (defvar ess-mpi-handlers @@ -1229,7 +1229,7 @@ value from EXPR and then sent to the subprocess." (defun ess-mpi-handle-messages (buf) "Handle all mpi messages in BUF and delete them. -The MPI message has the form TYPEFIELD... where TYPE is the +The MPI message has the form TYPEFIELD... where TYPE is the type of the messages on which handlers in `ess-mpi-handlers' are dispatched. And FIELDs are strings. Return :incomplete if BUF ends with an incomplete message."