summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoost Kremers <joostkremers@fastmail.fm>2017-03-10 20:09:40 +0100
committerJoost Kremers <joostkremers@fastmail.fm>2017-03-10 20:09:40 +0100
commit4f05fae56fb5efb5d94237b2163f6ad7007e7204 (patch)
treefc051aff15870e86aafb04dd135df777d0093f09
parent1879e0c5696601005b4cc064251cda63a9fd95f2 (diff)
parsebib-replace-string: Do not try to expand fields when no strings are provided.
-rw-r--r--parsebib.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/parsebib.el b/parsebib.el
index 468f439..077487f 100644
--- a/parsebib.el
+++ b/parsebib.el
@@ -196,9 +196,11 @@ point."
(defun parsebib-replace-strings (val strings)
"Replace strings in VAL using (key, value) pairs from hash table STRINGS."
- (replace-regexp-in-string "\"" "" (string-join (mapcar
- (lambda (x) (if strings (gethash x strings x) x))
- (split-string val " # " t)))))
+ (if (not strings)
+ val
+ (replace-regexp-in-string "\"" "" (string-join (mapcar
+ (lambda (x) (if strings (gethash x strings x) x))
+ (split-string val " # " t))))))
(defun parsebib-read-string (&optional pos strings)
"Read the @String definition beginning at the line POS is on.