diff options
| author | Glenn Morris | 2013-11-13 15:48:35 -0500 |
|---|---|---|
| committer | Glenn Morris | 2013-11-13 15:48:35 -0500 |
| commit | 1d43dba1a01207bb78e608afdf4ee207188cc5a0 (patch) | |
| tree | 8c88f34cf312ebc928c4e580ee81e6feaaab4280 | |
| parent | ff4b7bd5318011b009f7d97f113260ba9be9efa7 (diff) | |
| download | emacs-1d43dba1a01207bb78e608afdf4ee207188cc5a0.tar.gz emacs-1d43dba1a01207bb78e608afdf4ee207188cc5a0.zip | |
* lisp/replace.el (replace-eval-replacement): Try to give more helpful error
message.
Fixes: debbugs:15836
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/replace.el | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f11ebd4d418..a4d1874a4b1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2013-11-13 Glenn Morris <rgm@gnu.org> | 1 | 2013-11-13 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * replace.el (replace-eval-replacement): | ||
| 4 | Try to give more helpful error message. (Bug#15836) | ||
| 5 | |||
| 3 | * arc-mode.el (archive-7z-extract, archive-7z-expunge) | 6 | * arc-mode.el (archive-7z-extract, archive-7z-expunge) |
| 4 | (archive-7z-update): Avoid custom type mismatches. | 7 | (archive-7z-update): Avoid custom type mismatches. |
| 5 | 8 | ||
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 @@ | |||
| 1 | ;;; replace.el --- replace commands for Emacs | 1 | ;;; replace.el --- replace commands for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2013 Free | 3 | ;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2013 |
| 4 | ;; Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| 7 | ;; Package: emacs | 7 | ;; Package: emacs |
| @@ -1793,7 +1793,12 @@ type them using Lisp syntax." | |||
| 1793 | 1793 | ||
| 1794 | (defun replace-eval-replacement (expression count) | 1794 | (defun replace-eval-replacement (expression count) |
| 1795 | (let* ((replace-count count) | 1795 | (let* ((replace-count count) |
| 1796 | (replacement (eval expression))) | 1796 | err |
| 1797 | (replacement | ||
| 1798 | (condition-case err | ||
| 1799 | (eval expression) | ||
| 1800 | (error | ||
| 1801 | (error "Error evaluating replacement expression: %S" err))))) | ||
| 1797 | (if (stringp replacement) | 1802 | (if (stringp replacement) |
| 1798 | replacement | 1803 | replacement |
| 1799 | (prin1-to-string replacement t)))) | 1804 | (prin1-to-string replacement t)))) |