Skip to content

Instantly share code, notes, and snippets.

(defun compress-space-forward ()
"*Replaces all spaces, tabs and newlines after point with a single space."
(interactive)
(re-search-forward "[ \t\n\r]+\\([^ \t\n\r]\\)" nil t)
(replace-match " \\1" nil nil))
(defun compress-space-backward ()
"*Replaces all spaces, tabs and newlines after point with a single space."
(interactive)
(re-search-backward "\\([^ \t\n\r]\\)[ \t\n\r]+" nil t)
@ninjudd
ninjudd / gist:3280370
Created August 7, 2012 01:18
jiraph lein test
amnesia:jiraph develop$ lein test
lein test jiraph.cache-test
lein test jiraph.core-test
FAIL in (multi-layer-transactions) (core_test.clj:273)
expected: (= {:edges {"y" {:times [1]}}} (get-node :sorted "x"))
actual: (not (= {:edges {"y" {:times [1]}}} {:edges {"y" {:times (1 1)}}}))
(defn error [& args]
(binding [*out* *err*]
(apply println "Error:" args)))
(defn- load-hook [hook-ns]
(when-let [hook (try (utils/resolve-symbol (symbol (name hook-ns) "activate"))
(catch Throwable e
(error "problem activating" hook-ns "hook")
(throw e)))]
(try (hook)
(defmacro with-error-header
"Execute the code in body, printing the given error message if something goes wrong."
[message & body]
`(try ~@body
(catch Throwable e
(binding [*out* *err*]
(println message))
(throw e))))

strikethrough

diff --git a/bin/lein b/bin/lein
index ac3cd58..dd06a53 100755
--- a/bin/lein
+++ b/bin/lein
@@ -213,6 +213,8 @@ else
if [ "$OSTYPE" = "cygwin" ]; then
TRAMPOLINE_FILE=`cygpath -w $TRAMPOLINE_FILE`
fi
+ args="$@"
+ args=${args/#:/with-profile }
--- a/src/clj_gedcom/core.clj
+++ b/src/clj_gedcom/core.clj
@@ -67,9 +67,9 @@
"Parses GEDCOM records from a file or reader, returning map of labels to records."
[in]
(reduce (fn [records record]
- (let [label (:label record)]
- (when (contains? records label)
- (throw (Exception. (format "duplicate record in GEDCOM for label %s" label))))
- (assoc records label record)))
src/gedcom_importer/core.clj | 6 +++---
src/gedcom_importer/indi.clj | 13 ++++++++-----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/gedcom_importer/core.clj b/src/gedcom_importer/core.clj
index 8eaa08f..9ccea9f 100644
--- a/src/gedcom_importer/core.clj
+++ b/src/gedcom_importer/core.clj
@@ -19,8 +19,8 @@
:when (not (contains? (:profiles processing) profile-id))]
WrappedTransactional
(txn-wrap [this f]
(let [f (txn-wrap layer f)]
(fn [^MergeableLayer layer]
(f (.layer layer)))))