commit 82aa5be7ce1d5f508d42a4bb394760198a1c6e62 (HEAD, refs/remotes/origin/master) Merge: 333e95196f c5b0019e10 Author: Stefan Kangas Date: Thu Jan 27 09:07:56 2022 +0100 ; Merge from origin/emacs-28 The following commits were skipped: c5b0019e10 Fix copyright-find-copyright when searching from the end ed18d08f6f Fix copyright.el comment and add a test commit 333e95196f31ad1a19174ac925f3733789ecee91 Author: Po Lu Date: Thu Jan 27 14:07:08 2022 +0800 * lisp/xwidget.el (xwidget-webkit-edit-mode-map): Pass C-backspace. diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 487c6b2219..e50324ac47 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -987,6 +987,7 @@ You can retrieve the value with `xwidget-get'." (define-key xwidget-webkit-edit-mode-map [M-up] 'xwidget-webkit-pass-command-event) (define-key xwidget-webkit-edit-mode-map [M-down] 'xwidget-webkit-pass-command-event) (define-key xwidget-webkit-edit-mode-map [M-return] 'xwidget-webkit-pass-command-event) +(define-key xwidget-webkit-edit-mode-map [C-backspace] 'xwidget-webkit-pass-command-event) (define-minor-mode xwidget-webkit-edit-mode "Minor mode for editing the content of WebKit buffers. commit b89ae23636f42962194f74e8958ac785b245590c Author: Po Lu Date: Thu Jan 27 13:56:32 2022 +0800 Implement crossing event generation between windows for xwidgets on X * src/xwidget.c (enum xw_crossing_mode): New enum. (xwidget_motion_notify): (xwidget_motion_or_crossing): Synthesize crossing events if the pointer moved between different windows. (window_coords_from_toplevel): (xw_maybe_synthesize_crossing): New functions. (xwidget_init_view): Initialize new field to NULL. (Fdelete_xwidget_view): Clear last crossing window. * src/xwidget.h (struct xwidget_view): New field `last_crossing_window'. diff --git a/src/xwidget.c b/src/xwidget.c index 822bed0349..c42d1609d7 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -224,6 +224,13 @@ xw_forward_event_from_view (GtkWidget *widget, GdkEvent *event, #endif #ifdef HAVE_X_WINDOWS +enum xw_crossing_mode + { + XW_CROSSING_LEFT, + XW_CROSSING_ENTERED, + XW_CROSSING_NONE + }; + static guint xw_translate_x_modifiers (struct x_display_info *dpyinfo, unsigned int modifiers) @@ -253,6 +260,10 @@ xw_translate_x_modifiers (struct x_display_info *dpyinfo, return mods; } + +static bool xw_maybe_synthesize_crossing (struct xwidget_view *, + GdkWindow *, int, int, int, + Time, unsigned int); #endif DEFUN ("make-xwidget", @@ -1222,10 +1233,14 @@ xwidget_motion_notify (struct xwidget_view *view, if (!target) { - target_x = lrint (x); - target_y = lrint (y); + target_x = lrint (x + view->clip_left); + target_y = lrint (y + view->clip_top); target = model->widget_osr; } + else if (xw_maybe_synthesize_crossing (view, gtk_widget_get_window (target), + x + view->clip_left, y + view->clip_top, + XW_CROSSING_NONE, time, state)) + return; xg_event = gdk_event_new (GDK_MOTION_NOTIFY); xg_event->any.window = gtk_widget_get_window (target); @@ -1377,13 +1392,106 @@ xi_translate_notify_detail (int detail) } #endif +static void +window_coords_from_toplevel (GdkWindow *window, GdkWindow *toplevel, + int x, int y, int *out_x, int *out_y) +{ + GdkWindow *parent; + GList *children, *l; + gdouble x_out, y_out; + + children = NULL; + while ((parent = gdk_window_get_parent (window)) != toplevel) + { + children = g_list_prepend (children, window); + window = parent; + } + + for (l = children; l != NULL; l = l->next) + gdk_window_coords_from_parent (l->data, x, y, &x_out, &y_out); + + g_list_free (children); + + *out_x = x_out; + *out_y = y_out; +} + +static bool +xw_maybe_synthesize_crossing (struct xwidget_view *view, + GdkWindow *current_window, + int x, int y, int crossing, + Time time, unsigned int state) +{ + GdkWindow *last_crossing; + GdkEvent *xg_event; + GdkWindow *toplevel; + int cx, cy; + + if (view->last_crossing_window + && (gdk_window_is_destroyed (view->last_crossing_window) + || crossing == XW_CROSSING_LEFT)) + g_clear_pointer (&view->last_crossing_window, + g_object_unref); + last_crossing = view->last_crossing_window; + + if (!last_crossing) + { + view->last_crossing_window = g_object_ref (current_window); + return false; + } + + toplevel = gtk_widget_get_window (XXWIDGET (view->model)->widgetwindow_osr); + + if (last_crossing != current_window) + { + view->last_crossing_window = g_object_ref (current_window); + + xg_event = gdk_event_new (GDK_LEAVE_NOTIFY); + gdk_event_set_device (xg_event, find_suitable_pointer (view->frame)); + window_coords_from_toplevel (last_crossing, toplevel, + x, y, &cx, &cy); + xg_event->crossing.x = cx; + xg_event->crossing.y = cy; + xg_event->crossing.time = time; + xg_event->crossing.focus = FALSE; + xg_event->crossing.state = state; + /* TODO: actually calculate the event detail and mode. */ + xg_event->crossing.detail = GDK_NOTIFY_NONLINEAR; + xg_event->crossing.mode = GDK_CROSSING_NORMAL; + xg_event->crossing.window = g_object_ref (last_crossing); + + gtk_main_do_event (xg_event); + gdk_event_free (xg_event); + + xg_event = gdk_event_new (GDK_ENTER_NOTIFY); + gdk_event_set_device (xg_event, find_suitable_pointer (view->frame)); + window_coords_from_toplevel (current_window, toplevel, + x, y, &cx, &cy); + xg_event->crossing.x = cx; + xg_event->crossing.y = cy; + xg_event->crossing.time = time; + xg_event->crossing.focus = FALSE; + xg_event->crossing.state = state; + xg_event->crossing.detail = GDK_NOTIFY_NONLINEAR; + xg_event->crossing.mode = GDK_CROSSING_NORMAL; + xg_event->crossing.window = g_object_ref (current_window); + + gtk_main_do_event (xg_event); + gdk_event_free (xg_event); + g_object_unref (last_crossing); + + return true; + } + + return false; +} + void xwidget_motion_or_crossing (struct xwidget_view *view, const XEvent *event) { GdkEvent *xg_event; struct xwidget *model = XXWIDGET (view->model); - int x; - int y; + int x, y, toplevel_x, toplevel_y; GtkWidget *target; #ifdef HAVE_XINPUT2 XIEnterEvent *xev = NULL; @@ -1401,14 +1509,14 @@ xwidget_motion_or_crossing (struct xwidget_view *view, const XEvent *event) : (event->type == LeaveNotify ? GDK_LEAVE_NOTIFY : GDK_ENTER_NOTIFY)); + toplevel_x = (event->type == MotionNotify + ? event->xmotion.x + view->clip_left + : event->xcrossing.x + view->clip_left); + toplevel_y = (event->type == MotionNotify + ? event->xmotion.y + view->clip_top + : event->xcrossing.y + view->clip_top); target = find_widget_at_pos (model->widgetwindow_osr, - (event->type == MotionNotify - ? event->xmotion.x + view->clip_left - : event->xcrossing.x + view->clip_left), - (event->type == MotionNotify - ? event->xmotion.y + view->clip_top - : event->xcrossing.y + view->clip_top), - &x, &y); + toplevel_x, toplevel_y, &x, &y); } #ifdef HAVE_XINPUT2 else @@ -1421,8 +1529,10 @@ xwidget_motion_or_crossing (struct xwidget_view *view, const XEvent *event) ? GDK_ENTER_NOTIFY : GDK_LEAVE_NOTIFY); target = find_widget_at_pos (model->widgetwindow_osr, - lrint (xev->event_x + view->clip_left), - lrint (xev->event_y + view->clip_top), + (toplevel_x + = lrint (xev->event_x + view->clip_left)), + (toplevel_y + = lrint (xev->event_y + view->clip_top)), &x, &y); } #endif @@ -1437,13 +1547,24 @@ xwidget_motion_or_crossing (struct xwidget_view *view, const XEvent *event) if (event->type == MotionNotify) { - xg_event->motion.x = x; - xg_event->motion.y = y; - xg_event->motion.x_root = event->xmotion.x_root; - xg_event->motion.y_root = event->xmotion.y_root; - xg_event->motion.time = event->xmotion.time; - xg_event->motion.state = event->xmotion.state; - xg_event->motion.device = find_suitable_pointer (view->frame); + if (!xw_maybe_synthesize_crossing (view, xg_event->any.window, + toplevel_x, toplevel_y, + XW_CROSSING_NONE, event->xmotion.time, + event->xmotion.state)) + { + xg_event->motion.x = x; + xg_event->motion.y = y; + xg_event->motion.x_root = event->xmotion.x_root; + xg_event->motion.y_root = event->xmotion.y_root; + xg_event->motion.time = event->xmotion.time; + xg_event->motion.state = event->xmotion.state; + xg_event->motion.device = find_suitable_pointer (view->frame); + } + else + { + gdk_event_free (xg_event); + return; + } } #ifdef HAVE_XINPUT2 else if (event->type == GenericEvent) @@ -1468,11 +1589,34 @@ xwidget_motion_or_crossing (struct xwidget_view *view, const XEvent *event) xg_event->crossing.state |= GDK_BUTTON3_MASK; } + if (xw_maybe_synthesize_crossing (view, xg_event->any.window, + toplevel_x, toplevel_y, + (xev->type == XI_Enter + ? XW_CROSSING_ENTERED + : XW_CROSSING_LEFT), + xev->time, xg_event->crossing.state)) + { + gdk_event_free (xg_event); + return; + } + gdk_event_set_device (xg_event, find_suitable_pointer (view->frame)); } #endif else { + if (xw_maybe_synthesize_crossing (view, xg_event->any.window, + toplevel_x, toplevel_y, + (event->type == EnterNotify + ? XW_CROSSING_ENTERED + : XW_CROSSING_LEFT), + event->xcrossing.time, + event->xcrossing.state)) + { + gdk_event_free (xg_event); + return; + } + xg_event->crossing.detail = min (5, event->xcrossing.detail); xg_event->crossing.time = event->xcrossing.time; xg_event->crossing.x = x; @@ -2135,6 +2279,7 @@ xwidget_init_view (struct xwidget *xww, xv->frame = s->f; xv->cursor = cursor_for_hit (xww->hit_result, s->f); xv->just_resized = false; + xv->last_crossing_window = NULL; #elif defined HAVE_PGTK xv->dpyinfo = FRAME_DISPLAY_INFO (s->f); xv->widget = gtk_drawing_area_new (); @@ -2757,6 +2902,9 @@ DEFUN ("delete-xwidget-view", XDestroyWindow (xv->dpy, xv->wdesc); Fremhash (make_fixnum (xv->wdesc), x_window_to_xwv_map); } + + g_clear_pointer (&xv->last_crossing_window, + g_object_unref); #else gtk_widget_destroy (xv->widget); #endif diff --git a/src/xwidget.h b/src/xwidget.h index ee74e53c4d..5f05a5f59d 100644 --- a/src/xwidget.h +++ b/src/xwidget.h @@ -118,6 +118,8 @@ struct xwidget_view #ifndef HAVE_PGTK Display *dpy; Window wdesc; + + GdkWindow *last_crossing_window; #else struct pgtk_display_info *dpyinfo; GtkWidget *widget; commit 2b150f943bc875cf9ce5ac614472e27db697fff9 Author: Stefan Kangas Date: Thu Jan 27 04:23:18 2022 +0100 Silence byte-compiler slightly in tests * test/src/comp-resources/comp-test-45603.el (comp-test-45603--call-marked): * test/src/comp-resources/comp-test-funcs.el (comp-tests-discardn-f, comp-test-42360-f, comp-test-46824-1-f) (comp-test-silly-frame2): Silence byte-compiler. diff --git a/test/src/comp-resources/comp-test-45603.el b/test/src/comp-resources/comp-test-45603.el index f1c0dafb68..65147ee015 100644 --- a/test/src/comp-resources/comp-test-45603.el +++ b/test/src/comp-resources/comp-test-45603.el @@ -7,7 +7,7 @@ (defvar comp-test-45603-directory) (defvar comp-test-45603-marked-candidates) -(defun comp-test-45603--call-marked (action) +(defun comp-test-45603--call-marked (_action) (let* ((prefix-len (length comp-test-45603-mark-prefix)) (marked-candidates (mapcar @@ -17,7 +17,8 @@ (expand-file-name cand comp-test-45603-directory) cand))) comp-test-45603-marked-candidates)) - (multi-action (comp-test-45603--get-multi-action comp-test-45603-last))))) + (_multi-action (comp-test-45603--get-multi-action comp-test-45603-last))) + marked-candidates)) (defalias 'comp-test-45603--file-local-name (if (fboundp 'file-local-name) diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el index b3fd2bcd17..0a60f4d6cc 100644 --- a/test/src/comp-resources/comp-test-funcs.el +++ b/test/src/comp-resources/comp-test-funcs.el @@ -189,7 +189,7 @@ ;; Bnumberp (numberp x)) -(defun comp-tests-discardn-f (x) +(defun comp-tests-discardn-f (_x) ;; BdiscardN (1+ (let ((a 1) (_b) @@ -297,8 +297,8 @@ ;; potentially use all registers and that is modifying local ;; variables inside condition-case. (let ((str-len (length str)) - (str-width 14) - (ellipsis-width 3) + (_str-width 14) + (_ellipsis-width 3) (idx 0) (column 0) (head-padding "") (tail-padding "") @@ -489,7 +489,7 @@ (cl-defun comp-test-46824-1-f () (let ((next-repos '(1))) (while t - (let ((recipe (car next-repos))) + (let ((_recipe (car next-repos))) (cl-block loop (while t (let ((err @@ -640,7 +640,7 @@ (2 2)) 3)))) -(defun comp-test-silly-frame2 (token) +(defun comp-test-silly-frame2 (_token) ;; Check robustness against dead code. (while c (cl-case c commit 5b931eb8ff088891c73a9c952f19e20ccd7e2dae Author: Stefan Kangas Date: Thu Jan 27 04:15:13 2022 +0100 Don't use obsolete second argument to byte-compile-file * test/src/comp-resources/comp-test-funcs.el (comp-test-big-interactive): Don't use obsolete second argument to byte-compile-file. diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el index d740a5f810..b3fd2bcd17 100644 --- a/test/src/comp-resources/comp-test-funcs.el +++ b/test/src/comp-resources/comp-test-funcs.el @@ -677,7 +677,7 @@ (progn (if (and noninteractive (not byte-compile-verbose)) (message "Compiling %s..." filename)) - (byte-compile-file filename load)) + (byte-compile-file filename)) (when load (load (if (file-exists-p dest) dest filename))) 'no-byte-compile))) commit 8f9f1701f632ed72f511fb66bf14417b63524e9a Author: Stefan Kangas Date: Thu Jan 27 03:56:49 2022 +0100 Don't discourage auto-mode-alist entries in autoloads * lisp/files.el (auto-mode-alist, interpreter-mode-alist): Delete comment discouraging entries in autoload directives. (Bug#8158) diff --git a/lisp/files.el b/lisp/files.el index aabe8f445e..4ba71e6144 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2757,8 +2757,7 @@ since only a single case-insensitive search through the alist is made." (defvar auto-mode-alist ;; Note: The entries for the modes defined in cc-mode.el (c-mode, ;; c++-mode, java-mode and more) are added through autoload - ;; directives in that file. That way is discouraged since it - ;; spreads out the definition of the initial value. + ;; directives in that file. (mapcar (lambda (elt) (cons (purecopy (car elt)) (cdr elt))) @@ -3056,8 +3055,7 @@ and `magic-mode-alist', which determines modes based on file contents.") (defvar interpreter-mode-alist ;; Note: The entries for the modes defined in cc-mode.el (awk-mode ;; and pike-mode) are added through autoload directives in that - ;; file. That way is discouraged since it spreads out the - ;; definition of the initial value. + ;; file. (mapcar (lambda (l) (cons (purecopy (car l)) (cdr l))) commit a0fbdb5166e6bd7eccb7a3327b587b5ca5404b3b Author: Po Lu Date: Thu Jan 27 10:03:56 2022 +0800 Improve XI2 valuator reset logic * src/xterm.c (handle_one_xevent): Clear valuators on XI_Leave instead of XI_Enter. diff --git a/src/xterm.c b/src/xterm.c index d52d7311bb..30a3aee20e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10390,32 +10390,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, { #ifdef HAVE_XWIDGETS struct xwidget_view *xwidget_view = xwidget_view_from_window (enter->event); -#else - bool xwidget_view = false; -#endif - - /* One problem behind the design of XInput 2 scrolling is - that valuators are not unique to each window, but only - the window that has grabbed the valuator's device or - the window that the device's pointer is on top of can - receive motion events. There is also no way to - retrieve the value of a valuator outside of each motion - event. - - As such, to prevent wildly inaccurate results when the - valuators have changed outside Emacs, we reset our - records of each valuator's value whenever the pointer - re-enters a frame after its valuators have potentially - been changed elsewhere. */ - if (enter->detail != XINotifyInferior - && enter->mode != XINotifyPassiveUngrab - /* See the comment under FocusIn in - `x_detect_focus_change'. The main relevant culprit - these days seems to be XFCE. */ - && enter->mode != XINotifyUngrab - && (xwidget_view - || (any && enter->event == FRAME_X_WINDOW (any)))) - xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid); +#endif #ifdef HAVE_XWIDGETS if (xwidget_view) @@ -10457,6 +10432,22 @@ handle_one_xevent (struct x_display_info *dpyinfo, ev.window = leave->event; any = x_top_window_to_frame (dpyinfo, leave->event); + /* One problem behind the design of XInput 2 scrolling is + that valuators are not unique to each window, but only + the window that has grabbed the valuator's device or + the window that the device's pointer is on top of can + receive motion events. There is also no way to + retrieve the value of a valuator outside of each motion + event. + + As such, to prevent wildly inaccurate results when the + valuators have changed outside Emacs, we reset our + records of each valuator's value whenever the pointer + moves out of a frame (and not into one of its + children, which we know about). */ + if (leave->detail != XINotifyInferior && any) + xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid); + #ifdef HAVE_XWIDGETS { struct xwidget_view *xvw commit 458024a3d9e3c58d11deeb879ffc73c96840f6f0 Author: Po Lu Date: Thu Jan 27 09:33:11 2022 +0800 * src/xterm.c (x_focus_frame): Set input focus on outer window. diff --git a/src/xterm.c b/src/xterm.c index 1684048ea4..d52d7311bb 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -14026,7 +14026,7 @@ x_focus_frame (struct frame *f, bool noactivate) } else { - XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), RevertToParent, CurrentTime); if (!noactivate) x_ewmh_activate_frame (f); commit 7116092eaf82514ea1c08a4b227fab2131e1a3ab Author: Po Lu Date: Thu Jan 27 01:25:20 2022 +0000 Get rid of unnecessary draw locking in haikumenu.c * src/haikumenu.c (Fhaiku_menu_bar_open): Stop holding the draw lock. diff --git a/src/haikumenu.c b/src/haikumenu.c index b73baf72e0..875f1afb6a 100644 --- a/src/haikumenu.c +++ b/src/haikumenu.c @@ -646,10 +646,8 @@ the position of the last non-menu event instead. */) if (FRAME_EXTERNAL_MENU_BAR (f)) { block_input (); - BView_draw_lock (FRAME_HAIKU_VIEW (f)); set_frame_menubar (f, 1); BMenuBar_start_tracking (FRAME_HAIKU_MENU_BAR (f)); - BView_draw_unlock (FRAME_HAIKU_VIEW (f)); unblock_input (); } else commit 824440a7c8213e3c36d027248112d1dad06a3bb7 Author: Po Lu Date: Thu Jan 27 09:20:25 2022 +0800 Apply fix for bug#52761 to GTK native input as well * src/xgselect.c (xg_select): Apply said fix on regular GTK builds when native input is being used. diff --git a/src/xgselect.c b/src/xgselect.c index d22340fc9b..7252210c68 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -96,15 +96,18 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds, int n_gfds, retval = 0, our_fds = 0, max_fds = fds_lim - 1; int i, nfds, tmo_in_millisec, must_free = 0; bool need_to_dispatch; -#ifdef HAVE_PGTK +#ifdef USE_GTK bool already_has_events; #endif context = g_main_context_default (); acquire_select_lock (context); -#ifdef HAVE_PGTK +#ifdef USE_GTK already_has_events = g_main_context_pending (context); +#ifndef HAVE_PGTK + already_has_events = already_has_events && x_gtk_use_native_input; +#endif #endif if (rfds) all_rfds = *rfds; @@ -153,21 +156,26 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds, tmop = &tmo; } -#ifndef HAVE_PGTK +#ifndef USE_GTK fds_lim = max_fds + 1; nfds = thread_select (pselect, fds_lim, &all_rfds, have_wfds ? &all_wfds : NULL, efds, tmop, sigmask); #else - /* - On PGTK, when you type a key, the key press event are received, - and one more key press event seems to be received internally. - The second event is not via a socket, so there are weird status: - - socket read buffer is empty - - a key press event is pending - In that case, we should not sleep, and dispatch the event immediately. - Bug#52761 - */ + /* On PGTK, when you type a key, the key press event are received, + and one more key press event seems to be received internally. + + The same can happen with GTK native input, which makes input + slow. + + The second event is not sent via the display connection, so the + following is the case: + + - socket read buffer is empty + - a key press event is pending + + In that case, we should not sleep in pselect, and dispatch the + event immediately. (Bug#52761) */ if (!already_has_events) { fds_lim = max_fds + 1; commit 6fcf7c9a830522ca4e3a0aebee66a0638e1b4442 Author: Glenn Morris Date: Wed Jan 26 16:58:21 2022 -0500 * Makefile.in (install-etc): Remove unnecessary chown. Not needed since this rule was changed to not use tar, 2012-05-11. diff --git a/Makefile.in b/Makefile.in index 8ac6f52746..877802ec11 100644 --- a/Makefile.in +++ b/Makefile.in @@ -694,8 +694,6 @@ install-etcdoc: src install-arch-indep printf 'Copying %s to %s ...\n' "etc/$$docfile" \ "$(DESTDIR)${etcdocdir}"; \ ${INSTALL_DATA} etc/$${docfile} "$(DESTDIR)${etcdocdir}/$${docfile}"; \ - $(set_installuser); \ - chown $${installuser} "$(DESTDIR)${etcdocdir}/$${docfile}" || true ; \ else true; fi ## FIXME: commit 0a51a85b5de0ca245252a679f2c44f1d9d0363dd Author: Lars Ingebrigtsen Date: Wed Jan 26 18:54:58 2022 +0100 Make smerge-refine-ignore-whitespace into defcustom * lisp/vc/smerge-mode.el (smerge-refine-ignore-whitespace): Make into defcustom (bug#12585). diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index 6a4f6542b5..003b26eca4 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -925,8 +925,11 @@ Its behavior has mainly two restrictions: to `smerge-refine-regions'. This only matters if `smerge-refine-weight-hack' is nil.") -(defvar smerge-refine-ignore-whitespace t - "If non-nil, `smerge-refine' should try to ignore change in whitespace.") +(defcustom smerge-refine-ignore-whitespace t + "If non-nil, `smerge-refine' should try to ignore change in whitespace." + :type 'boolean + :version "29.1" + :group 'diff) (defvar smerge-refine-weight-hack t "If non-nil, pass to diff as many lines as there are chars in the region. commit 66b99778b8109c557f22d76fadd1d75a0b5fa7fa Author: Mattias Engdegård Date: Wed Jan 26 16:47:31 2022 +0100 Add tests for concat, vconcat and append * test/src/fns-tests.el (fns-tests-concat) (fns-concat, fns-vconcat, fns-append): New. diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index f74e925d3b..723ef4c710 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -1192,4 +1192,74 @@ (should-error (line-number-at-pos -1)) (should-error (line-number-at-pos 100)))) +(defun fns-tests-concat (&rest args) + ;; Dodge the byte-compiler's partial evaluation of `concat' with + ;; constant arguments. + (apply #'concat args)) + +(ert-deftest fns-concat () + (should (equal (fns-tests-concat) "")) + (should (equal (fns-tests-concat "") "")) + (should (equal (fns-tests-concat nil) "")) + (should (equal (fns-tests-concat []) "")) + (should (equal (fns-tests-concat [97 98]) "ab")) + (should (equal (fns-tests-concat '(97 98)) "ab")) + (should (equal (fns-tests-concat "ab" '(99 100) nil [101 102] "gh") + "abcdefgh")) + (should (equal (fns-tests-concat "Ab" "\200" "cd") "Ab\200cd")) + (should (equal (fns-tests-concat "aB" "\200" "çd") "aB\200çd")) + (should (equal (fns-tests-concat "AB" (string-to-multibyte "\200") "cd") + (string-to-multibyte "AB\200cd"))) + (should (equal (fns-tests-concat "ab" '(#xe5) [255] "cd") "abåÿcd")) + (should (equal (fns-tests-concat '(#x3fffff) [#x3fff80] "xy") "\377\200xy")) + (should (equal (fns-tests-concat '(#x3fffff) [#x3fff80] "xy§") "\377\200xy§")) + (should (equal-including-properties + (fns-tests-concat #("abc" 0 3 (a 1)) #("de" 0 2 (a 1))) + #("abcde" 0 5 (a 1)))) + (should (equal-including-properties + (fns-tests-concat #("abc" 0 3 (a 1)) "§ü" #("çå" 0 2 (b 2))) + #("abc§üçå" 0 3 (a 1) 5 7 (b 2)))) + (should-error (fns-tests-concat "a" '(98 . 99)) + :type 'wrong-type-argument) + (let ((loop (list 66 67))) + (setcdr (cdr loop) loop) + (should-error (fns-tests-concat "A" loop) + :type 'circular-list))) + +(ert-deftest fns-vconcat () + (should (equal (vconcat) [])) + (should (equal (vconcat nil) [])) + (should (equal (vconcat "") [])) + (should (equal (vconcat [1 2 3]) [1 2 3])) + (should (equal (vconcat '(1 2 3)) [1 2 3])) + (should (equal (vconcat "ABC") [65 66 67])) + (should (equal (vconcat "ü§") [252 167])) + (should (equal (vconcat [1 2 3] nil '(4 5) "AB" "å" + "\377" (string-to-multibyte "\377") + (bool-vector t nil nil t nil)) + [1 2 3 4 5 65 66 #xe5 255 #x3fffff t nil nil t nil])) + (should-error (vconcat [1] '(2 . 3)) + :type 'wrong-type-argument) + (let ((loop (list 1 2))) + (setcdr (cdr loop) loop) + (should-error (vconcat [1] loop) + :type 'circular-list))) + +(ert-deftest fns-append () + (should (equal (append) nil)) + (should (equal (append 'tail) 'tail)) + (should (equal (append [1 2 3] nil '(4 5) "AB" "å" + "\377" (string-to-multibyte "\377") + (bool-vector t nil nil t nil) + '(9 10)) + '(1 2 3 4 5 65 66 #xe5 255 #x3fffff t nil nil t nil 9 10))) + (should (equal (append '(1 2) '(3 4) 'tail) + '(1 2 3 4 . tail))) + (should-error (append '(1 . 2) '(3)) + :type 'wrong-type-argument) + (let ((loop (list 1 2))) + (setcdr (cdr loop) loop) + (should-error (append loop '(end)) + :type 'circular-list))) + ;;; fns-tests.el ends here commit a3aeee88aaf843de49e4815e4b2d61743e423441 Author: Mattias Engdegård Date: Wed Jan 26 11:28:33 2022 +0100 Minor `concat` tweaks * src/fns.c (concat): Do things in the right order for speed. (concat_strings): Initialise variable. diff --git a/src/fns.c b/src/fns.c index 87237f3b5e..16f1ebe439 100644 --- a/src/fns.c +++ b/src/fns.c @@ -790,9 +790,8 @@ concat_strings (ptrdiff_t nargs, Lisp_Object *args) if (STRINGP (arg)) { - ptrdiff_t arg_len_byte; + ptrdiff_t arg_len_byte = SBYTES (arg); len = SCHARS (arg); - arg_len_byte = SBYTES (arg); if (STRING_MULTIBYTE (arg)) dest_multibyte = true; else @@ -986,15 +985,16 @@ concat (ptrdiff_t nargs, Lisp_Object *args, Lisp_Object last_tail, memory_full (SIZE_MAX); } + /* When the target is a list, return the tail directly if all other + arguments are empty. */ + if (!vector_target && result_len == 0) + return last_tail; + /* Create the output object. */ Lisp_Object result = vector_target ? make_nil_vector (result_len) : Fmake_list (make_fixnum (result_len), Qnil); - /* In `append', if all but last arg are nil, return last arg. */ - if (!vector_target && NILP (result)) - return last_tail; - /* Copy the contents of the args into the result. */ Lisp_Object tail = Qnil; ptrdiff_t toindex = 0; @@ -1022,14 +1022,12 @@ concat (ptrdiff_t nargs, Lisp_Object *args, Lisp_Object last_tail, /* Fetch next element of `arg' arg into `elt', or break if `arg' is exhausted. */ Lisp_Object elt; - if (NILP (arg)) - break; if (CONSP (arg)) { elt = XCAR (arg); arg = XCDR (arg); } - else if (argindex >= arglen) + else if (NILP (arg) || argindex >= arglen) break; else if (STRINGP (arg)) { commit c5b0019e1047d3b770611bb7dea3d2a705e56082 Author: Lars Ingebrigtsen Date: Wed Jan 26 15:02:00 2022 +0100 Fix copyright-find-copyright when searching from the end * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Make the double check also work when searching from the end (bug#7179). Do not merge to master. diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 23b90808d9..6b60097782 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -152,7 +152,9 @@ This function sets the match data that `copyright-update-year' uses." ;; copyright line, so re-perform the search without the ;; limit. (Otherwise we may be inserting the new year in the ;; middle of the list of years.) - (goto-char (match-beginning 0)) + (if copyright-at-end-flag + (goto-char (match-end 0)) + (goto-char (match-beginning 0))) (copyright-re-search regexp nil t))))) (defun copyright-find-end () diff --git a/test/lisp/emacs-lisp/copyright-tests.el b/test/lisp/emacs-lisp/copyright-tests.el index 120cd5a6b5..abb0913a0d 100644 --- a/test/lisp/emacs-lisp/copyright-tests.el +++ b/test/lisp/emacs-lisp/copyright-tests.el @@ -61,5 +61,16 @@ (buffer-substring (- (point-max) 42) (point-max)))) "Copyright 2006, 2007, 2008, 2022 Foo Bar\n\n"))) +(ert-deftest test-correct-notice () + (should (equal + (with-temp-buffer + (dotimes (_ 2) + (insert "Copyright 2021 FSF\n")) + (let ((copyright-at-end-flag t) + (copyright-query nil)) + (copyright-update)) + (buffer-string)) + "Copyright 2021 FSF\nCopyright 2021, 2022 FSF\n"))) + (provide 'copyright-tests) ;;; copyright-tests.el ends here commit ed18d08f6f3041e6fd1806690c24ca6b31deab2d Author: Lars Ingebrigtsen Date: Wed Jan 26 14:53:07 2022 +0100 Fix copyright.el comment and add a test * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Fix comment (bug#7179). Do not merge to master. diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 09c6ded295..23b90808d9 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -150,7 +150,7 @@ This function sets the match data that `copyright-update-year' uses." (when (copyright-re-search regexp (copyright-limit) t) ;; We may accidentally have landed in the middle of a ;; copyright line, so re-perform the search without the - ;; search. (Otherwise we may be inserting the new year in the + ;; limit. (Otherwise we may be inserting the new year in the ;; middle of the list of years.) (goto-char (match-beginning 0)) (copyright-re-search regexp nil t))))) diff --git a/test/lisp/emacs-lisp/copyright-tests.el b/test/lisp/emacs-lisp/copyright-tests.el index dc82974a99..120cd5a6b5 100644 --- a/test/lisp/emacs-lisp/copyright-tests.el +++ b/test/lisp/emacs-lisp/copyright-tests.el @@ -50,5 +50,16 @@ (dolist (test copyright-tests--data) (with-copyright-test (car test) (cdr test)))) +(ert-deftest test-end-chop () + (should + (equal + (with-temp-buffer + (let ((copyright-query nil)) + (insert (make-string (- copyright-limit 14) ?x) "\n" + "\nCopyright 2006, 2007, 2008 Foo Bar\n\n") + (copyright-update) + (buffer-substring (- (point-max) 42) (point-max)))) + "Copyright 2006, 2007, 2008, 2022 Foo Bar\n\n"))) + (provide 'copyright-tests) ;;; copyright-tests.el ends here commit 826959ccb4ce36c15e2dc3e1fa4a4dbc345875dc Author: Lars Ingebrigtsen Date: Wed Jan 26 15:02:00 2022 +0100 Fix copyright-find-copyright when searching from the end * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Make the double check also work when searching from the end (bug#7179). diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 23b90808d9..6b60097782 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -152,7 +152,9 @@ This function sets the match data that `copyright-update-year' uses." ;; copyright line, so re-perform the search without the ;; limit. (Otherwise we may be inserting the new year in the ;; middle of the list of years.) - (goto-char (match-beginning 0)) + (if copyright-at-end-flag + (goto-char (match-end 0)) + (goto-char (match-beginning 0))) (copyright-re-search regexp nil t))))) (defun copyright-find-end () diff --git a/test/lisp/emacs-lisp/copyright-tests.el b/test/lisp/emacs-lisp/copyright-tests.el index 120cd5a6b5..abb0913a0d 100644 --- a/test/lisp/emacs-lisp/copyright-tests.el +++ b/test/lisp/emacs-lisp/copyright-tests.el @@ -61,5 +61,16 @@ (buffer-substring (- (point-max) 42) (point-max)))) "Copyright 2006, 2007, 2008, 2022 Foo Bar\n\n"))) +(ert-deftest test-correct-notice () + (should (equal + (with-temp-buffer + (dotimes (_ 2) + (insert "Copyright 2021 FSF\n")) + (let ((copyright-at-end-flag t) + (copyright-query nil)) + (copyright-update)) + (buffer-string)) + "Copyright 2021 FSF\nCopyright 2021, 2022 FSF\n"))) + (provide 'copyright-tests) ;;; copyright-tests.el ends here commit 8a343ecee543faeb1be1e7e9de5f3163209f4da6 Author: Lars Ingebrigtsen Date: Wed Jan 26 14:53:07 2022 +0100 Fix copyright.el comment and add a test * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Fix comment (bug#7179). diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 09c6ded295..23b90808d9 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -150,7 +150,7 @@ This function sets the match data that `copyright-update-year' uses." (when (copyright-re-search regexp (copyright-limit) t) ;; We may accidentally have landed in the middle of a ;; copyright line, so re-perform the search without the - ;; search. (Otherwise we may be inserting the new year in the + ;; limit. (Otherwise we may be inserting the new year in the ;; middle of the list of years.) (goto-char (match-beginning 0)) (copyright-re-search regexp nil t))))) diff --git a/test/lisp/emacs-lisp/copyright-tests.el b/test/lisp/emacs-lisp/copyright-tests.el index dc82974a99..120cd5a6b5 100644 --- a/test/lisp/emacs-lisp/copyright-tests.el +++ b/test/lisp/emacs-lisp/copyright-tests.el @@ -50,5 +50,16 @@ (dolist (test copyright-tests--data) (with-copyright-test (car test) (cdr test)))) +(ert-deftest test-end-chop () + (should + (equal + (with-temp-buffer + (let ((copyright-query nil)) + (insert (make-string (- copyright-limit 14) ?x) "\n" + "\nCopyright 2006, 2007, 2008 Foo Bar\n\n") + (copyright-update) + (buffer-substring (- (point-max) 42) (point-max)))) + "Copyright 2006, 2007, 2008, 2022 Foo Bar\n\n"))) + (provide 'copyright-tests) ;;; copyright-tests.el ends here commit afd1fdf6bb85600e6d7fafcdbff367c0f964a576 Author: Sean Whitton Date: Wed Jan 26 14:13:00 2022 +0100 Fix input of sharp-quoted symbols in Eshell with em-extpipe * lisp/eshell/em-extpipe.el (eshell-parse-external-pipeline): Fix misinterpreting sharp-quoted symbols as the beginning of single-quoted strings (Bug#53518). Add protection against a possible infinite loop. * test/lisp/eshell/em-extpipe-tests.el (em-extpipe-test-17): New test (bug#53518). diff --git a/lisp/eshell/em-extpipe.el b/lisp/eshell/em-extpipe.el index 57aeec38ff..eb5b3bfe1d 100644 --- a/lisp/eshell/em-extpipe.el +++ b/lisp/eshell/em-extpipe.el @@ -30,6 +30,7 @@ (require 'cl-lib) (require 'esh-arg) +(require 'esh-cmd) (require 'esh-io) (require 'esh-util) @@ -97,15 +98,21 @@ as though it were Eshell syntax." (while (> bound (point)) (let* ((found (save-excursion - (re-search-forward "['\"\\]" bound t))) + (re-search-forward + "\\(?:#?'\\|\"\\|\\\\\\)" bound t))) (next (or (and found (match-beginning 0)) bound))) (if (re-search-forward pat next t) (throw 'found (match-beginning 1)) (goto-char next) - (while (or (eshell-parse-backslash) + (while (or (eshell-parse-lisp-argument) + (eshell-parse-backslash) (eshell-parse-double-quote) - (eshell-parse-literal-quote))))))))) + (eshell-parse-literal-quote))) + ;; Guard against an infinite loop if none of + ;; the parsers moved us forward. + (unless (or (> (point) next) (eobp)) + (forward-char 1)))))))) (goto-char (if (and result go) (match-end 0) start)) result))) (unless (or eshell-current-argument eshell-current-quoted) diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el index 1283b6b361..0879ad5b0c 100644 --- a/test/lisp/eshell/em-extpipe-tests.el +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -202,4 +202,8 @@ (eshell-command-result-p input "rab") (eshell-command-result-p "echo \"bar\" | rev" "nonsense")))) +;; Confirm we don't break input of sharp-quoted symbols (Bug#53518). +(em-extpipe-tests--deftest em-extpipe-test-17 "funcall #'upcase foo" + (eshell-command-result-p input "FOO")) + ;;; em-extpipe-tests.el ends here commit fc8875be071a2a7f32ce6ffc9d3d3511cab5f73b Author: Michael Albinus Date: Wed Jan 26 14:05:30 2022 +0100 Adapt tramp-tests * test/lisp/net/tramp-tests.el (tramp--test-special-characters): Adapt test candidates. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 1651ee4846..01fe7355f4 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -6472,7 +6472,7 @@ This requires restrictions of file name syntax." (unless (or (tramp--test-ftp-p) (tramp--test-gvfs-p) (tramp--test-windows-nt-or-smb-p)) - "*foo*bar*baz*") + "*foo+bar*baz+") (if (or (tramp--test-gvfs-p) (tramp--test-windows-nt-or-smb-p)) "'foo'bar'baz'" "'foo\"bar'baz\"") commit b085ca237d0eba55c39a987f77c7b79609023247 Author: Michael Albinus Date: Wed Jan 26 14:05:11 2022 +0100 Fix insert-file-contents for tramp-crypt * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist): Use `tramp-handle-insert-file-contents'. diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index c2c3689c61..2a6db03672 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -208,7 +208,7 @@ If NAME doesn't belong to a crypted remote directory, retun nil." (find-backup-file-name . tramp-handle-find-backup-file-name) ;; `get-file-buffer' performed by default handler. (insert-directory . tramp-crypt-handle-insert-directory) - ;; `insert-file-contents' performed by default handler. + (insert-file-contents . tramp-handle-insert-file-contents) (load . tramp-handle-load) (lock-file . tramp-crypt-handle-lock-file) (make-auto-save-file-name . tramp-handle-make-auto-save-file-name) commit 94216789872a24614ce85b6c0ea688eee1c9a540 Author: Po Lu Date: Wed Jan 26 20:35:04 2022 +0800 Add workaround for super modifier misconfiguration to non-XKB code * src/xterm.c (x_find_modifier_meanings): Don't let a modifier be both Hyper and Super. diff --git a/src/xterm.c b/src/xterm.c index b2cdbe6a0f..1684048ea4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5694,6 +5694,12 @@ x_find_modifier_meanings (struct x_display_info *dpyinfo) dpyinfo->alt_mod_mask &= ~dpyinfo->meta_mod_mask; } + /* If some keys are both super and hyper, make them just super. + Many X servers are misconfigured so that super and hyper are both + Mod4, but most users have no hyper key. */ + if (dpyinfo->hyper_mod_mask & dpyinfo->super_mod_mask) + dpyinfo->hyper_mod_mask &= ~dpyinfo->super_mod_mask; + XFree (syms); XFreeModifiermap (mods); } commit 1200e55b6f359c2ba71138d5b0a2093ef163d805 Author: Andrea Corallo Date: Wed Jan 26 12:19:59 2022 +0100 Make use of NILP where possible * src/w32menu.c (menubar_selection_callback, w32_menu_show): Use NILP where possible. * src/w32fns.c (w32_set_mouse_color): Likewise. * src/w16select.c (Fw16_selection_exists_p): Likewise. * src/process.c (Fnetwork_lookup_address_info): Likewise. * src/cygw32.c (Fcygwin_convert_file_name_to_windows) (Fcygwin_convert_file_name_from_windows): Likewise. diff --git a/src/cygw32.c b/src/cygw32.c index 1b43de2c05..399c1f91b9 100644 --- a/src/cygw32.c +++ b/src/cygw32.c @@ -115,7 +115,7 @@ For the reverse operation, see `cygwin-convert-file-name-from-windows'. */) (Lisp_Object file, Lisp_Object absolute_p) { return from_unicode ( - conv_filename_to_w32_unicode (file, EQ (absolute_p, Qnil) ? 0 : 1)); + conv_filename_to_w32_unicode (file, NILP (absolute_p) ? 0 : 1)); } DEFUN ("cygwin-convert-file-name-from-windows", @@ -128,7 +128,7 @@ For the reverse operation, see `cygwin-convert-file-name-to-windows'. */) (Lisp_Object file, Lisp_Object absolute_p) { return conv_filename_from_w32_unicode (to_unicode (file, &file), - EQ (absolute_p, Qnil) ? 0 : 1); + NILP (absolute_p) ? 0 : 1); } void diff --git a/src/process.c b/src/process.c index 79e5896a20..7c7f608284 100644 --- a/src/process.c +++ b/src/process.c @@ -4644,7 +4644,7 @@ error displays the error message. */) struct addrinfo hints; memset (&hints, 0, sizeof hints); - if (EQ (family, Qnil)) + if (NILP (family)) hints.ai_family = AF_UNSPEC; else if (EQ (family, Qipv4)) hints.ai_family = AF_INET; diff --git a/src/w16select.c b/src/w16select.c index f6bc3dd8d4..b878481e46 100644 --- a/src/w16select.c +++ b/src/w16select.c @@ -651,7 +651,7 @@ frame's display, or the first available X display. */) by the X interface code. (On MSDOS, killed text is only put into the clipboard if we run under Windows, so we cannot check the clipboard alone.) */ - if ((EQ (selection, Qnil) || EQ (selection, QPRIMARY)) + if ((NILP (selection) || EQ (selection, QPRIMARY)) && ! NILP (Fsymbol_value (Fintern_soft (build_string ("kill-ring"), Qnil)))) return Qt; diff --git a/src/w32fns.c b/src/w32fns.c index 37f9b813c6..1ea685d194 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1217,7 +1217,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) #endif int mask_color; - if (!EQ (Qnil, arg)) + if (!NILP (arg)) f->output_data.w32->mouse_pixel = w32_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); mask_color = FRAME_BACKGROUND_PIXEL (f); @@ -1233,7 +1233,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) /* It's not okay to crash if the user selects a screwy cursor. */ count = x_catch_errors (FRAME_W32_DISPLAY (f)); - if (!EQ (Qnil, Vx_pointer_shape)) + if (!NILP (Vx_pointer_shape)) { CHECK_FIXNUM (Vx_pointer_shape); cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XFIXNUM (Vx_pointer_shape)); @@ -1242,7 +1242,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm); x_check_errors (FRAME_W32_DISPLAY (f), "bad text pointer cursor: %s"); - if (!EQ (Qnil, Vx_nontext_pointer_shape)) + if (!NILP (Vx_nontext_pointer_shape)) { CHECK_FIXNUM (Vx_nontext_pointer_shape); nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), @@ -1252,7 +1252,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_left_ptr); x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s"); - if (!EQ (Qnil, Vx_hourglass_pointer_shape)) + if (!NILP (Vx_hourglass_pointer_shape)) { CHECK_FIXNUM (Vx_hourglass_pointer_shape); hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), @@ -1263,7 +1263,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s"); x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s"); - if (!EQ (Qnil, Vx_mode_pointer_shape)) + if (!NILP (Vx_mode_pointer_shape)) { CHECK_FIXNUM (Vx_mode_pointer_shape); mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), @@ -1273,7 +1273,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm); x_check_errors (FRAME_W32_DISPLAY (f), "bad modeline pointer cursor: %s"); - if (!EQ (Qnil, Vx_sensitive_text_pointer_shape)) + if (!NILP (Vx_sensitive_text_pointer_shape)) { CHECK_FIXNUM (Vx_sensitive_text_pointer_shape); hand_cursor diff --git a/src/w32menu.c b/src/w32menu.c index 42e27babbc..57f6762c2f 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -188,7 +188,7 @@ menubar_selection_callback (struct frame *f, void * client_data) i = 0; while (i < f->menu_bar_items_used) { - if (EQ (AREF (vector, i), Qnil)) + if (NILP (AREF (vector, i))) { subprefix_stack[submenu_depth++] = prefix; prefix = entry; @@ -587,7 +587,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags, i = 0; while (i < menu_items_used) { - if (EQ (AREF (menu_items, i), Qnil)) + if (NILP (AREF (menu_items, i))) { submenu_stack[submenu_depth++] = save_wv; save_wv = prev_wv; @@ -779,7 +779,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags, i = 0; while (i < menu_items_used) { - if (EQ (AREF (menu_items, i), Qnil)) + if (NILP (AREF (menu_items, i))) { subprefix_stack[submenu_depth++] = prefix; prefix = entry;