summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2014-04-19 01:36:51 +0200
committerJuanma Barranquero <lekktu@gmail.com>2014-04-19 01:36:51 +0200
commitbba633792b813249a47dde828cbf84cdb946ba60 (patch)
treee320e5217ad3dc878e49fb86be7297a5cef60e5f /src
parentf0496348d1b9b1f2fff9e4265f51cbdc77eb40dc (diff)
parent2a2e6726d1f7031d89fd6740e5b167476267f778 (diff)
downloademacs-bba633792b813249a47dde828cbf84cdb946ba60.tar.gz
Merge from emacs-24; up to 2014-04-16T15:28:06Z!eggert@cs.ucla.edu
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog20
-rw-r--r--src/emacs.c7
-rw-r--r--src/insdel.c22
-rw-r--r--src/xdisp.c14
-rw-r--r--src/xterm.c9
5 files changed, 53 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 96c46d09624..34ae84c788f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
+2014-04-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * emacs.c (close_output_streams): Don't clear and restore errno.
+
+2014-04-18 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xterm.c (x_make_frame_visible): Prevent endless loop when frame
+ never becomes visible, i.e. using XMonad (Bug#17237).
+
+2014-04-18 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (insert_left_trunc_glyphs): Ensure the left truncation
+ glyph is written to TEXT_AREA of the temporary glyph_row. (Bug#17288)
+ (Fline_pixel_height): Don't assume that the current buffer and the
+ selected window's buffer are one and the same. (Bug#17281)
+
+ * insdel.c (invalidate_buffer_caches): Invalidate the bidi
+ paragraph-start cache before the newline cache. (Bug#17269)
+
2014-04-17 Paul Eggert <eggert@cs.ucla.edu>
* term.c (tty_send_additional_strings): No need to fflush here,
@@ -23,6 +42,7 @@
2014-04-16 Eli Zaretskii <eliz@gnu.org>
+ Fix the MSDOS build.
* unexcoff.c [MSDOS]: Include libc/atexit.h.
(copy_text_and_data): Zero out the atexit chain pointer before
dumping Emacs.
diff --git a/src/emacs.c b/src/emacs.c
index 9cfc09469c2..deebb2280c7 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -690,11 +690,6 @@ void (*__malloc_initialize_hook) (void) EXTERNALLY_VISIBLE = malloc_initialize_h
static void
close_output_streams (void)
{
- int err = errno;
-
- /* close_stream checks errno, so make sure it doesn't inherit some
- random value. */
- errno = 0;
if (close_stream (stdout) != 0)
{
emacs_perror ("Write error to standard output");
@@ -703,8 +698,6 @@ close_output_streams (void)
if (close_stream (stderr) != 0)
_exit (EXIT_FAILURE);
-
- errno = err;
}
/* ARGSUSED */
diff --git a/src/insdel.c b/src/insdel.c
index 82896758a15..2894af75348 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1849,14 +1849,9 @@ invalidate_buffer_caches (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
need to consider the caches of their base buffer. */
if (buf->base_buffer)
buf = buf->base_buffer;
- if (buf->newline_cache)
- invalidate_region_cache (buf,
- buf->newline_cache,
- start - BUF_BEG (buf), BUF_Z (buf) - end);
- if (buf->width_run_cache)
- invalidate_region_cache (buf,
- buf->width_run_cache,
- start - BUF_BEG (buf), BUF_Z (buf) - end);
+ /* The bidi_paragraph_cache must be invalidated first, because doing
+ so might need to use the newline_cache (via find_newline_no_quit,
+ see below). */
if (buf->bidi_paragraph_cache)
{
if (start != end
@@ -1880,13 +1875,20 @@ invalidate_buffer_caches (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
&start_byte);
set_buffer_internal (old);
}
- if (line_beg > BUF_BEG (buf))
- start = line_beg - 1;
+ start = line_beg - (line_beg > BUF_BEG (buf));
}
invalidate_region_cache (buf,
buf->bidi_paragraph_cache,
start - BUF_BEG (buf), BUF_Z (buf) - end);
}
+ if (buf->newline_cache)
+ invalidate_region_cache (buf,
+ buf->newline_cache,
+ start - BUF_BEG (buf), BUF_Z (buf) - end);
+ if (buf->width_run_cache)
+ invalidate_region_cache (buf,
+ buf->width_run_cache,
+ start - BUF_BEG (buf), BUF_Z (buf) - end);
}
/* These macros work with an argument named `preserve_ptr'
diff --git a/src/xdisp.c b/src/xdisp.c
index 067d9f6ac0e..bb91d6f5e1f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1262,12 +1262,23 @@ Value is the height in pixels of the line at point. */)
struct it it;
struct text_pos pt;
struct window *w = XWINDOW (selected_window);
+ struct buffer *old_buffer = NULL;
+ Lisp_Object result;
+ if (XBUFFER (w->contents) != current_buffer)
+ {
+ old_buffer = current_buffer;
+ set_buffer_internal_1 (XBUFFER (w->contents));
+ }
SET_TEXT_POS (pt, PT, PT_BYTE);
start_display (&it, w, pt);
it.vpos = it.current_y = 0;
last_height = 0;
- return make_number (line_bottom_y (&it));
+ result = make_number (line_bottom_y (&it));
+ if (old_buffer)
+ set_buffer_internal_1 (old_buffer);
+
+ return result;
}
/* Return the default pixel height of text lines in window W. The
@@ -18677,6 +18688,7 @@ insert_left_trunc_glyphs (struct it *it)
truncate_it.current_x = 0;
truncate_it.face_id = DEFAULT_FACE_ID;
truncate_it.glyph_row = &scratch_glyph_row;
+ truncate_it.area = TEXT_AREA;
truncate_it.glyph_row->used[TEXT_AREA] = 0;
CHARPOS (truncate_it.position) = BYTEPOS (truncate_it.position) = -1;
truncate_it.object = make_number (0);
diff --git a/src/xterm.c b/src/xterm.c
index dd71a8a1986..85daee66717 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8900,6 +8900,7 @@ void
x_make_frame_visible (struct frame *f)
{
int original_top, original_left;
+ int tries = 0;
block_input ();
@@ -9007,7 +9008,13 @@ x_make_frame_visible (struct frame *f)
/* Force processing of queued events. */
x_sync (f);
- /* This hack is still in use at least for Cygwin. See
+ /* If on another desktop, the deiconify/map may be ignored and the
+ frame never becomes visible. XMonad does this.
+ Prevent an endless loop. */
+ if (FRAME_ICONIFIED_P (f) && ++tries > 100)
+ break;
+
+ /* This hack is still in use at least for Cygwin. See
http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00351.html.
Machines that do polling rather than SIGIO have been