protect the evaluated string.

This commit is contained in:
Zhang Chiyuan 2008-03-15 13:36:04 +00:00
parent 43c5aa3a5a
commit e48806e04f

View File

@ -260,7 +260,10 @@ a list of modes like this to help the judgement."
(defun yas/eval-string (string)
"Evaluate STRING and convert the result to string."
(condition-case err
(format "%s" (eval (read string)))
(save-excursion
(save-restriction
(save-match-data
(format "%s" (eval (read string))))))
(error (format "(error in elisp evaluation: %s)"
(error-message-string err)))))
(defun yas/calculate-field-value (field value)