From 4050ee010f1117051936f274d6dff6ca0a4dc5db Mon Sep 17 00:00:00 2001 From: Mario Domenech Goulart Date: Thu, 17 Jan 2019 21:37:31 +0100 Subject: geiser-chicken.el: Use a more stable API to get CHICKEN's version Avoid parsing csi's help message to get CHICKEN's version. Use a more stable API to get it (`chicken-version'). As a beneficial side-effect, get rid of `seq-filter', which is not available in Emacs 24. Should fix https://gitlab.com/jaor/geiser/issues/262 --- elisp/geiser-chicken.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el index 1ace770..b436d92 100644 --- a/elisp/geiser-chicken.el +++ b/elisp/geiser-chicken.el @@ -258,10 +258,14 @@ This function uses `geiser-chicken-init-file' if it exists." (defconst geiser-chicken-minimum-version "4.8.0.0") (defun geiser-chicken--version (binary) - (cadar - (seq-filter #'(lambda (l) (string-equal "Version" (car l))) - (mapcar #'split-string - (process-lines binary "-version"))))) + (shell-command-to-string + (format "%s -e '(display \ + (or (handle-exceptions exn \ + #f \ + (eval `(begin (import chicken.platform) \ + (chicken-version)))) \ + (chicken-version)))'" + binary))) (defun connect-to-chicken () "Start a Chicken REPL connected to a remote process." -- cgit v1.2.3