diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 099bf3e9809..9b9268ae4ea 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1092,6 +1092,8 @@ the alias. This lets you selectively use an alias's arguments, so @kbd{alias mcd 'mkdir $1 && cd $1'} would cause @kbd{mcd foo} to create and switch to a directory called @samp{foo}. +@end table + @node Remote Access @section Remote Access @cmindex remote access diff --git a/lisp/files.el b/lisp/files.el index 2f9456e6605..572913e95ee 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2094,6 +2094,8 @@ Emacs treats buffers whose names begin with a space as internal buffers. To avoid confusion when visiting a file whose name begins with a space, this function prepends a \"|\" to the final result if necessary." (let* ((lastname (file-name-nondirectory (directory-file-name filename))) + (lastname (if (string= lastname "") ; FILENAME is a root directory + filename lastname)) (lastname (cond ((not (and uniquify-trailing-separator-p (file-directory-p filename))) diff --git a/lisp/net/dns.el b/lisp/net/dns.el index 1e320a2124a..42e7fb415d3 100644 --- a/lisp/net/dns.el +++ b/lisp/net/dns.el @@ -212,7 +212,7 @@ If TCP-P, the first two bytes of the packet will be the length field." spec)) (push (list 'authoritative-p (if (zerop (logand byte (ash 1 2))) nil t)) spec) - (push (list 'truncated-p (if (zerop (logand byte (ash 1 2))) nil t)) + (push (list 'truncated-p (if (zerop (logand byte (ash 1 1))) nil t)) spec) (push (list 'recursion-desired-p (if (zerop (logand byte (ash 1 0))) nil t)) spec)) diff --git a/src/window.h b/src/window.h index 5a620c958de..2a86d27d1d4 100644 --- a/src/window.h +++ b/src/window.h @@ -1133,9 +1133,11 @@ void set_window_buffer (Lisp_Object window, Lisp_Object buffer, extern Lisp_Object echo_area_window; -/* Non-zero if we should redraw the mode lines on the next redisplay. +/* Non-zero if we should redraw the mode line*s* on the next redisplay. Usually set to a unique small integer so we can track the main causes of - full redisplays in `redisplay--mode-lines-cause'. */ + full redisplays in `redisplay--mode-lines-cause'. + Here "mode lines" includes other elements not coming from the buffer's + text, such as header-lines, tab lines, frame names, menu-bars, .... */ extern int update_mode_lines; @@ -1153,6 +1155,11 @@ extern int windows_or_buffers_changed; extern void wset_redisplay (struct window *w); extern void fset_redisplay (struct frame *f); extern void bset_redisplay (struct buffer *b); + +/* Routines to indicate that the mode-lines might need to be redisplayed. + Just as for `update_mode_lines`, this includes other elements not coming + from the buffer's text, such as header-lines, tab lines, frame names, + menu-bars, .... */ extern void bset_update_mode_line (struct buffer *b); extern void wset_update_mode_line (struct window *w); /* Call this to tell redisplay to look for other windows than selected-window diff --git a/src/xdisp.c b/src/xdisp.c index d09116b3fb5..79689e6cae1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -16610,8 +16610,9 @@ redisplay_internal (void) enum {MAX_GARBAGED_FRAME_RETRIES = 2 }; int garbaged_frame_retries = 0; - /* True means redisplay has to consider all windows on all - frames. False, only selected_window is considered. */ + /* False means that only the selected_window needs to be updated. + True means that other windows may need to be updated as well, + so we need to consult `needs_no_update` for all windows. */ bool consider_all_windows_p; /* True means redisplay has to redisplay the miniwindow. */ diff --git a/src/xfns.c b/src/xfns.c index 12aef228c3a..704f7a3f892 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4036,7 +4036,7 @@ setup_xi_event_mask (struct frame *f) selected->mask = ((unsigned char *) selected) + sizeof *selected; selected->mask_len = l; selected->deviceid = XIAllMasterDevices; -#endif +#endif /* !HAVE_XINPUT2_1 */ mask.mask = m = alloca (l); memset (m, 0, l); @@ -4056,7 +4056,19 @@ setup_xi_event_mask (struct frame *f) XISetMask (m, XI_FocusOut); XISetMask (m, XI_KeyPress); XISetMask (m, XI_KeyRelease); -#endif +#endif /* !USE_GTK */ +#if defined HAVE_XINPUT2_4 + if (FRAME_DISPLAY_INFO (f)->xi2_version >= 4) + { + /* Select for gesture events. Since this configuration doesn't + use GTK 3, Emacs is the only code that can change the XI + event mask, and can safely select for gesture events on + master pointers only. */ + XISetMask (m, XI_GesturePinchBegin); + XISetMask (m, XI_GesturePinchUpdate); + XISetMask (m, XI_GesturePinchEnd); + } +#endif /* HAVE_XINPUT2_4 */ XISelectEvents (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &mask, 1); @@ -4065,7 +4077,7 @@ setup_xi_event_mask (struct frame *f) to get the event mask from the X server. */ #ifndef HAVE_XINPUT2_1 memcpy (selected->mask, m, l); -#endif +#endif /* !HAVE_XINPUT2_1 */ memset (m, 0, l); #endif /* !HAVE_GTK3 */ @@ -4080,35 +4092,45 @@ setup_xi_event_mask (struct frame *f) FRAME_OUTER_WINDOW (f), &mask, 1); memset (m, 0, l); -#endif +#endif /* USE_X_TOOLKIT */ #ifdef HAVE_XINPUT2_2 if (FRAME_DISPLAY_INFO (f)->xi2_version >= 2) { + /* Select for touch events from all devices. + + Emacs will only process touch events originating + from slave devices, as master pointers may also + represent dependent touch devices. */ mask.deviceid = XIAllDevices; XISetMask (m, XI_TouchBegin); XISetMask (m, XI_TouchUpdate); XISetMask (m, XI_TouchEnd); -#ifdef HAVE_XINPUT2_4 + +#if defined HAVE_XINPUT2_4 && defined USE_GTK3 if (FRAME_DISPLAY_INFO (f)->xi2_version >= 4) { + /* Now select for gesture events from all pointer devices. + Emacs will only handle gesture events from the master + pointer, but cannot afford to overwrite the event mask + set by GDK. */ + XISetMask (m, XI_GesturePinchBegin); XISetMask (m, XI_GesturePinchUpdate); XISetMask (m, XI_GesturePinchEnd); } -#endif +#endif /* HAVE_XINPUT2_4 && USE_GTK3 */ - XISelectEvents (FRAME_X_DISPLAY (f), - FRAME_X_WINDOW (f), + XISelectEvents (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &mask, 1); } -#endif +#endif /* HAVE_XINPUT2_2 */ #ifndef HAVE_XINPUT2_1 FRAME_X_OUTPUT (f)->xi_masks = selected; FRAME_X_OUTPUT (f)->num_xi_masks = 1; -#endif +#endif /* HAVE_XINPUT2_1 */ unblock_input (); } diff --git a/src/xterm.c b/src/xterm.c index 5e2d7c05c26..75e5b07f2c0 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -24295,7 +24295,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, x_display_set_last_user_time (dpyinfo, xev->time, xev->send_event, true); - if (!device) + /* Don't process touch sequences from this device if + it's a master pointer. Touch sequences aren't + canceled by the X server if a slave device is + detached, and master pointers may also represent + dependent touch devices. */ + + if (!device || device->use == XIMasterPointer) goto XI_OTHER; if (xi_find_touch_point (device, xev->detail)) @@ -24463,12 +24469,22 @@ handle_one_xevent (struct x_display_info *dpyinfo, x_display_set_last_user_time (dpyinfo, xev->time, xev->send_event, true); + /* Don't process touch sequences from this device if + it's a master pointer. Touch sequences aren't + canceled by the X server if a slave device is + detached, and master pointers may also represent + dependent touch devices. */ + if (!device) goto XI_OTHER; touchpoint = xi_find_touch_point (device, xev->detail); - if (!touchpoint) + if (!touchpoint + /* Don't send this event if nothing has changed + either. */ + || (touchpoint->x == (int) xev->event_x + && touchpoint->y == (int) xev->event_y)) goto XI_OTHER; touchpoint->x = xev->event_x; @@ -24511,7 +24527,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, x_display_set_last_user_time (dpyinfo, xev->time, xev->send_event, true); - if (!device) + /* Don't process touch sequences from this device if + it's a master pointer. Touch sequences aren't + canceled by the X server if a slave device is + detached, and master pointers may also represent + dependent touch devices. */ + + if (!device || device->use == XIMasterPointer) goto XI_OTHER; unlinked_p = xi_unlink_touch_point (xev->detail, device); @@ -24579,7 +24601,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, x_display_set_last_user_time (dpyinfo, pev->time, pev->send_event, true); - if (!device) + if (!device || device->use != XIMasterPointer) goto XI_OTHER; #ifdef HAVE_XWIDGETS