Skip to content

Commit

Permalink
Do not affect buffer-modified-p.
Browse files Browse the repository at this point in the history
Not only buffer-undo-list but also buffer-modified-p shouldn't be affected
unless text is committed.

Closes #254.

BUG=#254
TEST=none
  • Loading branch information
yuki3 authored and yukawa committed Aug 15, 2015
1 parent cee212a commit d7b6196
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/mozc_version_template.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MAJOR=2
MINOR=17
BUILD=2110
BUILD=2111
REVISION=102
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
# downloaded by NaCl Mozc.
Expand Down
14 changes: 8 additions & 6 deletions src/unix/emacs/mozc.el
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,11 @@ The undo list will not be affected. ARGS defaults to
The return value is a cons which holds two markers which point to the region of
added characters."
(let ((beg (point-marker)))
(mozc-with-undo-list-unchanged
(if args
(apply #'insert args)
(insert mozc-buffer-placeholder-char)))
(mozc-with-buffer-modified-p-unchanged
(mozc-with-undo-list-unchanged
(if args
(apply #'insert args)
(insert mozc-buffer-placeholder-char))))
(cons beg (point-marker))))

(defun mozc-buffer-insert-char (&optional character count)
Expand All @@ -563,8 +564,9 @@ added characters."
(defun mozc-buffer-delete-region (region)
"Delete the text in the REGION."
(when region
(mozc-with-undo-list-unchanged
(delete-region (car region) (cdr region)))))
(mozc-with-buffer-modified-p-unchanged
(mozc-with-undo-list-unchanged
(delete-region (car region) (cdr region))))))

(defun mozc-buffer-delete-all-regions (regions)
"Delete each text in the REGIONS.
Expand Down

0 comments on commit d7b6196

Please sign in to comment.