Commit 1d43dba1 authored by Glenn Morris's avatar Glenn Morris
Browse files

* lisp/replace.el (replace-eval-replacement): Try to give more helpful error

message.

Fixes: debbugs:15836
parent ff4b7bd5
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
......@@ -1793,7 +1793,12 @@ type them using Lisp syntax."
(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))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment