[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 185/255: remove dependencies on org-mode functions
From: |
Eric Schulte |
Subject: |
[elpa] 185/255: remove dependencies on org-mode functions |
Date: |
Sun, 16 Mar 2014 01:02:45 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit b61078a2a75cc63b2cb6766d3c612454de1f31e3
Author: Eric Schulte <address@hidden>
Date: Sun May 19 12:11:40 2013 -0600
remove dependencies on org-mode functions
---
back-ends/gnugo.el | 2 +-
back-ends/sgf2el.el | 4 ++--
go-util.el | 12 ++++++++++++
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/back-ends/gnugo.el b/back-ends/gnugo.el
index 54f41c4..3edb005 100644
--- a/back-ends/gnugo.el
+++ b/back-ends/gnugo.el
@@ -79,7 +79,7 @@
(defun gnugo-last-output (gnugo)
(with-current-buffer (buffer gnugo)
(comint-show-output)
- (org-babel-clean-text-properties
+ (go-clean-text-properties
(buffer-substring (+ 2 (point)) (- (point-max) 2)))))
diff --git a/back-ends/sgf2el.el b/back-ends/sgf2el.el
index a4fc122..e8a136b 100644
--- a/back-ends/sgf2el.el
+++ b/back-ends/sgf2el.el
@@ -46,7 +46,7 @@
(defun sgf2el-read-prop (val)
(when (and (stringp val) (not (equal val "")))
- (or (org-babel-number-p val) val)))
+ (or (go-number-p val) val)))
(defun sgf2el-convert-prop-vals (key vals)
"Convert a property value to elisp."
@@ -62,7 +62,7 @@
(insert str)
(goto-char (point-min))
(loop while (re-search-forward re nil t)
- collect (org-babel-clean-text-properties
+ collect (go-clean-text-properties
(match-string (or sub-exp 0)))))))
(defun sgf2el-region (&optional start end)
diff --git a/go-util.el b/go-util.el
index 38b5289..448f143 100644
--- a/go-util.el
+++ b/go-util.el
@@ -107,4 +107,16 @@
(defun sym-cat (&rest syms)
(intern (mapconcat #'symbol-name (delq nil syms) "-")))
+(defun go-number-p (string)
+ "If STRING represents a number return its value."
+ (if (and (string-match "[0-9]+" string)
+ (string-match "^-?[0-9]*\\.?[0-9]*$" string)
+ (= (length (substring string (match-beginning 0)
+ (match-end 0)))
+ (length string)))
+ (string-to-number string)))
+
+(defun go-clean-text-properties (string)
+ (set-text-properties 0 (length string) nil string) string)
+
(provide 'go-util)
- [elpa] 157/255: images of stones, (continued)
- [elpa] 157/255: images of stones, Eric Schulte, 2014/03/15
- [elpa] 177/255: future tasks, Eric Schulte, 2014/03/15
- [elpa] 182/255: reverse order of sizes, Eric Schulte, 2014/03/15
- [elpa] 172/255: re-organized how files are loaded, Eric Schulte, 2014/03/15
- [elpa] 156/255: chunking responses from IGS server into full lines, Eric Schulte, 2014/03/15
- [elpa] 183/255: explicit connection method for back-end objects, Eric Schulte, 2014/03/15
- [elpa] 179/255: track and display prisoners, Eric Schulte, 2014/03/15
- [elpa] 184/255: safer and automatic quitting, Eric Schulte, 2014/03/15
- [elpa] 186/255: better interactive debugging, Eric Schulte, 2014/03/15
- [elpa] 191/255: don't throw error when backend passes, Eric Schulte, 2014/03/15
- [elpa] 185/255: remove dependencies on org-mode functions,
Eric Schulte <=
- [elpa] 176/255: task managment, Eric Schulte, 2014/03/15
- [elpa] 178/255: process igs "tell" messages, Eric Schulte, 2014/03/15
- [elpa] 181/255: NOTES #+option, Eric Schulte, 2014/03/15
- [elpa] 193/255: calculate the final score, Eric Schulte, 2014/03/15
- [elpa] 194/255: notes on scaling image sizes, Eric Schulte, 2014/03/15
- [elpa] 198/255: don't mutate hidden state, Eric Schulte, 2014/03/15
- [elpa] 196/255: mark an overlay with a black or white cross, Eric Schulte, 2014/03/15
- [elpa] 187/255: don't commit if process already quit, Eric Schulte, 2014/03/15
- [elpa] 188/255: adding README, Eric Schulte, 2014/03/15
- [elpa] 199/255: marking captured territory when game ends, Eric Schulte, 2014/03/15