ert-x: Improve realism of `ert-with-test-buffer-selected'
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): Set `inhibit-read-only' and `buffer-read-only' to nil when executing the body to provide a more realistic test environment.
This commit is contained in:
parent
0b1e3713fe
commit
29b7d74000
1 changed files with 9 additions and 1 deletions
|
@ -126,7 +126,15 @@ value is the last form in BODY."
|
|||
(body-function
|
||||
. ,(lambda (window)
|
||||
(select-window window t)
|
||||
(let ((inhibit-modification-hooks nil))
|
||||
;; body-function is intended to initialize the
|
||||
;; contents of a temporary read-only buffer, so
|
||||
;; it is executed with some convenience
|
||||
;; changes. Undo those changes so that the
|
||||
;; test buffer behaves more like an ordinary
|
||||
;; buffer while the body executes.
|
||||
(let ((inhibit-modification-hooks nil)
|
||||
(inhibit-read-only nil)
|
||||
(buffer-read-only nil))
|
||||
(setq ,ret (progn ,@body))))))
|
||||
nil))
|
||||
,ret))))
|
||||
|
|
Loading…
Add table
Reference in a new issue