From: Glenn Morris Date: Wed, 13 Nov 2013 20:48:35 +0000 (-0500) Subject: * lisp/replace.el (replace-eval-replacement): Try to give more helpful error X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~840 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1d43dba1a01207bb78e608afdf4ee207188cc5a0;p=emacs.git * lisp/replace.el (replace-eval-replacement): Try to give more helpful error message. Fixes: debbugs:15836 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f11ebd4d418..a4d1874a4b1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-11-13 Glenn Morris + * 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. diff --git a/lisp/replace.el b/lisp/replace.el index d92fb6809ef..9d7aba333c4 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1,7 +1,7 @@ ;;; 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))))