Eli Zaretskii [Sun, 14 Sep 2014 15:18:39 +0000 (18:18 +0300)]
Fix bug #18420 with deadlocks communicating with subprocess on MS-Windows.
src/w32.c (fcntl): Support O_NONBLOCK fcntl on the write side of
pipes.
(sys_write): When a write to a non-blocking pipe returns ENOSPC,
set errno to EAGAIN instead, to allow the caller to retry the
write after some waiting. Fixes deadlocks when Emacs exchanges a
lot of data through the pipe.
Eli Zaretskii [Sat, 13 Sep 2014 08:26:44 +0000 (11:26 +0300)]
Fix expansion and encoding of sound file names on MS-Windows.
src/sound.c (Fplay_sound_internal): Encode the sound file name in
the ANSI codepage. Expand it against data-directory, as per docs,
not against the current directory. No need to make a local copy
of the file name; pass the encoded file name directly to
do_play_sound. (Bug#18463)
src/w32.c (ansi_encode_filename): If w32_get_short_filename returns
NULL, and the file name is not encodable in ANSI codepage, return
the string with "?" replacement characters, which will fail the
caller. This avoids returning a random value in that case.
Eli Zaretskii [Tue, 9 Sep 2014 15:04:35 +0000 (18:04 +0300)]
Fix the row number mistakenly reported by pos_visible_p in rare cases.
src/xdisp.c (pos_visible_p): Properly save and restore the iterator
state around the call to line_bottom, since it can move the
iterator to another screen line. This fixes off-by-one errors in
the reported row in some rare cases.
Eli Zaretskii [Tue, 9 Sep 2014 15:00:51 +0000 (18:00 +0300)]
Fix mouse-dragging mode lines on text-mode terminals.
lisp/mouse.el (mouse-drag-line): On text-mode frames, count the mode
line and header line as 1 pixel. This fixes the 1-"pixel" (row)
discrepancy between window-pixel-edges and mouse events, and
avoids moving mode line up when the mouse click is on the modeline
and no drag is attempted.
Eli Zaretskii [Thu, 4 Sep 2014 15:09:49 +0000 (18:09 +0300)]
Fix bug #18331 with "C-h k C-g" not showing documentation on Windows.
src/data.c (set_internal): Use assq_no_quit, not Fassq, to find an
existing binding of a variable, to avoid silently aborting
commands that use specbind.
Eli Zaretskii [Wed, 3 Sep 2014 16:03:34 +0000 (19:03 +0300)]
Minor updates in unidata-gen.el.
admin/unidata/unidata-gen.el (unidata-check): Bring this function up
to date with the currently supported methods of generating Unicode
property tables. Add a comment with a description how to invoke
the check. Update the copyright years in the reference to the
Unicode data files we use.
Stefan Monnier [Tue, 2 Sep 2014 19:51:25 +0000 (15:51 -0400)]
* lisp/emacs-lisp/package.el (package-generate-description-file):
Properly quote the arguments. Change second arg.
(package--alist-to-plist-args): Rename from package--alist-to-plist and
quote the elements.
(package--make-autoloads-and-stuff): Fix the test for pre-existence of
the *-pkg.el file. Adjust to new calling convention of
package-generate-description-file.
Eli Zaretskii [Tue, 2 Sep 2014 15:16:42 +0000 (18:16 +0300)]
Fix bug #18384 with incorrect reporting of row number by posn-col-row.
lisp/subr.el (posn-col-row): Revert the change from commit
2010-11-13T21:07:58Z!eliz@gnu.org, which
was inadvertently merged from emacs-23 release branch in
2010-11-18T03:54:14Z!monnier@iro.umontreal.ca, and
introduced an off-by-one error in the reported row when there is a
header line.
src/dispnew.c (buffer_posn_from_coords): Fix an off-by-one error in
the reported row in the case of a window with a header line, by
improving on the fix committed in 2011-10-08T10:58:50Z!eliz@gnu.org
eliz@gnu.org-20111008105850-ht4tvsayohvr1kjc.
Eli Zaretskii [Sun, 31 Aug 2014 15:53:27 +0000 (18:53 +0300)]
Fix cursor display on the fringe of R2L screen lines.
src/xdisp.c (display_and_set_cursor): Call erase_phys_cursor also
when HPOS is negative, for the benefit of R2L glyph rows whose
newline overflows into the fringe.
Eli Zaretskii [Sat, 23 Aug 2014 08:22:46 +0000 (11:22 +0300)]
Fix compilation warnings about snprintf in the MSDOS build.
msdos/sed2v2.inp [DJGPP <= 2.03]: Add a prototype for snprintf, to
avoid compilation warning from newer GCC versions that have
snprintf as a built-in. Reported by Juan Manuel Guerrero
<juan.guerrero@gmx.de>.
Eli Zaretskii [Sun, 17 Aug 2014 14:48:50 +0000 (17:48 +0300)]
Avoid inflooping in redisplay caused by hscrolled R2L lines.
src/xdisp.c (display_line): Don't assume that the call to
reseat_at_next_visible_line_start ends up at a character
immediately following the newline on the previous line. Avoids
setting the ends_at_zv_p flag on screen lines that are not at or
beyond ZV, which causes infloop in redisplay. For the details, see
http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00368.html.
* src/fileio.c: Revert 2013-01-31 change.
(choose_write_coding_system): No longer callable from Lisp.
Move last piece back here from Fwrite_region.
(Fwrite_region, syms_of_fileio): Update for above changes.
* test/automated/data/files-bug18141.el.gz: New file.
* test/automated/files.el (files-test-bug-18141-file):
New variable and test.
Paul Eggert [Sun, 10 Aug 2014 20:40:57 +0000 (13:40 -0700)]
Don't prevent random file systems from being unmounted.
This fix relies on having the 'fchdir' function, and on having
"." be searchable (or at least readable, on platforms lacking O_SEARCH),
but that's good enough to handle the vast majority of cases and the
remaining folks can just live with the annoyance of file systems
that occasionally can't be unmounted.
* configure.ac (fchdir): New function to check for.
* lib/save-cwd.c: Copy from gnulib, except omit the part that
allocates memory, since that can cause problems in Emacs.
* lib/save-cwd.h: Copy from gnulib.
Martin Rudalics [Sat, 9 Aug 2014 16:50:13 +0000 (18:50 +0200)]
In display-buffer-below-selected reuse window below selected if it shows buffer already (Bug#18181).
* window.el (display-buffer-below-selected): Restore original
behavior if buffer is already displayed in the window below the
selected one (Bug#18181).
Martin Rudalics [Sat, 9 Aug 2014 11:12:45 +0000 (13:12 +0200)]
Second attempt to fix some doc-strings in window.c.
* window.c (Fwindow_new_total, Fwindow_new_normal)
(Fwindow_new_pixel, Fset_window_new_pixel)
(Fset_window_new_total, Fset_window_new_normal): Second attempt
to fix the doc-strings of these functions. See:
http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-08/msg00287.html
Eli Zaretskii [Tue, 5 Aug 2014 13:34:06 +0000 (16:34 +0300)]
Fix bug #18195 with inaccurate results from window-screen-lines.
lisp/simple.el (default-line-height): A floating-point value of
line-spacing means a fraction of the default frame font's height,
not of the font currently used by the 'default' face. Truncate
the pixel value, like the display engine does.
(window-screen-lines): Use window-inside-pixel-edges for
determining the window height in pixels.
Dmitry Antipov [Tue, 5 Aug 2014 06:04:38 +0000 (10:04 +0400)]
Fix bug with uninitialized undo list of an indirect buffer (Bug#18180).
* buffer.c (Fmake_indirect_buffer): Initialize undo list with the
base buffer's undo list.
Dmitry Antipov [Sun, 3 Aug 2014 07:19:43 +0000 (11:19 +0400)]
Fix bug with an attempt to select uninitialized frame (Bug#18161).
* xfns.c (Fx_create_frame): Move call to change_frame_size to
a section where Lisp evaluation is disabled. This way a pointer
to uninitialized frame is not accessible from Lisp, which becomes
critical if following call to x_figure_window_size throws an error.
Paul Eggert [Sat, 2 Aug 2014 22:58:09 +0000 (15:58 -0700)]
Fix bug with clang + directory_files_internal + GC.
* src/dired.c (directory_files_internal): Use a volatile variable
to prevent the compiler from optimizing away all copies of a local.
I wonder how many other GC-related bugs like this lurk elsewhere?
Paul Eggert [Sat, 2 Aug 2014 21:31:18 +0000 (14:31 -0700)]
Avoid 100% CPU utilization on ssh session exit.
* src/xterm.h (struct x_display_info): New member 'connection'.
* src/xterm.c (x_term_init, x_delete_terminal): Set and use it,
so that x_delete_terminal has a file descriptor to pass to
delete_keyboard_wait_descriptor.
Eli Zaretskii [Fri, 1 Aug 2014 09:39:04 +0000 (12:39 +0300)]
Fix display of R2L lines when the last character fits only partially.
See http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00476.html
for the details.
src/xdisp.c (extend_face_to_end_of_line): If the last glyph of an
R2L row is visible only partially, give the row a negative x
offset.
(display_line): Fix the calculation of the glyph whose pixel width
is used to decide whether the last produced glyph fits on the
line. When the last glyph fits only partially, give the row a
negative x offset.
Eli Zaretskii [Tue, 29 Jul 2014 08:19:29 +0000 (11:19 +0300)]
Fix hscroll of R2L lines that begin with a TAB or another wide glyph.
src/xdisp.c (append_stretch_glyph): In a R2L glyph row, decrease the
pixel width of the first glyph that is hscrolled from display.
(display_line): In R2L glyph rows, don't give a negative offset to
row->x when the first glyph begins before first_visible_x.
Eli Zaretskii [Mon, 28 Jul 2014 13:09:02 +0000 (16:09 +0300)]
Fix another part of bug #18035 with redisplay of line-prefix and linum-mode.
src/xdisp.c (display_line): If called with iterator set up to write
to a marginal area, delay the call to handle_line_prefix until we
switch back to the text area.
Stephen Berman [Fri, 25 Jul 2014 16:01:05 +0000 (18:01 +0200)]
Fix code and doc involving marked items.
* todo-mode.texi (Marked Items): Correct omission of item deletion
from commands applying to both todo and done items.
* calendar/todo-mode.el: Fix handling of marked items and make
minor code improvements.
(todo-edit-item): If there are marked items, ensure user can only
invoke editing commands that work with marked items.
(todo-edit-item--text): When there are marked items, make it a
noop if invoked with point not on an item; otherwise, ensure it
applies only to item at point.
(todo-item-undone): If there are marked not-done items, return
point to its original position before signaling user error.
(todo--user-error-if-marked-done-item): New function.
(todo-edit-item--header, todo-edit-item--diary-inclusion)
(todo-item-done): Use it.