diff options
author | Joost Kremers <joostkremers@fastmail.fm> | 2017-03-10 20:09:40 +0100 |
---|---|---|
committer | Joost Kremers <joostkremers@fastmail.fm> | 2017-03-10 20:09:40 +0100 |
commit | 4f05fae56fb5efb5d94237b2163f6ad7007e7204 (patch) | |
tree | fc051aff15870e86aafb04dd135df777d0093f09 | |
parent | 1879e0c5696601005b4cc064251cda63a9fd95f2 (diff) |
parsebib-replace-string: Do not try to expand fields when no strings are provided.
-rw-r--r-- | parsebib.el | 8 |
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. |