aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-04-08 21:48:07 -0400
committerStefan Monnier2014-04-08 21:48:07 -0400
commit6bc76cee212aab0a2c02f8c28213fc842cc7880f (patch)
tree8787b3e73ae2eeaa91f2ef53e5782a2ebe65362d
parent1e1a3a324856cf7480030b6dbd7f4476c5130ad9 (diff)
downloademacs-6bc76cee212aab0a2c02f8c28213fc842cc7880f.tar.gz
emacs-6bc76cee212aab0a2c02f8c28213fc842cc7880f.zip
* src/insdel.c (prepare_to_modify_buffer_1): Cancel lock-file checks and
region handling (and don't call signal_before_change) if inhibit_modification_hooks is set. (signal_before_change): Don't check inhibit_modification_hooks any more. * lisp/subr.el (with-silent-modifications): Don't bind deactivate-mark, buffer-file-name, and buffer-file-truename any more.
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/subr.el7
-rw-r--r--src/ChangeLog7
-rw-r--r--src/insdel.c9
5 files changed, 20 insertions, 11 deletions
diff --git a/etc/NEWS b/etc/NEWS
index f78199b97d7..706d25925e4 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -71,6 +71,9 @@ protocols as well as for "telnet" and "ftp" are passed to Tramp.
71 71
72* Incompatible Lisp Changes in Emacs 24.5 72* Incompatible Lisp Changes in Emacs 24.5
73 73
74** inhibit-modification-hooks now also inhibits lock-file checks as well as
75active region handling.
76
74 77
75* Lisp Changes in Emacs 24.5 78* Lisp Changes in Emacs 24.5
76 79
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6161051faf3..26bcb7fd668 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * subr.el (with-silent-modifications): Don't bind deactivate-mark,
4 buffer-file-name, and buffer-file-truename any more.
5
12014-04-08 Leo Liu <sdl.web@gmail.com> 62014-04-08 Leo Liu <sdl.web@gmail.com>
2 7
3 Use lexical-binding and require cl-lib. 8 Use lexical-binding and require cl-lib.
diff --git a/lisp/subr.el b/lisp/subr.el
index 5de69d92e33..6cfece1045f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3174,12 +3174,7 @@ not really affect the buffer's content."
3174 `(let* ((,modified (buffer-modified-p)) 3174 `(let* ((,modified (buffer-modified-p))
3175 (buffer-undo-list t) 3175 (buffer-undo-list t)
3176 (inhibit-read-only t) 3176 (inhibit-read-only t)
3177 (inhibit-modification-hooks t) 3177 (inhibit-modification-hooks t))
3178 deactivate-mark
3179 ;; Avoid setting and removing file locks and checking
3180 ;; buffer's uptodate-ness w.r.t the underlying file.
3181 buffer-file-name
3182 buffer-file-truename)
3183 (unwind-protect 3178 (unwind-protect
3184 (progn 3179 (progn
3185 ,@body) 3180 ,@body)
diff --git a/src/ChangeLog b/src/ChangeLog
index ea32a480a6c..531d1f646cb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12014-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * insdel.c (prepare_to_modify_buffer_1): Cancel lock-file checks and
4 region handling (and don't call signal_before_change) if
5 inhibit_modification_hooks is set.
6 (signal_before_change): Don't check inhibit_modification_hooks any more.
7
12014-04-08 Daniel Colascione <dancol@dancol.org> 82014-04-08 Daniel Colascione <dancol@dancol.org>
2 9
3 * alloc.c (sweep_symbols, mark_object): Assert that symbol 10 * alloc.c (sweep_symbols, mark_object): Assert that symbol
diff --git a/src/insdel.c b/src/insdel.c
index 9f9fcbd041f..15cdaf6f910 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1804,6 +1804,9 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t end,
1804 else 1804 else
1805 base_buffer = current_buffer; 1805 base_buffer = current_buffer;
1806 1806
1807 if (inhibit_modification_hooks)
1808 return;
1809
1807 if (!NILP (BVAR (base_buffer, file_truename)) 1810 if (!NILP (BVAR (base_buffer, file_truename))
1808 /* Make binding buffer-file-name to nil effective. */ 1811 /* Make binding buffer-file-name to nil effective. */
1809 && !NILP (BVAR (base_buffer, filename)) 1812 && !NILP (BVAR (base_buffer, filename))
@@ -1813,7 +1816,6 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t end,
1813 /* If `select-active-regions' is non-nil, save the region text. */ 1816 /* If `select-active-regions' is non-nil, save the region text. */
1814 /* FIXME: Move this to Elisp (via before-change-functions). */ 1817 /* FIXME: Move this to Elisp (via before-change-functions). */
1815 if (!NILP (BVAR (current_buffer, mark_active)) 1818 if (!NILP (BVAR (current_buffer, mark_active))
1816 && !inhibit_modification_hooks
1817 && XMARKER (BVAR (current_buffer, mark))->buffer 1819 && XMARKER (BVAR (current_buffer, mark))->buffer
1818 && NILP (Vsaved_region_selection) 1820 && NILP (Vsaved_region_selection)
1819 && (EQ (Vselect_active_regions, Qonly) 1821 && (EQ (Vselect_active_regions, Qonly)
@@ -1924,9 +1926,6 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
1924 ptrdiff_t count = SPECPDL_INDEX (); 1926 ptrdiff_t count = SPECPDL_INDEX ();
1925 struct rvoe_arg rvoe_arg; 1927 struct rvoe_arg rvoe_arg;
1926 1928
1927 if (inhibit_modification_hooks)
1928 return;
1929
1930 start = make_number (start_int); 1929 start = make_number (start_int);
1931 end = make_number (end_int); 1930 end = make_number (end_int);
1932 preserve_marker = Qnil; 1931 preserve_marker = Qnil;
@@ -1937,7 +1936,7 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
1937 specbind (Qinhibit_modification_hooks, Qt); 1936 specbind (Qinhibit_modification_hooks, Qt);
1938 1937
1939 /* If buffer is unmodified, run a special hook for that case. The 1938 /* If buffer is unmodified, run a special hook for that case. The
1940 check for Vfirst_change_hook is just a minor optimization. */ 1939 check for Vfirst_change_hook is just a minor optimization. */
1941 if (SAVE_MODIFF >= MODIFF 1940 if (SAVE_MODIFF >= MODIFF
1942 && !NILP (Vfirst_change_hook)) 1941 && !NILP (Vfirst_change_hook))
1943 { 1942 {