[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117882: Merge from emacs-24; up to r117499
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] trunk r117882: Merge from emacs-24; up to r117499 |
Date: |
Mon, 15 Sep 2014 00:21:04 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117882 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sun 2014-09-14 17:20:21 -0700
message:
Merge from emacs-24; up to r117499
modified:
ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1538
configure.ac
configure.in-20091113204419-o5vbwnq5f7feedwu-783
etc/NEWS news-20100311060928-aoit31wvzf25yr1z-1
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/calendar/diary-lib.el diarylib.el-20091113204419-o5vbwnq5f7feedwu-902
lisp/desktop.el desktop.el-20091113204419-o5vbwnq5f7feedwu-591
lisp/image.el image.el-20091113204419-o5vbwnq5f7feedwu-1320
lisp/mouse.el mouse.el-20091113204419-o5vbwnq5f7feedwu-123
lisp/window.el window.el-20091113204419-o5vbwnq5f7feedwu-94
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/nsterm.m nsterm.m-20091113204419-o5vbwnq5f7feedwu-8747
src/sound.c sound.c-20091113204419-o5vbwnq5f7feedwu-1323
src/w32.c w32.c-20091113204419-o5vbwnq5f7feedwu-808
src/window.c window.c-20091113204419-o5vbwnq5f7feedwu-231
src/xdisp.c xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'ChangeLog'
--- a/ChangeLog 2014-09-10 06:38:38 +0000
+++ b/ChangeLog 2014-09-15 00:20:21 +0000
@@ -1,3 +1,8 @@
+2014-09-15 Eli Zaretskii <address@hidden>
+
+ * configure.ac (HAVE_SOUND): Check for mmsystem.h header that
+ defines the sound stuff on MS-Windows. (Bug#18463)
+
2014-09-10 Paul Eggert <address@hidden>
Improve the experimental local and scoped allocation.
=== modified file 'configure.ac'
--- a/configure.ac 2014-09-10 06:38:38 +0000
+++ b/configure.ac 2014-09-15 00:20:21 +0000
@@ -1443,7 +1443,7 @@
HAVE_SOUND=no
if test "${with_sound}" != "no"; then
# Sound support for GNU/Linux, the free BSDs, and MinGW.
- AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h],
+ AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h
mmsystem.h],
have_sound_header=yes, [], [
#ifdef __MINGW32__
#define WIN32_LEAN_AND_MEAN
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2014-09-14 23:11:52 +0000
+++ b/etc/NEWS 2014-09-15 00:20:21 +0000
@@ -533,9 +533,6 @@
*** New display actions functions for `display-buffer':
-**** `display-buffer-in-previous-window' displays a buffer in a window
-previously showing that buffer.
-
**** `display-buffer-at-bottom' chooses or creates a window at the
bottom of the selected frame.
@@ -545,6 +542,9 @@
caller of `display-buffer' is ready to handle the case of not displaying
the buffer in a window.
+*** `display-buffer-in-previous-window' is now a member of
+`display-buffer-fallback-action'.
+
** Lisp evaluation
*** `eval-defun' on an already defined defcustom calls the :set function,
@@ -1417,6 +1417,11 @@
*** `with-demoted-errors' takes an additional argument `format'.
+*** Errors from timer functions are no longer silently discarded,
+but are reported as messages. So you may see "Error running timer"
+messages from code that was failing silently till now. Set
+`debug-on-error' non-nil to get a real error and a backtrace.
+
** Faces
*** Face specs set via Custom themes now replace the `defface' spec
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-09-14 23:11:52 +0000
+++ b/lisp/ChangeLog 2014-09-15 00:20:21 +0000
@@ -1,3 +1,30 @@
+2014-09-15 Glenn Morris <address@hidden>
+
+ * image.el (image-multi-frame-p): Fix thinko - do not force
+ a delay if none was specified. (Bug#18334)
+
+2014-09-15 Kan-Ru Chen <address@hidden>
+
+ * window.el (fit-window-to-buffer): Doc fix.
+
+2014-09-15 Ivan Shmakov <address@hidden> (tiny change)
+
+ * desktop.el (desktop-create-buffer): Check that buffers are still live
+ before burying them (bug#18373).
+
+2014-09-15 Glenn Morris <address@hidden>
+
+ * calendar/diary-lib.el (diary-list-entries):
+ Restore 24.3 display behavior. (Bug#18381)
+
+2014-09-15 Eli Zaretskii <address@hidden>
+
+ * 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.
+
2014-09-14 Daniel Colascione <address@hidden>
* register.el (insert-register): Change default interactive
=== modified file 'lisp/calendar/diary-lib.el'
--- a/lisp/calendar/diary-lib.el 2014-09-08 06:03:19 +0000
+++ b/lisp/calendar/diary-lib.el 2014-09-15 00:20:21 +0000
@@ -901,12 +901,20 @@
;;; (diary-include-other-diary-files) ; recurse
;;; (run-hooks 'diary-list-entries-hook))
(unless list-only
- (if (and diary-display-function
- (listp diary-display-function))
- ;; Backwards compatibility.
- (run-hooks 'diary-display-function)
- (funcall (or diary-display-function
- 'diary-simple-display))))
+ ;; Avoid M-x diary; M-x calendar; M-x diary
+ ;; clobbering the calendar window.
+ ;; FIXME this is not the right solution.
+ (let ((display-buffer-fallback-action
+ (list (delq
+ 'display-buffer-in-previous-window
+ (copy-sequence
+ (car display-buffer-fallback-action))))))
+ (if (and diary-display-function
+ (listp diary-display-function))
+ ;; Backwards compatibility.
+ (run-hooks 'diary-display-function)
+ (funcall (or diary-display-function
+ 'diary-simple-display)))))
(run-hooks 'diary-hook)))))
(and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff)))
(or d-incp (message "Preparing diary...done"))
=== modified file 'lisp/desktop.el'
--- a/lisp/desktop.el 2014-07-16 04:28:42 +0000
+++ b/lisp/desktop.el 2014-09-10 00:47:20 +0000
@@ -1375,7 +1375,9 @@
;; Restore buffer list order with new buffer at end. Don't change
;; the order for old desktop files (old desktop module behavior).
(unless (< desktop-file-version 206)
- (mapc 'bury-buffer buffer-list)
+ (dolist (buf buffer-list)
+ (and (buffer-live-p buf)
+ (bury-buffer buf)))
(when result (bury-buffer result)))
(when result
(unless (or desktop-first-buffer (< desktop-file-version 206))
=== modified file 'lisp/image.el'
--- a/lisp/image.el 2014-02-25 21:59:14 +0000
+++ b/lisp/image.el 2014-09-14 23:59:57 +0000
@@ -637,8 +637,8 @@
(images (plist-get metadata 'count))
(delay (plist-get metadata 'delay)))
(when (and images (> images 1))
- (if (or (not (numberp delay)) (< delay 0))
- (setq delay image-default-frame-delay))
+ (and delay (or (not (numberp delay)) (< delay 0))
+ (setq delay image-default-frame-delay))
(cons images delay)))))
(defun image-animated-p (image)
=== modified file 'lisp/mouse.el'
--- a/lisp/mouse.el 2014-08-11 00:59:34 +0000
+++ b/lisp/mouse.el 2014-09-15 00:20:21 +0000
@@ -396,7 +396,16 @@
;; Check whether header-line can be dragged at all.
(if (window-at-side-p window 'top)
(setq draggable nil)
- (setq height (/ (window-header-line-height window) 2))
+ ;; window-pixel-edges includes the header and mode lines, so
+ ;; we need to account for that when calculating window growth.
+ ;; On GUI frames, assume the mouse is approximately in the
+ ;; middle of the header/mode line, so we need only half the
+ ;; height in pixels.
+ (setq height
+ (cond
+ ((display-graphic-p frame)
+ (/ (window-header-line-height window) 2))
+ (t (window-header-line-height window))))
(setq window (window-in-direction 'above window t))))
((eq line 'mode)
;; Check whether mode-line can be dragged at all.
@@ -411,7 +420,11 @@
(eq minibuffer-window
(active-minibuffer-window))))))
(setq draggable nil)
- (setq height (/ (window-mode-line-height window) 2))))
+ (setq height
+ (cond
+ ((display-graphic-p frame)
+ (/ (window-mode-line-height window) 2))
+ (t (window-mode-line-height window))))))
((eq line 'vertical)
;; Get the window to adjust for the vertical case. If the scroll
;; bar is on the window's right or we drag a vertical divider,
=== modified file 'lisp/window.el'
--- a/lisp/window.el 2014-09-11 19:44:25 +0000
+++ b/lisp/window.el 2014-09-15 00:20:21 +0000
@@ -7260,7 +7260,7 @@
If WINDOW is part of a horizontal combination and the value of
the option `fit-window-to-buffer-horizontally' is non-nil, adjust
-WINDOW's height. The new width of WINDOW is calculated from the
+WINDOW's width. The new width of WINDOW is calculated from the
maximum length of its buffer's lines that follow the current
start position of WINDOW. The optional argument MAX-WIDTH
specifies a maximum width and defaults to the width of WINDOW's
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-09-14 08:23:48 +0000
+++ b/src/ChangeLog 2014-09-15 00:20:21 +0000
@@ -1,3 +1,40 @@
+2014-09-15 Eli Zaretskii <address@hidden>
+
+ * 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. (Bug#18420)
+
+ * 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)
+
+ * 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.
+
+2014-09-15 Martin Rudalics <address@hidden>
+
+ * window.c (Fresize_mini_window_internal): Set w->total_lines
+ from w->pixel_height (Bug#18422).
+
+2014-09-15 Jan Djärv <address@hidden>
+
+ * nsterm.m (updateFrameSize:, initFrameFromEmacs:)
+ (toggleFullScreen:): Take frame_resize_pixelwise into account when
+ setting resize increments (Bug#18435).
+
+2014-09-15 Eli Zaretskii <address@hidden>
+
+ * 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.
+
2014-09-14 Jan Djärv <address@hidden>
* callproc.c (init_callproc): Fix bug introduced at
=== modified file 'src/nsterm.m'
--- a/src/nsterm.m 2014-09-10 17:56:38 +0000
+++ b/src/nsterm.m 2014-09-15 00:20:21 +0000
@@ -5849,10 +5849,13 @@
// Did resize increments change because of a font change?
if (sz.width != FRAME_COLUMN_WIDTH (emacsframe) ||
- sz.height != FRAME_LINE_HEIGHT (emacsframe))
+ sz.height != FRAME_LINE_HEIGHT (emacsframe) ||
+ (frame_resize_pixelwise && sz.width != 1))
{
- sz.width = FRAME_COLUMN_WIDTH (emacsframe);
- sz.height = FRAME_LINE_HEIGHT (emacsframe);
+ sz.width = frame_resize_pixelwise
+ ? 1 : FRAME_COLUMN_WIDTH (emacsframe);
+ sz.height = frame_resize_pixelwise
+ ? 1 : FRAME_LINE_HEIGHT (emacsframe);
[win setResizeIncrements: sz];
NSTRACE_SIZE ("New size", NSMakeSize (neww, newh));
@@ -6122,8 +6125,8 @@
[win setDelegate: self];
[win useOptimizedDrawing: YES];
- sz.width = FRAME_COLUMN_WIDTH (f);
- sz.height = FRAME_LINE_HEIGHT (f);
+ sz.width = frame_resize_pixelwise ? 1 : FRAME_COLUMN_WIDTH (f);
+ sz.height = frame_resize_pixelwise ? 1 : FRAME_LINE_HEIGHT (f);
[win setResizeIncrements: sz];
[[win contentView] addSubview: self];
@@ -6470,8 +6473,8 @@
(FRAME_DEFAULT_FACE (f)),
f);
- sz.width = FRAME_COLUMN_WIDTH (f);
- sz.height = FRAME_LINE_HEIGHT (f);
+ sz.width = frame_resize_pixelwise ? 1 : FRAME_COLUMN_WIDTH (f);
+ sz.height = frame_resize_pixelwise ? 1 : FRAME_LINE_HEIGHT (f);
if (fs_state != FULLSCREEN_BOTH)
{
=== modified file 'src/sound.c'
--- a/src/sound.c 2014-09-07 07:04:01 +0000
+++ b/src/sound.c 2014-09-15 00:20:21 +0000
@@ -88,6 +88,9 @@
#include <limits.h>
#include <windows.h>
#include <mmsystem.h>
+
+#include "coding.h"
+#include "w32.h"
/* END: Windows Specific Includes */
#endif /* WINDOWSNT */
@@ -1310,8 +1313,7 @@
struct gcpro gcpro1, gcpro2;
Lisp_Object args[2];
#else /* WINDOWSNT */
- Lisp_Object lo_file = {0};
- char * psz_file = NULL;
+ Lisp_Object lo_file;
unsigned long ui_volume_tmp = UINT_MAX;
unsigned long ui_volume = UINT_MAX;
#endif /* WINDOWSNT */
@@ -1384,10 +1386,11 @@
#else /* WINDOWSNT */
- lo_file = Fexpand_file_name (attrs[SOUND_FILE], Qnil);
- len = XSTRING (lo_file)->size;
- psz_file = alloca (len + 1);
- strcpy (psz_file, XSTRING (lo_file)->data);
+ lo_file = Fexpand_file_name (attrs[SOUND_FILE], Vdata_directory);
+ lo_file = ENCODE_FILE (lo_file);
+ /* Since UNICOWS.DLL includes only a stub for mciSendStringW, we
+ need to encode the file in the ANSI codepage. */
+ lo_file = ansi_encode_filename (lo_file);
if (INTEGERP (attrs[SOUND_VOLUME]))
{
ui_volume_tmp = XFASTINT (attrs[SOUND_VOLUME]);
@@ -1409,7 +1412,7 @@
{
ui_volume = ui_volume_tmp * (UINT_MAX / 100);
}
- do_play_sound (psz_file, ui_volume);
+ do_play_sound (SDATA (lo_file), ui_volume);
#endif /* WINDOWSNT */
=== modified file 'src/w32.c'
--- a/src/w32.c 2014-09-10 17:51:53 +0000
+++ b/src/w32.c 2014-09-15 00:20:21 +0000
@@ -2391,6 +2391,8 @@
dostounix_filename (shortname);
encoded_filename = build_string (shortname);
}
+ else
+ encoded_filename = build_unibyte_string (fname);
}
else
encoded_filename = build_unibyte_string (fname);
@@ -7720,15 +7722,15 @@
if (cmd == F_DUPFD_CLOEXEC)
return sys_dup (s);
- if (winsock_lib == NULL)
- {
- errno = ENETDOWN;
- return -1;
- }
-
check_errno ();
if (fd_info[s].flags & FILE_SOCKET)
{
+ if (winsock_lib == NULL)
+ {
+ errno = ENETDOWN;
+ return -1;
+ }
+
if (cmd == F_SETFL && options == O_NONBLOCK)
{
unsigned long nblock = 1;
@@ -7745,13 +7747,36 @@
return SOCKET_ERROR;
}
}
+ else if ((fd_info[s].flags & (FILE_PIPE | FILE_WRITE))
+ == (FILE_PIPE | FILE_WRITE))
+ {
+ /* Force our writes to pipes be non-blocking. */
+ if (cmd == F_SETFL && options == O_NONBLOCK)
+ {
+ HANDLE h = (HANDLE)_get_osfhandle (s);
+ DWORD pipe_mode = PIPE_NOWAIT;
+
+ if (!SetNamedPipeHandleState (h, &pipe_mode, NULL, NULL))
+ {
+ DebPrint (("SetNamedPipeHandleState: %lu\n", GetLastError ()));
+ return SOCKET_ERROR;
+ }
+ fd_info[s].flags |= FILE_NDELAY;
+ return 0;
+ }
+ else
+ {
+ errno = EINVAL;
+ return SOCKET_ERROR;
+ }
+ }
errno = ENOTSOCK;
return SOCKET_ERROR;
}
/* Shadow main io functions: we need to handle pipes and sockets more
- intelligently, and implement non-blocking mode as well. */
+ intelligently. */
int
sys_close (int fd)
@@ -8236,7 +8261,6 @@
/* From w32xfns.c */
extern HANDLE interrupt_handle;
-/* For now, don't bother with a non-blocking mode */
int
sys_write (int fd, const void * buffer, unsigned int count)
{
@@ -8388,6 +8412,22 @@
nchars += n;
if (n < 0)
{
+ /* When there's no buffer space in a pipe that is in the
+ non-blocking mode, _write returns ENOSPC. We return
+ EAGAIN instead, which should trigger the logic in
+ send_process that enters waiting loop and calls
+ wait_reading_process_output to allow process input to
+ be accepted during the wait. Those calls to
+ wait_reading_process_output allow sys_select to
+ notice when process input becomes available, thus
+ avoiding deadlock whereby each side of the pipe is
+ blocked on write, waiting for the other party to read
+ its end of the pipe. */
+ if (errno == ENOSPC
+ && fd < MAXDESC
+ && ((fd_info[fd].flags & (FILE_PIPE | FILE_NDELAY))
+ == (FILE_PIPE | FILE_NDELAY)))
+ errno = EAGAIN;
nchars = n;
break;
}
=== modified file 'src/window.c'
--- a/src/window.c 2014-09-11 00:48:57 +0000
+++ b/src/window.c 2014-09-15 00:20:21 +0000
@@ -4796,10 +4796,10 @@
block_input ();
window_resize_apply (r, 0);
- w->total_lines = XFASTINT (w->new_total);
+ w->pixel_height = XFASTINT (w->new_pixel);
+ w->total_lines = w->pixel_height / FRAME_LINE_HEIGHT (f);
+ w->pixel_top = r->pixel_top + r->pixel_height;
w->top_line = r->top_line + r->total_lines;
- w->pixel_height = XFASTINT (w->new_pixel);
- w->pixel_top = r->pixel_top + r->pixel_height;
fset_redisplay (f);
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2014-09-07 07:04:01 +0000
+++ b/src/xdisp.c 2014-09-15 00:20:21 +0000
@@ -1455,15 +1455,19 @@
glyph. */
int top_x = it.current_x;
int top_y = it.current_y;
+ int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w);
+ int bottom_y;
+ struct it save_it;
+ void *save_it_data = NULL;
+
/* Calling line_bottom_y may change it.method, it.position, etc. */
- enum it_method it_method = it.method;
- int bottom_y = (last_height = 0, line_bottom_y (&it));
- int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w);
-
+ SAVE_IT (save_it, it, save_it_data);
+ last_height = 0;
+ bottom_y = line_bottom_y (&it);
if (top_y < window_top_y)
visible_p = bottom_y > window_top_y;
else if (top_y < it.last_visible_y)
- visible_p = true;
+ visible_p = 1;
if (bottom_y >= it.last_visible_y
&& it.bidi_p && it.bidi_it.scan_dir == -1
&& IT_CHARPOS (it) < charpos)
@@ -1476,7 +1480,6 @@
move_it_to again with a slightly larger vertical limit,
and see if it actually moved vertically; if it did, we
didn't really reach CHARPOS, which is beyond window end. */
- struct it save_it = it;
/* Why 10? because we don't know how many canonical lines
will the height of the next line(s) be. So we guess. */
int ten_more_lines = 10 * default_line_pixel_height (w);
@@ -1486,11 +1489,11 @@
if (it.current_y > top_y)
visible_p = 0;
- it = save_it;
}
+ RESTORE_IT (&it, &save_it, save_it_data);
if (visible_p)
{
- if (it_method == GET_FROM_DISPLAY_VECTOR)
+ if (it.method == GET_FROM_DISPLAY_VECTOR)
{
/* We stopped on the last glyph of a display vector.
Try and recompute. Hack alert! */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117882: Merge from emacs-24; up to r117499,
Glenn Morris <=