automagic splus-version {was ess-mode 5.1.18; Splus 6.0}

Jeff Mincy jeff at
Fri Aug 10 15:43:26 CEST 2001

   From: Martin Maechler <maechler at>
   Date: Fri, 10 Aug 2001 14:50:00 +0200
   >>>>> "Jeff" == Jeff Mincy <jeff at> writes:
    Jeff>   3) should the ess Splus version be automatically selected, eg
    Jeff>   something like:
    Jeff> (defvar splus-version
    Jeff>  (let ((version (and (executable-find "Splus")
    Jeff>                      (exec-to-string "Splus VERSION"))))
    Jeff>    (if (and version (string-match 
    Jeff>         "S-PLUS Version \\([0-9]+\\)\\.\\([0-9]+\\) Release \\([0-9]+\\)"
    Jeff>                      version))
    Jeff>        (list (subseq version (match-beginning 1) (match-end 1))
    Jeff>              (subseq version (match-beginning 2) (match-end 2))
    Jeff>              (subseq version (match-beginning 3) (match-end 3))))))
    Jeff> (cond ((and splus-version (equal (car splus-version) "6"))
    Jeff>        (fset 'S 'S+6) ...)
    Jeff>       ((and splus-version (equal (car splus-version) "5"))
    Jeff>        (fset 'S 'S+5) ...)
    Jeff>       (t (fset 'S 'S+3) ...))
   As I thought this was a very good idea, I started looking at it, 
   and realized that unfortunately
       (exec-to-string ....)
   is not existing in GNU Emacs (20.7).  So (since Jeff is using that) it's
   Xemacs only. 
   Any GNU emacs replacement for that?
   Thanks in advance!

shell-command-to-string seems to work in both
  (shell-command-to-string "Splus VERSION")

The other issue is that the user's system may have multiple versions
of Splus installed under different names.  So, you should probably
go through a list of possible 'splus' names - for example:


And use the first one that exists on the system instead of just Splus above.

ess-help mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: ess-help-request at

More information about the ESS-help mailing list