Commit 2944d406 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

* 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.
parent e7d52a4d
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
struct buffer_text to avoid accessing an uninitialized value struct buffer_text to avoid accessing an uninitialized value
when compact_buffer is called for the first time. when compact_buffer is called for the first time.
(compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF. (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
(Fset_buffer_modified_p): Use buffer_window_count to check
whether the buffer is displayed in some window.
* xdisp.c (message_dolog): Likewise.
   
2012-12-23 Eli Zaretskii <eliz@gnu.org> 2012-12-23 Eli Zaretskii <eliz@gnu.org>
   
......
...@@ -1341,7 +1341,7 @@ DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p, ...@@ -1341,7 +1341,7 @@ DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p,
A non-nil FLAG means mark the buffer modified. */) A non-nil FLAG means mark the buffer modified. */)
(Lisp_Object flag) (Lisp_Object flag)
{ {
Lisp_Object fn, buffer, window; Lisp_Object fn;
#ifdef CLASH_DETECTION #ifdef CLASH_DETECTION
/* If buffer becoming modified, lock the file. /* If buffer becoming modified, lock the file.
...@@ -1394,9 +1394,7 @@ A non-nil FLAG means mark the buffer modified. */) ...@@ -1394,9 +1394,7 @@ A non-nil FLAG means mark the buffer modified. */)
Ideally, I think there should be another mechanism for fontifying Ideally, I think there should be another mechanism for fontifying
buffers without "modifying" buffers, or redisplay should be buffers without "modifying" buffers, or redisplay should be
smarter about updating the `*' in mode lines. --gerd */ smarter about updating the `*' in mode lines. --gerd */
XSETBUFFER (buffer, current_buffer); if (buffer_window_count (current_buffer))
window = Fget_buffer_window (buffer, Qt);
if (WINDOWP (window))
{ {
++update_mode_lines; ++update_mode_lines;
current_buffer->prevent_redisplay_optimizations_p = 1; current_buffer->prevent_redisplay_optimizations_p = 1;
......
...@@ -9397,7 +9397,8 @@ message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte) ...@@ -9397,7 +9397,8 @@ message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte)
int old_windows_or_buffers_changed = windows_or_buffers_changed; int old_windows_or_buffers_changed = windows_or_buffers_changed;
ptrdiff_t point_at_end = 0; ptrdiff_t point_at_end = 0;
ptrdiff_t zv_at_end = 0; ptrdiff_t zv_at_end = 0;
Lisp_Object old_deactivate_mark, tem; Lisp_Object old_deactivate_mark;
bool shown;
struct gcpro gcpro1; struct gcpro gcpro1;
   
old_deactivate_mark = Vdeactivate_mark; old_deactivate_mark = Vdeactivate_mark;
...@@ -9539,9 +9540,9 @@ message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte) ...@@ -9539,9 +9540,9 @@ message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte)
unchain_marker (XMARKER (oldbegv)); unchain_marker (XMARKER (oldbegv));
unchain_marker (XMARKER (oldzv)); unchain_marker (XMARKER (oldzv));
   
tem = Fget_buffer_window (Fcurrent_buffer (), Qt); shown = buffer_window_count (current_buffer) > 0;
set_buffer_internal (oldbuf); set_buffer_internal (oldbuf);
if (NILP (tem)) if (!shown)
windows_or_buffers_changed = old_windows_or_buffers_changed; windows_or_buffers_changed = old_windows_or_buffers_changed;
message_log_need_newline = !nlflag; message_log_need_newline = !nlflag;
Vdeactivate_mark = old_deactivate_mark; Vdeactivate_mark = old_deactivate_mark;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment