From 5c08caccbec41d9c14781ece9a336f91da2c7ab8 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Wed, 25 Sep 2013 05:10:00 +0200 Subject: Scheme version checks And, if you happen to be launching it all the time, a way of skipping them via a customizable variable. Should address issue #15. --- elisp/geiser-base.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'elisp/geiser-base.el') diff --git a/elisp/geiser-base.el b/elisp/geiser-base.el index 2569034..e564b0f 100644 --- a/elisp/geiser-base.el +++ b/elisp/geiser-base.el @@ -1,6 +1,6 @@ ;;; geiser-base.el --- shared bits -;; Copyright (C) 2009, 2010, 2012 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2012, 2013 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -74,5 +74,14 @@ (let ((thing (thing-at-point 'symbol))) (and thing (make-symbol thing)))) +(defun geiser--cut-version (v) + (when (string-match "\\([0-9]+\\.[0-9]\\(?:\\.[0-9]+\\)?\\).*" v) + (match-string 1 v))) + +(defun geiser--version< (v1 v2) + (let ((v1 (geiser--cut-version v1)) + (v2 (geiser--cut-version v2))) + (and v1 v2 (version< v1 v2)))) + (provide 'geiser-base) -- cgit v1.2.3