aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-12-24 16:21:42 +0400
committerDmitry Antipov2012-12-24 16:21:42 +0400
commit2944d406dbf0512368ce0c9de36f347ccbae289b (patch)
treeb4f9cc3c30718e89ae67c085085ff4e9d58f5021 /src
parente7d52a4de53b86c780c9ee0fbd6239450550756f (diff)
downloademacs-2944d406dbf0512368ce0c9de36f347ccbae289b.tar.gz
emacs-2944d406dbf0512368ce0c9de36f347ccbae289b.zip
* buffer.c (Fset_buffer_modified_p): Use buffer_window_count
to check whether the buffer is displayed in some window. * xdisp.c (message_dolog): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/buffer.c6
-rw-r--r--src/xdisp.c7
3 files changed, 9 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1967cdb8557..cb799f627d1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -5,6 +5,9 @@
5 struct buffer_text to avoid accessing an uninitialized value 5 struct buffer_text to avoid accessing an uninitialized value
6 when compact_buffer is called for the first time. 6 when compact_buffer is called for the first time.
7 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF. 7 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
8 (Fset_buffer_modified_p): Use buffer_window_count to check
9 whether the buffer is displayed in some window.
10 * xdisp.c (message_dolog): Likewise.
8 11
92012-12-23 Eli Zaretskii <eliz@gnu.org> 122012-12-23 Eli Zaretskii <eliz@gnu.org>
10 13
diff --git a/src/buffer.c b/src/buffer.c
index 21c42fc82b7..59b139359e2 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1341,7 +1341,7 @@ DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p,
1341A non-nil FLAG means mark the buffer modified. */) 1341A non-nil FLAG means mark the buffer modified. */)
1342 (Lisp_Object flag) 1342 (Lisp_Object flag)
1343{ 1343{
1344 Lisp_Object fn, buffer, window; 1344 Lisp_Object fn;
1345 1345
1346#ifdef CLASH_DETECTION 1346#ifdef CLASH_DETECTION
1347 /* If buffer becoming modified, lock the file. 1347 /* If buffer becoming modified, lock the file.
@@ -1394,9 +1394,7 @@ A non-nil FLAG means mark the buffer modified. */)
1394 Ideally, I think there should be another mechanism for fontifying 1394 Ideally, I think there should be another mechanism for fontifying
1395 buffers without "modifying" buffers, or redisplay should be 1395 buffers without "modifying" buffers, or redisplay should be
1396 smarter about updating the `*' in mode lines. --gerd */ 1396 smarter about updating the `*' in mode lines. --gerd */
1397 XSETBUFFER (buffer, current_buffer); 1397 if (buffer_window_count (current_buffer))
1398 window = Fget_buffer_window (buffer, Qt);
1399 if (WINDOWP (window))
1400 { 1398 {
1401 ++update_mode_lines; 1399 ++update_mode_lines;
1402 current_buffer->prevent_redisplay_optimizations_p = 1; 1400 current_buffer->prevent_redisplay_optimizations_p = 1;
diff --git a/src/xdisp.c b/src/xdisp.c
index 5b959f5e472..cbecf558ccc 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9397,7 +9397,8 @@ message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte)
9397 int old_windows_or_buffers_changed = windows_or_buffers_changed; 9397 int old_windows_or_buffers_changed = windows_or_buffers_changed;
9398 ptrdiff_t point_at_end = 0; 9398 ptrdiff_t point_at_end = 0;
9399 ptrdiff_t zv_at_end = 0; 9399 ptrdiff_t zv_at_end = 0;
9400 Lisp_Object old_deactivate_mark, tem; 9400 Lisp_Object old_deactivate_mark;
9401 bool shown;
9401 struct gcpro gcpro1; 9402 struct gcpro gcpro1;
9402 9403
9403 old_deactivate_mark = Vdeactivate_mark; 9404 old_deactivate_mark = Vdeactivate_mark;
@@ -9539,9 +9540,9 @@ message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte)
9539 unchain_marker (XMARKER (oldbegv)); 9540 unchain_marker (XMARKER (oldbegv));
9540 unchain_marker (XMARKER (oldzv)); 9541 unchain_marker (XMARKER (oldzv));
9541 9542
9542 tem = Fget_buffer_window (Fcurrent_buffer (), Qt); 9543 shown = buffer_window_count (current_buffer) > 0;
9543 set_buffer_internal (oldbuf); 9544 set_buffer_internal (oldbuf);
9544 if (NILP (tem)) 9545 if (!shown)
9545 windows_or_buffers_changed = old_windows_or_buffers_changed; 9546 windows_or_buffers_changed = old_windows_or_buffers_changed;
9546 message_log_need_newline = !nlflag; 9547 message_log_need_newline = !nlflag;
9547 Vdeactivate_mark = old_deactivate_mark; 9548 Vdeactivate_mark = old_deactivate_mark;