|
31 | 31 | :initarg :%enable-undo-p |
32 | 32 | :accessor buffer-%enable-undo-p |
33 | 33 | :type boolean) |
| 34 | + (%enable-undo-boundary-p |
| 35 | + :initarg :%enable-undo-boundary-p |
| 36 | + :initform t |
| 37 | + :accessor buffer-%enable-undo-boundary-p) |
34 | 38 | (read-only-p |
35 | 39 | :initarg :read-only-p |
36 | 40 | :accessor buffer-read-only-p |
@@ -194,6 +198,17 @@ Options that can be specified by arguments are ignored if `temporary` is NIL and |
194 | 198 | (setf (buffer-redo-stack buffer) nil) |
195 | 199 | nil) |
196 | 200 |
|
| 201 | +(defun buffer-enable-undo-boundary-p (&optional (buffer (current-buffer))) |
| 202 | + (buffer-%enable-undo-boundary-p buffer)) |
| 203 | + |
| 204 | +(defun buffer-enable-undo-boundary (buffer) |
| 205 | + (setf (buffer-%enable-undo-boundary-p buffer) t) |
| 206 | + nil) |
| 207 | + |
| 208 | +(defun buffer-disable-undo-boundary (buffer) |
| 209 | + (setf (buffer-%enable-undo-boundary-p buffer) nil) |
| 210 | + nil) |
| 211 | + |
197 | 212 | (defmethod print-object ((buffer buffer) stream) |
198 | 213 | (print-unreadable-object (buffer stream :identity t :type t) |
199 | 214 | (format stream "~A ~A" |
@@ -339,8 +354,9 @@ Options that can be specified by arguments are ignored if `temporary` is NIL and |
339 | 354 | result0))) |
340 | 355 |
|
341 | 356 | (defun buffer-undo-boundary (&optional (buffer (current-buffer))) |
342 | | - (unless (eq :separator (last-edit-history buffer)) |
343 | | - (vector-push-extend :separator (buffer-edit-history buffer)))) |
| 357 | + (when (buffer-enable-undo-boundary-p) |
| 358 | + (unless (eq :separator (last-edit-history buffer)) |
| 359 | + (vector-push-extend :separator (buffer-edit-history buffer))))) |
344 | 360 |
|
345 | 361 | (defun buffer-value (buffer name &optional default) |
346 | 362 | "`buffer`のバッファ変数`name`に束縛されている値を返します。 |
|
0 commit comments