diff options
| author | João Távora | 2019-12-11 22:26:35 +0100 |
|---|---|---|
| committer | João Távora | 2019-12-13 17:34:15 +0100 |
| commit | 73f37da12dc7808a2be1d38787642f4900632b49 (patch) | |
| tree | 27e4657b9ffab83f218709b32cbea841e7bbd8a5 | |
| parent | 84a8d07e7a3626402ff80dec1a1e6cfe69dddccf (diff) | |
| download | emacs-73f37da12dc7808a2be1d38787642f4900632b49.tar.gz emacs-73f37da12dc7808a2be1d38787642f4900632b49.zip | |
Disable undo in the process buffers of a JSONRPC connection
* lisp/jsonrpc.el (initialize-instance jsonrpc-process-connection):
Use buffer-disable-undo in stdout and stderr buffers.
* lisp/jsonrpc.el (Version): Bump to 1.0.9
| -rw-r--r-- | lisp/jsonrpc.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index abab445fe5c..6e0a012d5f8 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: João Távora <joaotavora@gmail.com> | 5 | ;; Author: João Távora <joaotavora@gmail.com> |
| 6 | ;; Keywords: processes, languages, extensions | 6 | ;; Keywords: processes, languages, extensions |
| 7 | ;; Package-Requires: ((emacs "25.2")) | 7 | ;; Package-Requires: ((emacs "25.2")) |
| 8 | ;; Version: 1.0.8 | 8 | ;; Version: 1.0.9 |
| 9 | 9 | ||
| 10 | ;; This is an Elpa :core package. Don't use functionality that is not | 10 | ;; This is an Elpa :core package. Don't use functionality that is not |
| 11 | ;; compatible with Emacs 25.2. | 11 | ;; compatible with Emacs 25.2. |
| @@ -374,8 +374,11 @@ connection object, called when the process dies .") | |||
| 374 | (set-process-filter proc #'jsonrpc--process-filter) | 374 | (set-process-filter proc #'jsonrpc--process-filter) |
| 375 | (set-process-sentinel proc #'jsonrpc--process-sentinel) | 375 | (set-process-sentinel proc #'jsonrpc--process-sentinel) |
| 376 | (with-current-buffer (process-buffer proc) | 376 | (with-current-buffer (process-buffer proc) |
| 377 | (buffer-disable-undo) | ||
| 377 | (set-marker (process-mark proc) (point-min)) | 378 | (set-marker (process-mark proc) (point-min)) |
| 378 | (let ((inhibit-read-only t)) (erase-buffer) (read-only-mode t) proc)) | 379 | (let ((inhibit-read-only t)) (erase-buffer) (read-only-mode t) proc)) |
| 380 | (with-current-buffer stderr | ||
| 381 | (buffer-disable-undo)) | ||
| 379 | (process-put proc 'jsonrpc-connection conn))) | 382 | (process-put proc 'jsonrpc-connection conn))) |
| 380 | 383 | ||
| 381 | (cl-defmethod jsonrpc-connection-send ((connection jsonrpc-process-connection) | 384 | (cl-defmethod jsonrpc-connection-send ((connection jsonrpc-process-connection) |