2013-11-13 Glenn Morris <rgm@gnu.org>
+ * replace.el (replace-eval-replacement):
+ Try to give more helpful error message. (Bug#15836)
+
* arc-mode.el (archive-7z-extract, archive-7z-expunge)
(archive-7z-update): Avoid custom type mismatches.
;;; replace.el --- replace commands for Emacs
-;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2013 Free
-;; Software Foundation, Inc.
+;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2013
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Package: emacs
(defun replace-eval-replacement (expression count)
(let* ((replace-count count)
- (replacement (eval expression)))
+ err
+ (replacement
+ (condition-case err
+ (eval expression)
+ (error
+ (error "Error evaluating replacement expression: %S" err)))))
(if (stringp replacement)
replacement
(prin1-to-string replacement t))))