commit aedb74b2940cffa56c26c142c4bb8c2a7a21839f (HEAD, refs/remotes/origin/master) Merge: ec1aaac5c0 5942504391 Author: Stefan Kangas Date: Thu Feb 24 06:30:36 2022 +0100 Merge from origin/emacs-28 5942504391 Reword face-remap-add-relative manual entry commit ec1aaac5c0fb621461a171bb241d2e1c74509d1e Author: Po Lu Date: Thu Feb 24 11:58:41 2022 +0800 Set border colors through the toolkit * src/xfns.c (x_set_border_pixel): Set colors through Xt to avoid some problems. diff --git a/src/xfns.c b/src/xfns.c index 977096c13c..03adb5ab8d 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1472,6 +1472,21 @@ x_set_border_pixel (struct frame *f, unsigned long pix) unload_color (f, f->output_data.x->border_pixel); f->output_data.x->border_pixel = pix; +#ifdef USE_X_TOOLKIT + if (f->output_data.x->widget && f->border_width > 0) + { + block_input (); + XtVaSetValues (f->output_data.x->widget, XtNborderColor, + (Pixel) pix, NULL); + unblock_input (); + + if (FRAME_VISIBLE_P (f)) + redraw_frame (f); + + return; + } +#endif + if (FRAME_X_WINDOW (f) != 0 && f->border_width > 0) { block_input (); commit fe7c0798e879c54f660cc0371fa3ef0fd063a77a Author: Po Lu Date: Thu Feb 24 03:35:25 2022 +0000 Fix auto-lower when the mouse moves onto a scrollbar on Haiku * src/haiku_support.cc (MouseMoved): (BView_inside_scroll_bar): New functions. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_read_socket): Don't auto-lower if the pointer left the view for a scroll bar. diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 4f6a96568c..9aeb03c4c9 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -1607,6 +1607,30 @@ class EmacsScrollBar : public BScrollBar haiku_write (SCROLL_BAR_DRAG_EVENT, &rq); BScrollBar::MouseUp (pt); } + + void + MouseMoved (BPoint point, uint32 transit, const BMessage *msg) + { + struct haiku_menu_bar_left_event rq; + BPoint conv; + + if (transit == B_EXITED_VIEW) + { + conv = ConvertToParent (point); + + rq.x = std::lrint (conv.x); + rq.y = std::lrint (conv.y); + rq.window = this->Window (); + + if (movement_locker.Lock ()) + { + haiku_write (MENU_BAR_LEFT, &rq); + movement_locker.Unlock (); + } + } + + BScrollBar::MouseMoved (point, transit, msg); + } }; class EmacsTitleMenuItem : public BMenuItem @@ -2266,6 +2290,23 @@ BView_forget_scroll_bar (void *view, int x, int y, int width, int height) } } +bool +BView_inside_scroll_bar (void *view, int x, int y) +{ + EmacsView *vw = (EmacsView *) view; + bool val; + + if (vw->LockLooper ()) + { + val = vw->sb_region.Contains (BPoint (x, y)); + vw->UnlockLooper (); + } + else + val = false; + + return val; +} + void BView_get_mouse (void *view, int *x, int *y) { diff --git a/src/haiku_support.h b/src/haiku_support.h index ef433514fe..1deb867c5f 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -666,6 +666,9 @@ extern "C" extern void BView_forget_scroll_bar (void *view, int x, int y, int width, int height); + extern bool + BView_inside_scroll_bar (void *view, int x, int y); + extern void BView_get_mouse (void *view, int *x, int *y); diff --git a/src/haikuterm.c b/src/haikuterm.c index c184501a20..83330b5f63 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2799,7 +2799,10 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) need_flush = 1; } - if (f->auto_lower && !popup_activated_p) + if (f->auto_lower && !popup_activated_p + /* Don't do this if the mouse entered a scroll bar. */ + && !BView_inside_scroll_bar (FRAME_HAIKU_VIEW (f), + b->x, b->y)) { /* If we're leaving towards the menu bar, don't auto-lower here, and wait for a exit commit 543ae215c111e175871c6efc891d7816c2dd0f8c Author: Po Lu Date: Thu Feb 24 09:38:37 2022 +0800 Add support for _NET_WM_STATE_SHADED * doc/lispref/frames.texi (Management Parameters): Document new frame parameter `shaded'. * etc/NEWS: Announce new frame parameter. * src/frame.c (frame_parms) [HAVE_X_WINDOWS]: New frame parameter `shaded'. (syms_of_frame): New symbol `shaded'. * src/xfns.c (x_frame_parm_handlers): Install handler `x_set_shaded'. * src/xterm.c (x_set_shaded): New frame parameter handler. (x_get_current_wm_state): New parameter `shaded'. All callers changed. (x_net_wm_state): (x_handle_net_wm_state): Handle shaded state. (x_term_init): Intern new atom `shaded'. * src/xterm.h: Update prototypes. diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index f8188708e5..bae8eb3c70 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -2168,6 +2168,11 @@ prevent hanging with those window managers. If non-@code{nil}, the frame is visible on all virtual desktops on systems with virtual desktops. +@vindex shaded@r{, a frame parameter} +@item sticky +If non-@code{nil}, tell the window manager to display the frame in a +way that its contents are hidden, leaving only the title bar. + @vindex inhibit-double-buffering@r{, a frame parameter} @item inhibit-double-buffering If non-@code{nil}, the frame is drawn to the screen without double diff --git a/etc/NEWS b/etc/NEWS index b08bdc6451..76a9ecdbc0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -232,6 +232,11 @@ resource "synchronizeResize" to "off". This controls the opacity of the text background when running on a composited display. ++++ +** New frame parameter 'shaded'. +On supported window managers, this controls whether or not a frame's +contents will be hidden, leaving only the title bar. + --- ** New user option 'x-gtk-use-native-input'. This controls whether or not GTK input methods are used by Emacs, diff --git a/src/frame.c b/src/frame.c index 8750fe4889..b7ff7fd1fc 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3908,6 +3908,9 @@ static const struct frame_parm_table frame_parms[] = {"override-redirect", SYMBOL_INDEX (Qoverride_redirect)}, {"no-special-glyphs", SYMBOL_INDEX (Qno_special_glyphs)}, {"alpha-background", SYMBOL_INDEX (Qalpha_background)}, +#ifdef HAVE_X_WINDOWS + {"shaded", SYMBOL_INDEX (Qshaded)}, +#endif #ifdef NS_IMPL_COCOA {"ns-appearance", SYMBOL_INDEX (Qns_appearance)}, {"ns-transparent-titlebar", SYMBOL_INDEX (Qns_transparent_titlebar)}, @@ -6084,6 +6087,7 @@ syms_of_frame (void) DEFSYM (Qfullheight, "fullheight"); DEFSYM (Qfullboth, "fullboth"); DEFSYM (Qmaximized, "maximized"); + DEFSYM (Qshaded, "shaded"); DEFSYM (Qx_resource_name, "x-resource-name"); DEFSYM (Qx_frame_parameter, "x-frame-parameter"); diff --git a/src/xfns.c b/src/xfns.c index b2e3615fcf..977096c13c 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -8900,6 +8900,7 @@ frame_parm_handler x_frame_parm_handlers[] = x_set_override_redirect, gui_set_no_special_glyphs, x_set_alpha_background, + x_set_shaded, }; /* Some versions of libX11 don't have symbols for a few functions we diff --git a/src/xterm.c b/src/xterm.c index aee36b1101..66b5dce73c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -600,7 +600,7 @@ static void x_wm_set_window_state (struct frame *, int); static void x_wm_set_icon_pixmap (struct frame *, ptrdiff_t); static void x_initialize (void); -static bool x_get_current_wm_state (struct frame *, Window, int *, bool *); +static bool x_get_current_wm_state (struct frame *, Window, int *, bool *, bool *); static void x_update_opaque_region (struct frame *, XEvent *); /* Flush display of frame F. */ @@ -9354,9 +9354,9 @@ x_net_wm_state (struct frame *f, Window window) { int value = FULLSCREEN_NONE; Lisp_Object lval = Qnil; - bool sticky = false; + bool sticky = false, shaded = false; - x_get_current_wm_state (f, window, &value, &sticky); + x_get_current_wm_state (f, window, &value, &sticky, &shaded); switch (value) { @@ -9375,7 +9375,8 @@ x_net_wm_state (struct frame *f, Window window) } store_frame_param (f, Qfullscreen, lval); -/** store_frame_param (f, Qsticky, sticky ? Qt : Qnil); **/ + store_frame_param (f, Qsticky, sticky ? Qt : Qnil); + store_frame_param (f, Qshaded, shaded ? Qt : Qnil); } /* Flip back buffers on any frames with undrawn content. */ @@ -10043,8 +10044,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, { bool iconified = FRAME_ICONIFIED_P (f); int value; - bool sticky; - bool not_hidden = x_get_current_wm_state (f, event->xmap.window, &value, &sticky); + bool sticky, shaded; + bool not_hidden = x_get_current_wm_state (f, event->xmap.window, &value, &sticky, + &shaded); if (CONSP (frame_size_history)) frame_size_history_extra @@ -14143,6 +14145,18 @@ x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) dpyinfo->Xatom_net_wm_state_sticky, None); } +void +x_set_shaded (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) +{ + Lisp_Object frame; + struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); + + XSETFRAME (frame, f); + + set_wm_state (frame, !NILP (new_value), + dpyinfo->Xatom_net_wm_state_shaded, None); +} + /** * x_set_skip_taskbar: * @@ -14243,7 +14257,8 @@ static bool x_get_current_wm_state (struct frame *f, Window window, int *size_state, - bool *sticky) + bool *sticky, + bool *shaded) { unsigned long actual_size; int i; @@ -14267,6 +14282,7 @@ x_get_current_wm_state (struct frame *f, *sticky = false; *size_state = FULLSCREEN_NONE; + *shaded = false; block_input (); @@ -14328,6 +14344,8 @@ x_get_current_wm_state (struct frame *f, *size_state = FULLSCREEN_BOTH; else if (a == dpyinfo->Xatom_net_wm_state_sticky) *sticky = true; + else if (a == dpyinfo->Xatom_net_wm_state_shaded) + *shaded = true; } #ifdef USE_XCB @@ -14350,7 +14368,7 @@ do_ewmh_fullscreen (struct frame *f) int cur; bool dummy; - x_get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy); + x_get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy, &dummy); /* Some window managers don't say they support _NET_WM_STATE, but they do say they support _NET_WM_STATE_FULLSCREEN. Try that also. */ @@ -14490,8 +14508,10 @@ x_handle_net_wm_state (struct frame *f, const XPropertyEvent *event) { int value = FULLSCREEN_NONE; Lisp_Object lval; - bool sticky = false; - bool not_hidden = x_get_current_wm_state (f, event->window, &value, &sticky); + bool sticky = false, shaded = false; + bool not_hidden = x_get_current_wm_state (f, event->window, + &value, &sticky, + &shaded); lval = Qnil; switch (value) @@ -14512,6 +14532,7 @@ x_handle_net_wm_state (struct frame *f, const XPropertyEvent *event) store_frame_param (f, Qfullscreen, lval); store_frame_param (f, Qsticky, sticky ? Qt : Qnil); + store_frame_param (f, Qshaded, shaded ? Qt : Qnil); return not_hidden; } @@ -16804,6 +16825,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) ATOM_REFS_INIT ("_NET_WM_STATE_MAXIMIZED_VERT", Xatom_net_wm_state_maximized_vert) ATOM_REFS_INIT ("_NET_WM_STATE_STICKY", Xatom_net_wm_state_sticky) + ATOM_REFS_INIT ("_NET_WM_STATE_SHADED", Xatom_net_wm_state_shaded) ATOM_REFS_INIT ("_NET_WM_STATE_HIDDEN", Xatom_net_wm_state_hidden) ATOM_REFS_INIT ("_NET_WM_WINDOW_TYPE", Xatom_net_window_type) ATOM_REFS_INIT ("_NET_WM_WINDOW_TYPE_TOOLTIP", diff --git a/src/xterm.h b/src/xterm.h index 84378b9ab2..ae9300f783 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -536,10 +536,11 @@ struct x_display_info Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert, Xatom_net_wm_state_sticky, Xatom_net_wm_state_above, Xatom_net_wm_state_below, Xatom_net_wm_state_hidden, Xatom_net_wm_state_skip_taskbar, - Xatom_net_frame_extents, Xatom_net_current_desktop, Xatom_net_workarea, - Xatom_net_wm_opaque_region, Xatom_net_wm_ping, Xatom_net_wm_sync_request, - Xatom_net_wm_sync_request_counter, Xatom_net_wm_frame_drawn, - Xatom_net_wm_user_time, Xatom_net_wm_user_time_window; + Xatom_net_wm_state_shaded, Xatom_net_frame_extents, Xatom_net_current_desktop, + Xatom_net_workarea, Xatom_net_wm_opaque_region, Xatom_net_wm_ping, + Xatom_net_wm_sync_request, Xatom_net_wm_sync_request_counter, + Xatom_net_wm_frame_drawn, Xatom_net_wm_user_time, + Xatom_net_wm_user_time_window; /* XSettings atoms and windows. */ Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; @@ -1372,6 +1373,7 @@ x_mutable_colormap (Visual *visual) } extern void x_set_sticky (struct frame *, Lisp_Object, Lisp_Object); +extern void x_set_shaded (struct frame *, Lisp_Object, Lisp_Object); extern void x_set_skip_taskbar (struct frame *, Lisp_Object, Lisp_Object); extern void x_set_z_group (struct frame *, Lisp_Object, Lisp_Object); extern bool x_wm_supports (struct frame *, Atom); commit d132bfe6cdb18d12a63c80b4846d6e2404d05ec2 Author: Po Lu Date: Thu Feb 24 09:11:53 2022 +0800 Condition out things specific to some versions of the input extension * src/xterm.c (x_free_xi_devices, x_init_master_valuators) (handle_one_xevent): Condition out code that isn't supposed to be run on the current input extension version. * src/xterm.h (struct xi_scroll_valuator_t): Make conditional on HAVE_XINPUT2_1. (struct xi_touch_point_t): Make conditional on HAVE_XINPUT2_2. (struct xi_device_t): Make individual fields conditional on the appropriate client-side input extension version. diff --git a/src/xterm.c b/src/xterm.c index 1efab513e6..aee36b1101 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -780,7 +780,9 @@ x_extension_initialize (struct x_display_info *dpyinfo) static void x_free_xi_devices (struct x_display_info *dpyinfo) { +#ifdef HAVE_XINPUT2_2 struct xi_touch_point_t *tem, *last; +#endif block_input (); @@ -788,8 +790,11 @@ x_free_xi_devices (struct x_display_info *dpyinfo) { for (int i = 0; i < dpyinfo->num_devices; ++i) { +#ifdef HAVE_XINPUT2_1 xfree (dpyinfo->devices[i].valuators); +#endif +#ifdef HAVE_XINPUT2_2 tem = dpyinfo->devices[i].touchpoints; while (tem) { @@ -797,6 +802,7 @@ x_free_xi_devices (struct x_display_info *dpyinfo) tem = tem->next; xfree (last); } +#endif } xfree (dpyinfo->devices); @@ -866,16 +872,27 @@ x_init_master_valuators (struct x_display_info *dpyinfo) if (device->enabled) { +#ifdef HAVE_XINPUT2_1 int actual_valuator_count = 0; +#endif + struct xi_device_t *xi_device = &dpyinfo->devices[actual_devices++]; xi_device->device_id = device->deviceid; xi_device->grab = 0; + +#ifdef HAVE_XINPUT2_1 xi_device->valuators = xmalloc (sizeof *xi_device->valuators * device->num_classes); +#endif +#ifdef HAVE_XINPUT2_2 xi_device->touchpoints = NULL; +#endif + xi_device->master_p = (device->use == XIMasterKeyboard || device->use == XIMasterPointer); +#ifdef HAVE_XINPUT2_2 xi_device->direct_p = false; +#endif for (int c = 0; c < device->num_classes; ++c) { @@ -914,7 +931,9 @@ x_init_master_valuators (struct x_display_info *dpyinfo) } } +#ifdef HAVE_XINPUT2_1 xi_device->scroll_valuator_count = actual_valuator_count; +#endif } } @@ -923,6 +942,7 @@ x_init_master_valuators (struct x_display_info *dpyinfo) unblock_input (); } +#ifdef HAVE_XINPUT2_1 /* Return the delta of the scroll valuator VALUATOR_NUMBER under DEVICE_ID in the display DPYINFO with VALUE. The valuator's valuator will be set to VALUE afterwards. In case no scroll @@ -979,6 +999,8 @@ x_get_scroll_valuator_delta (struct x_display_info *dpyinfo, int device_id, return DBL_MAX; } +#endif + struct xi_device_t * xi_device_from_id (struct x_display_info *dpyinfo, int deviceid) { @@ -1046,7 +1068,9 @@ xi_find_touch_point (struct xi_device_t *device, int detail) return NULL; } -#endif /* XI_TouchBegin */ +#endif /* HAVE_XINPUT2_2 */ + +#ifdef HAVE_XINPUT2_1 static void xi_reset_scroll_valuators_for_device_id (struct x_display_info *dpyinfo, int id, @@ -1076,6 +1100,8 @@ xi_reset_scroll_valuators_for_device_id (struct x_display_info *dpyinfo, int id, return; } +#endif /* HAVE_XINPUT2_1 */ + #endif #ifdef USE_CAIRO @@ -11092,9 +11118,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, XIFocusInEvent *focusin = (XIFocusInEvent *) xi_event; XIFocusOutEvent *focusout = (XIFocusOutEvent *) xi_event; XIDeviceChangedEvent *device_changed = (XIDeviceChangedEvent *) xi_event; +#ifdef HAVE_XINPUT2_1 XIValuatorState *states; double *values; bool found_valuator = false; +#endif /* A fake XMotionEvent for x_note_mouse_movement. */ XMotionEvent ev; @@ -11164,8 +11192,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (!any) any = x_any_window_to_frame (dpyinfo, enter->event); +#ifdef HAVE_XINPUT2_1 xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid, true); +#endif { #ifdef HAVE_XWIDGETS @@ -11229,9 +11259,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, 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). */ +#ifdef HAVE_XINPUT2_1 if (leave->detail != XINotifyInferior && any) xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid, false); +#endif #ifdef HAVE_XWIDGETS { @@ -11291,8 +11323,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, { struct xi_device_t *device; +#ifdef HAVE_XINPUT2_1 states = &xev->valuators; values = states->values; +#endif + device = xi_device_from_id (dpyinfo, xev->deviceid); if (!device) @@ -11303,6 +11338,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto XI_OTHER; #endif +#ifdef HAVE_XINPUT2_1 #ifdef HAVE_XWIDGETS struct xwidget_view *xv = xwidget_view_from_window (xev->event); double xv_total_x = 0.0; @@ -11464,6 +11500,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, #ifdef HAVE_XWIDGETS } #endif +#endif /* HAVE_XINPUT2_1 */ ev.x = lrint (xev->event_x); ev.y = lrint (xev->event_y); @@ -11565,7 +11602,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, struct xwidget_view *xvw; #endif -#ifdef XIPointerEmulated +#ifdef HAVE_XINPUT2_1 /* Ignore emulated scroll events when XI2 native scroll events are present. */ if (xev->flags & XIPointerEmulated) @@ -12180,7 +12217,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, case XI_DeviceChanged: { struct xi_device_t *device; +#ifdef HAVE_XINPUT2_2 struct xi_touch_point_t *tem, *last; +#endif int c; #ifdef HAVE_XINPUT2_1 int i; @@ -12204,11 +12243,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, /* Free data that we will regenerate from new information. */ +#ifdef HAVE_XINPUT2_1 device->valuators = xrealloc (device->valuators, (device_changed->num_classes * sizeof *device->valuators)); device->scroll_valuator_count = 0; +#endif +#ifdef HAVE_XINPUT2_2 device->direct_p = false; +#endif for (c = 0; c < device_changed->num_classes; ++c) { @@ -12278,6 +12321,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, } #endif +#ifdef HAVE_XINPUT2_2 /* The device is no longer a DirectTouch device, so remove any touchpoints that we might have recorded. */ @@ -12294,6 +12338,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, device->touchpoints = NULL; } +#endif goto XI_OTHER; } diff --git a/src/xterm.h b/src/xterm.h index 7303565ec2..84378b9ab2 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -143,6 +143,21 @@ struct xim_inst_t }; #endif /* HAVE_X11R6_XIM */ +#ifdef HAVE_XINPUT2 +#if HAVE_XISCROLLCLASSINFO_TYPE && defined XIScrollClass +#define HAVE_XINPUT2_1 +#endif +#if HAVE_XITOUCHCLASSINFO_TYPE && defined XITouchClass +#define HAVE_XINPUT2_2 +#endif +#if HAVE_XIBARRIERRELEASEPOINTERINFO_DEVICEID && defined XIBarrierPointerReleased +#define HAVE_XINPUT2_3 +#endif +#if HAVE_XIGESTURECLASSINFO_TYPE && defined XIGestureClass +#define HAVE_XINPUT2_4 +#endif +#endif + /* Structure recording X pixmap and reference count. If REFCOUNT is 0 then this record is free to be reused. */ @@ -185,6 +200,8 @@ struct color_name_cache_entry }; #ifdef HAVE_XINPUT2 + +#ifdef HAVE_XINPUT2_1 struct xi_scroll_valuator_t { bool invalid_p; @@ -196,7 +213,9 @@ struct xi_scroll_valuator_t int number; int horizontal; }; +#endif +#ifdef HAVE_XINPUT2_2 struct xi_touch_point_t { struct xi_touch_point_t *next; @@ -204,17 +223,26 @@ struct xi_touch_point_t int number; double x, y; }; +#endif struct xi_device_t { int device_id; +#ifdef HAVE_XINPUT2_1 int scroll_valuator_count; +#endif int grab; bool master_p; +#ifdef HAVE_XINPUT2_2 bool direct_p; +#endif +#ifdef HAVE_XINPUT2_1 struct xi_scroll_valuator_t *valuators; +#endif +#ifdef HAVE_XINPUT2_2 struct xi_touch_point_t *touchpoints; +#endif }; #endif @@ -1469,21 +1497,6 @@ struct xi_device_t *xi_device_from_id (struct x_display_info *, int); (nr).width = (rwidth), \ (nr).height = (rheight)) -#ifdef HAVE_XINPUT2 -#if HAVE_XISCROLLCLASSINFO_TYPE && defined XIScrollClass -#define HAVE_XINPUT2_1 -#endif -#if HAVE_XITOUCHCLASSINFO_TYPE && defined XITouchClass -#define HAVE_XINPUT2_2 -#endif -#if HAVE_XIBARRIERRELEASEPOINTERINFO_DEVICEID && defined XIBarrierPointerReleased -#define HAVE_XINPUT2_3 -#endif -#if HAVE_XIGESTURECLASSINFO_TYPE && defined XIGestureClass -#define HAVE_XINPUT2_4 -#endif -#endif - INLINE_HEADER_END #endif /* XTERM_H */ commit 7b0e8cf347a1135e4355214634f114685e9041c3 Author: Po Lu Date: Thu Feb 24 08:43:09 2022 +0800 Fix the MS-DOS port * msdos/sedlibmk.inp: * src/conf_post.h [MSDOS]: Update for recent gnulib. diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 8602aaf449..a983b1bbb1 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -418,6 +418,8 @@ s/= @GL_GENERATE_LIMITS_H_CONDITION@/= / s/= @GL_GENERATE_GMP_H_CONDITION@/= 1/ s/= @GL_GENERATE_GMP_GMP_H_CONDITION@/= / s/= @GL_GENERATE_MINI_GMP_H_CONDITION@/= 1/ +s/= @GL_COND_OBJ_STDIO_READ_CONDITION@/= / +s/= @GL_COND_OBJ_STDIO_WRITE_CONDITION@/= / s/\$\(MKDIR_P\) malloc// # # Determine which modules to build and which to omit @@ -429,7 +431,6 @@ OMIT_GNULIB_MODULE_careadlinkat = true\ OMIT_GNULIB_MODULE_cloexec = true\ OMIT_GNULIB_MODULE_dirent = true\ OMIT_GNULIB_MODULE_dirfd = true\ -OMIT_GNULIB_MODULE_scratch_buffer = true\ OMIT_GNULIB_MODULE_dup2 = true\ OMIT_GNULIB_MODULE_errno = true\ OMIT_GNULIB_MODULE_euidaccess = true\ diff --git a/src/conf_post.h b/src/conf_post.h index cee5a0878a..dd350b8dc8 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -194,6 +194,12 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ #define iswctype(wc, type) false #define mbsinit(ps) 1 +/* Some things that lib/at-func.c wants. */ +#define GNULIB_SUPPORT_ONLY_AT_FDCWD + +/* Needed by lib/lchmod.c. */ +#define EOPNOTSUPP EINVAL + #define MALLOC_0_IS_NONNULL 1 /* We must intercept 'opendir' calls to stash away the directory name, commit ca9f2fc2a4c62981ef28f0b6c64e069f49230729 Author: Paul Eggert Date: Wed Feb 23 12:30:33 2022 -0800 Pacify gcc -Wanalyzer-null-dereference * src/xdisp.c (normal_char_ascent_descent): Pacify GCC 11.2.1 20220127 (Red Hat 11.2.1-9) x86-64 -Wanalyzer-null-dereference. diff --git a/src/xdisp.c b/src/xdisp.c index b00343daa7..acb9cb7283 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -29037,6 +29037,7 @@ normal_char_ascent_descent (struct font *font, int c, int *ascent, int *descent) if (get_char_glyph_code (c >= 0 ? c : '{', font, &char2b)) { struct font_metrics *pcm = get_per_char_metric (font, &char2b); + eassume (pcm); if (!(pcm->width == 0 && pcm->rbearing == 0 && pcm->lbearing == 0)) { commit 479623784eae84974d0cd1c20c3d9f5584f8cf16 Author: Mauro Aranda Date: Wed Feb 23 21:05:08 2022 +0100 Fix auth-sources defcustom * lisp/auth-source.el (auth-sources): The extra attributes should be in a plist, so inline both :host and :port. Also, give a valid default value for the choice (bug#54127). diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 8a425cf9bc..cb528cebdc 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -280,15 +280,16 @@ can get pretty complex." (const :tag "default" default)))) (repeat :tag "Extra Parameters" :inline t (choice :tag "Extra parameter" + :value (:host t) (list - :tag "Host" + :tag "Host" :inline t (const :format "" :value :host) (choice :tag "Host (machine) choice" (const :tag "Any" t) (regexp :tag "Regular expression"))) (list - :tag "Protocol" + :tag "Protocol" :inline t (const :format "" :value :port) (choice :tag "Protocol" commit b8a96f055624f86fe965a0d1b7b2495b2db80e63 Author: Paul Eggert Date: Wed Feb 23 11:29:56 2022 -0800 Port pre-commit hook to Git 2.35.0 * build-aux/git-hooks/pre-commit: Use LC_ALL=C grep -E instead of sane_egrep (removed in Git 2.35.0). diff --git a/build-aux/git-hooks/pre-commit b/build-aux/git-hooks/pre-commit index a55004680f..49bf05f2d9 100755 --- a/build-aux/git-hooks/pre-commit +++ b/build-aux/git-hooks/pre-commit @@ -45,7 +45,9 @@ git_diff='git diff --cached --name-only --diff-filter=A' # 'git diff' will backslash escape tabs and newlines, so we don't have # to worry about word splitting here. -$git_diff $head | sane_egrep 'ChangeLog|^-|/-|[^-+./_0-9A-Z_a-z]' | while IFS= read -r new_name; do +$git_diff $head | +LC_ALL=C grep -E 'ChangeLog|^-|/-|[^-+./_0-9A-Z_a-z]' | +while IFS= read -r new_name; do case $new_name in -* | */-*) echo "$new_name: File name component begins with '-'." commit a773a7831226c146edd40dbaf97f3cfad995f8ee Author: Paul Eggert Date: Wed Feb 23 11:23:05 2022 -0800 Port to current Gnulib some more * admin/merge-gnulib: Remove lib/stdio-read.c and lib/stdio-write.c, as Emacs doesn’t need these new Gnulib files. diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 73b3d39049..4045eabf4e 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -109,7 +109,9 @@ done "$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS \ $avoided_flags $GNULIB_MODULES && -rm -- "$src"lib/gl_openssl.h "$src"m4/fcntl-o.m4 \ +rm -- "$src"lib/gl_openssl.h \ + "$src"lib/stdio-read.c "$src"lib/stdio-write.c \ + "$src"m4/fcntl-o.m4 \ "$src"m4/gl-openssl.m4 \ "$src"m4/gnulib-cache.m4 "$src"m4/gnulib-tool.m4 \ "$src"m4/manywarnings-c++.m4 \ commit 308e63ccfcc6a6b1285bb17eff641f48639fb329 Author: Paul Eggert Date: Wed Feb 23 11:11:52 2022 -0800 Update from Gnulib by running admin/merge-gnulib diff --git a/build-aux/config.guess b/build-aux/config.guess index 1105a74983..7f76b6228f 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -1,14 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2021 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2021-11-30' +timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -60,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2021 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -929,6 +929,9 @@ EOF i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) case $UNAME_MACHINE in x86) diff --git a/build-aux/config.sub b/build-aux/config.sub index 5ba9a97d2c..9b62e37c43 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -8,7 +8,7 @@ timestamp='2021-12-25' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index 1c6847ae3b..82d9f97336 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -35,7 +35,7 @@ eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2021-02-24 23:42'; # UTC +my $VERSION = '2022-01-27 18:49'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook diff --git a/build-aux/update-copyright b/build-aux/update-copyright index 51b25dd0a5..81b691e857 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -7,7 +7,7 @@ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) +# the Free Software Foundation, either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, diff --git a/lib/acl-errno-valid.c b/lib/acl-errno-valid.c index 39717c3517..a364e41325 100644 --- a/lib/acl-errno-valid.c +++ b/lib/acl-errno-valid.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/acl-internal.c b/lib/acl-internal.c index 75a80bf0df..be244c67a2 100644 --- a/lib/acl-internal.c +++ b/lib/acl-internal.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/acl-internal.h b/lib/acl-internal.h index 582f9e1c1a..93533762dd 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/acl.h b/lib/acl.h index 8b933c20b9..f4d0df8061 100644 --- a/lib/acl.h +++ b/lib/acl.h @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/acl_entries.c b/lib/acl_entries.c index e4c014ce71..677de23e0c 100644 --- a/lib/acl_entries.c +++ b/lib/acl_entries.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/at-func.c b/lib/at-func.c index 92d65f6341..afcc819beb 100644 --- a/lib/at-func.c +++ b/lib/at-func.c @@ -3,7 +3,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/cdefs.h b/lib/cdefs.h index abf13a9086..44d3826bca 100644 --- a/lib/cdefs.h +++ b/lib/cdefs.h @@ -143,7 +143,8 @@ #define __bos0(ptr) __builtin_object_size (ptr, 0) /* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ -#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0) +#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \ + || __GNUC_PREREQ (12, 0)) # define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) # define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) #else diff --git a/lib/close-stream.c b/lib/close-stream.c index 54f3e3c3d0..9b0e97b271 100644 --- a/lib/close-stream.c +++ b/lib/close-stream.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/close-stream.h b/lib/close-stream.h index 537506c489..2b4c8ed8f5 100644 --- a/lib/close-stream.h +++ b/lib/close-stream.h @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, + by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/copy-file-range.c b/lib/copy-file-range.c index 96f1ec7c5e..1ec7f4de67 100644 --- a/lib/copy-file-range.c +++ b/lib/copy-file-range.c @@ -20,11 +20,45 @@ #include +#if defined __linux__ && HAVE_COPY_FILE_RANGE +# include +#endif + ssize_t copy_file_range (int infd, off_t *pinoff, int outfd, off_t *poutoff, size_t length, unsigned int flags) { +#undef copy_file_range + +#if defined __linux__ && HAVE_COPY_FILE_RANGE + /* The implementation of copy_file_range (which first appeared in + Linux kernel release 4.5) had many issues before release 5.3 + , so fail with ENOSYS for Linux + kernels 5.2 and earlier. + + This workaround, and the configure-time check for Linux, can be + removed when such kernels (released March 2016 through September + 2019) are no longer a consideration. As of January 2021, the + furthest-future planned kernel EOL is December 2024 for kernel + release 4.19. */ + + static signed char ok; + + if (! ok) + { + struct utsname name; + uname (&name); + char *p = name.release; + ok = ((p[1] != '.' || '5' < p[0] + || (p[0] == '5' && (p[3] != '.' || '2' < p[2]))) + ? 1 : -1); + } + + if (0 < ok) + return copy_file_range (infd, pinoff, outfd, poutoff, length, flags); +#endif + /* There is little need to emulate copy_file_range with read+write, since programs that use copy_file_range must fall back on read+write anyway. */ diff --git a/lib/diffseq.h b/lib/diffseq.h index 0c901a6ecf..0f76ea1d5a 100644 --- a/lib/diffseq.h +++ b/lib/diffseq.h @@ -5,7 +5,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/dtoastr.c b/lib/dtoastr.c index eaade8fa01..71af14c9df 100644 --- a/lib/dtoastr.c +++ b/lib/dtoastr.c @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, + by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/dtotimespec.c b/lib/dtotimespec.c index 225a2be67c..b62a8bd6cf 100644 --- a/lib/dtotimespec.c +++ b/lib/dtotimespec.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/faccessat.c b/lib/faccessat.c index 2c0c07aac1..c1737d03a1 100644 --- a/lib/faccessat.c +++ b/lib/faccessat.c @@ -3,7 +3,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/fchmodat.c b/lib/fchmodat.c index 506e6badd7..dc53583366 100644 --- a/lib/fchmodat.c +++ b/lib/fchmodat.c @@ -3,7 +3,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/fdopendir.c b/lib/fdopendir.c index a61bad66e2..c2b0e1ed34 100644 --- a/lib/fdopendir.c +++ b/lib/fdopendir.c @@ -3,7 +3,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index 2b6f91ff20..e02f0626ad 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/filemode.c b/lib/filemode.c index cb508ad12d..a8cbea844c 100644 --- a/lib/filemode.c +++ b/lib/filemode.c @@ -5,7 +5,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/filemode.h b/lib/filemode.h index 7c645c16b5..bf38181cdc 100644 --- a/lib/filemode.h +++ b/lib/filemode.h @@ -5,7 +5,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/filevercmp.c b/lib/filevercmp.c index b3e6e2f3cb..d546e79054 100644 --- a/lib/filevercmp.c +++ b/lib/filevercmp.c @@ -1,11 +1,12 @@ -/* +/* Compare file names containing version numbers. + Copyright (C) 1995 Ian Jackson Copyright (C) 2001 Anthony Towns Copyright (C) 2008-2022 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, @@ -19,60 +20,65 @@ #include #include "filevercmp.h" -#include -#include #include -#include #include #include - -/* Match a file suffix defined by this regular expression: - /(\.[A-Za-z~][A-Za-z0-9~]*)*$/ - Scan the string *STR and return a pointer to the matching suffix, or - NULL if not found. Upon return, *STR points to terminating NUL. */ -static const char * -match_suffix (const char **str) +#include +#include + +/* Return the length of a prefix of S that corresponds to the suffix + defined by this extended regular expression in the C locale: + (\.[A-Za-z~][A-Za-z0-9~]*)*$ + If *LEN is -1, S is a string; set *LEN to S's length. + Otherwise, *LEN should be nonnegative, S is a char array, + and *LEN does not change. */ +static idx_t +file_prefixlen (char const *s, ptrdiff_t *len) { - const char *match = NULL; - bool read_alpha = false; - while (**str) + size_t n = *len; /* SIZE_MAX if N == -1. */ + + for (idx_t i = 0; ; i++) { - if (read_alpha) - { - read_alpha = false; - if (!c_isalpha (**str) && '~' != **str) - match = NULL; - } - else if ('.' == **str) + idx_t prefixlen = i; + while (i + 1 < n && s[i] == '.' && (c_isalpha (s[i + 1]) + || s[i + 1] == '~')) + for (i += 2; i < n && (c_isalnum (s[i]) || s[i] == '~'); i++) + continue; + + if (*len < 0 ? !s[i] : i == n) { - read_alpha = true; - if (!match) - match = *str; + *len = i; + return prefixlen; } - else if (!c_isalnum (**str) && '~' != **str) - match = NULL; - (*str)++; } - return match; } -/* verrevcmp helper function */ +/* Return a version sort comparison value for S's byte at position POS. + S has length LEN. If POS == LEN, sort before all non-'~' bytes. */ + static int -order (unsigned char c) +order (char const *s, idx_t pos, idx_t len) { + if (pos == len) + return -1; + + unsigned char c = s[pos]; if (c_isdigit (c)) return 0; else if (c_isalpha (c)) return c; else if (c == '~') - return -1; + return -2; else - return (int) c + UCHAR_MAX + 1; + { + verify (UCHAR_MAX <= (INT_MAX - 1 - 2) / 2); + return c + UCHAR_MAX + 1; + } } /* slightly modified verrevcmp function from dpkg - S1, S2 - compared string - S1_LEN, S2_LEN - length of strings to be scanned + S1, S2 - compared char array + S1_LEN, S2_LEN - length of arrays to be scanned This implements the algorithm for comparison of version strings specified by Debian and now widely adopted. The detailed @@ -81,37 +87,38 @@ order (unsigned char c) implements that from s5.6.12 of Debian Policy v3.8.0.1 https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version */ static int _GL_ATTRIBUTE_PURE -verrevcmp (const char *s1, size_t s1_len, const char *s2, size_t s2_len) +verrevcmp (const char *s1, idx_t s1_len, const char *s2, idx_t s2_len) { - size_t s1_pos = 0; - size_t s2_pos = 0; + idx_t s1_pos = 0; + idx_t s2_pos = 0; while (s1_pos < s1_len || s2_pos < s2_len) { int first_diff = 0; while ((s1_pos < s1_len && !c_isdigit (s1[s1_pos])) || (s2_pos < s2_len && !c_isdigit (s2[s2_pos]))) { - int s1_c = (s1_pos == s1_len) ? 0 : order (s1[s1_pos]); - int s2_c = (s2_pos == s2_len) ? 0 : order (s2[s2_pos]); + int s1_c = order (s1, s1_pos, s1_len); + int s2_c = order (s2, s2_pos, s2_len); if (s1_c != s2_c) return s1_c - s2_c; s1_pos++; s2_pos++; } - while (s1[s1_pos] == '0') + while (s1_pos < s1_len && s1[s1_pos] == '0') s1_pos++; - while (s2[s2_pos] == '0') + while (s2_pos < s2_len && s2[s2_pos] == '0') s2_pos++; - while (c_isdigit (s1[s1_pos]) && c_isdigit (s2[s2_pos])) + while (s1_pos < s1_len && s2_pos < s2_len + && c_isdigit (s1[s1_pos]) && c_isdigit (s2[s2_pos])) { if (!first_diff) first_diff = s1[s1_pos] - s2[s2_pos]; s1_pos++; s2_pos++; } - if (c_isdigit (s1[s1_pos])) + if (s1_pos < s1_len && c_isdigit (s1[s1_pos])) return 1; - if (c_isdigit (s2[s2_pos])) + if (s2_pos < s2_len && c_isdigit (s2[s2_pos])) return -1; if (first_diff) return first_diff; @@ -124,58 +131,56 @@ verrevcmp (const char *s1, size_t s1_len, const char *s2, size_t s2_len) int filevercmp (const char *s1, const char *s2) { - const char *s1_pos; - const char *s2_pos; - const char *s1_suffix, *s2_suffix; - size_t s1_len, s2_len; - int result; - - /* easy comparison to see if strings are identical */ - int simple_cmp = strcmp (s1, s2); - if (simple_cmp == 0) - return 0; + return filenvercmp (s1, -1, s2, -1); +} - /* special handle for "", "." and ".." */ - if (!*s1) - return -1; - if (!*s2) - return 1; - if (0 == strcmp (".", s1)) - return -1; - if (0 == strcmp (".", s2)) - return 1; - if (0 == strcmp ("..", s1)) - return -1; - if (0 == strcmp ("..", s2)) +/* Compare versions A (of length ALEN) and B (of length BLEN). + See filevercmp.h for function description. */ +int +filenvercmp (char const *a, ptrdiff_t alen, char const *b, ptrdiff_t blen) +{ + /* Special case for empty versions. */ + bool aempty = alen < 0 ? !a[0] : !alen; + bool bempty = blen < 0 ? !b[0] : !blen; + if (aempty) + return -!bempty; + if (bempty) return 1; - /* special handle for other hidden files */ - if (*s1 == '.' && *s2 != '.') - return -1; - if (*s1 != '.' && *s2 == '.') - return 1; - if (*s1 == '.' && *s2 == '.') + /* Special cases for leading ".": "." sorts first, then "..", then + other names with leading ".", then other names. */ + if (a[0] == '.') { - s1++; - s2++; - } + if (b[0] != '.') + return -1; - /* "cut" file suffixes */ - s1_pos = s1; - s2_pos = s2; - s1_suffix = match_suffix (&s1_pos); - s2_suffix = match_suffix (&s2_pos); - s1_len = (s1_suffix ? s1_suffix : s1_pos) - s1; - s2_len = (s2_suffix ? s2_suffix : s2_pos) - s2; - - /* restore file suffixes if strings are identical after "cut" */ - if ((s1_suffix || s2_suffix) && (s1_len == s2_len) - && 0 == strncmp (s1, s2, s1_len)) - { - s1_len = s1_pos - s1; - s2_len = s2_pos - s2; + bool adot = alen < 0 ? !a[1] : alen == 1; + bool bdot = blen < 0 ? !b[1] : blen == 1; + if (adot) + return -!bdot; + if (bdot) + return 1; + + bool adotdot = a[1] == '.' && (alen < 0 ? !a[2] : alen == 2); + bool bdotdot = b[1] == '.' && (blen < 0 ? !b[2] : blen == 2); + if (adotdot) + return -!bdotdot; + if (bdotdot) + return 1; } + else if (b[0] == '.') + return 1; + + /* Cut file suffixes. */ + idx_t aprefixlen = file_prefixlen (a, &alen); + idx_t bprefixlen = file_prefixlen (b, &blen); + + /* If both suffixes are empty, a second pass would return the same thing. */ + bool one_pass_only = aprefixlen == alen && bprefixlen == blen; + + int result = verrevcmp (a, aprefixlen, b, bprefixlen); - result = verrevcmp (s1, s1_len, s2, s2_len); - return result == 0 ? simple_cmp : result; + /* Return the initial result if nonzero, or if no second pass is needed. + Otherwise, restore the suffixes and try again. */ + return result || one_pass_only ? result : verrevcmp (a, alen, b, blen); } diff --git a/lib/filevercmp.h b/lib/filevercmp.h index 98020e6667..5a33677671 100644 --- a/lib/filevercmp.h +++ b/lib/filevercmp.h @@ -1,11 +1,12 @@ -/* +/* Compare file names containing version numbers. + Copyright (C) 1995 Ian Jackson Copyright (C) 2001 Anthony Towns Copyright (C) 2008-2022 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, @@ -19,24 +20,57 @@ #ifndef FILEVERCMP_H #define FILEVERCMP_H -/* Compare version strings: +#include + +/* Compare strings A and B as file names containing version numbers, + and return an integer that is negative, zero, or positive depending + on whether A compares less than, equal to, or greater than B. + + Use the following version sort algorithm: + + 1. Compare the strings' maximal-length non-digit prefixes lexically. + If there is a difference return that difference. + Otherwise discard the prefixes and continue with the next step. + + 2. Compare the strings' maximal-length digit prefixes, using + numeric comparison of the numbers represented by each prefix. + (Treat an empty prefix as zero; this can happen only at string end.) + If there is a difference, return that difference. + Otherwise discard the prefixes and continue with the next step. + + 3. If both strings are empty, return 0. Otherwise continue with step 1. + + In version sort, lexical comparison is left to right, byte by byte, + using the byte's numeric value (0-255), except that: + + 1. ASCII letters sort before other bytes. + 2. A tilde sorts before anything, even an empty string. + + In addition to the version sort rules, the following strings have + special priority and sort before all other strings (listed in order): - This function compares strings S1 and S2: - 1) By PREFIX in the same way as strcmp. - 2) Then by VERSION (most similarly to version compare of Debian's dpkg). - Leading zeros in version numbers are ignored. - 3) If both (PREFIX and VERSION) are equal, strcmp function is used for - comparison. So this function can return 0 if (and only if) strings S1 - and S2 are identical. + 1. The empty string. + 2. ".". + 3. "..". + 4. Strings starting with "." sort before other strings. - It returns number >0 for S1 > S2, 0 for S1 == S2 and number <0 for S1 < S2. + Before comparing two strings where both begin with non-".", + or where both begin with "." but neither is "." or "..", + suffixes matching the C-locale extended regular expression + (\.[A-Za-z~][A-Za-z0-9~]*)*$ are removed and the strings compared + without them, using version sort without special priority; + if they do not compare equal, this comparison result is used and + the suffixes are effectively ignored. Otherwise, the entire + strings are compared using version sort. - This function compares strings, in a way that if VER1 and VER2 are version - numbers and PREFIX and SUFFIX (SUFFIX defined as (\.[A-Za-z~][A-Za-z0-9~]*)*) - are strings then VER1 < VER2 implies filevercmp (PREFIX VER1 SUFFIX, - PREFIX VER2 SUFFIX) < 0. + This function is intended to be a replacement for strverscmp. */ +int filevercmp (char const *a, char const *b) _GL_ATTRIBUTE_PURE; - This function is intended to be a replacement for strverscmp. */ -int filevercmp (const char *s1, const char *s2) _GL_ATTRIBUTE_PURE; +/* Like filevercmp, except compare the byte arrays A (of length ALEN) + and B (of length BLEN) so that A and B can contain '\0', which + sorts just before '\1'. But if ALEN is -1 treat A as a string + terminated by '\0', and similarly for BLEN. */ +int filenvercmp (char const *a, ptrdiff_t alen, char const *b, ptrdiff_t blen) + _GL_ATTRIBUTE_PURE; #endif /* FILEVERCMP_H */ diff --git a/lib/fpending.c b/lib/fpending.c index 617f3977f8..6408cff464 100644 --- a/lib/fpending.c +++ b/lib/fpending.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/fpending.h b/lib/fpending.h index 2b45e9031b..43542c5b8a 100644 --- a/lib/fpending.h +++ b/lib/fpending.h @@ -5,7 +5,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/fstatat.c b/lib/fstatat.c index 56de0cab4b..6e8344964b 100644 --- a/lib/fstatat.c +++ b/lib/fstatat.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/fsusage.c b/lib/fsusage.c index 734f0fc746..18f790f6e7 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -5,7 +5,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/fsusage.h b/lib/fsusage.h index f4f50aba29..0443d19f92 100644 --- a/lib/fsusage.h +++ b/lib/fsusage.h @@ -5,7 +5,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/ftoastr.c b/lib/ftoastr.c index 4349c8c561..9105752922 100644 --- a/lib/ftoastr.c +++ b/lib/ftoastr.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/ftoastr.h b/lib/ftoastr.h index 065574a9ff..bac32a387e 100644 --- a/lib/ftoastr.h +++ b/lib/ftoastr.h @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/futimens.c b/lib/futimens.c index 97228242b1..bc3e41a943 100644 --- a/lib/futimens.c +++ b/lib/futimens.c @@ -3,7 +3,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/get-permissions.c b/lib/get-permissions.c index a17b791c8d..ff79adae72 100644 --- a/lib/get-permissions.c +++ b/lib/get-permissions.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/getloadavg.c b/lib/getloadavg.c index 53d1b81a3b..37e8280867 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -8,7 +8,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/gettime.c b/lib/gettime.c index a44a69dfc4..541af18bbf 100644 --- a/lib/gettime.c +++ b/lib/gettime.c @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index a8a6cd782d..6b90a80f64 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -3,7 +3,7 @@ # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, @@ -191,6 +191,10 @@ BUILD_DETAILS = @BUILD_DETAILS@ BYTESWAP_H = @BYTESWAP_H@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_XCB_CFLAGS = @CAIRO_XCB_CFLAGS@ +CAIRO_XCB_LIBS = @CAIRO_XCB_LIBS@ +CAIRO_XLIB_CFLAGS = @CAIRO_XLIB_CFLAGS@ +CAIRO_XLIB_LIBS = @CAIRO_XLIB_LIBS@ CC = @CC@ CFLAGS = @CFLAGS@ CFLAGS_SOUND = @CFLAGS_SOUND@ @@ -247,7 +251,59 @@ GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ GETOPT_H = @GETOPT_H@ GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@ GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@ +GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@ +GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@ GL_COND_LIBTOOL_CONDITION = @GL_COND_LIBTOOL_CONDITION@ +GL_COND_OBJ_CANONICALIZE_LGPL_CONDITION = @GL_COND_OBJ_CANONICALIZE_LGPL_CONDITION@ +GL_COND_OBJ_COPY_FILE_RANGE_CONDITION = @GL_COND_OBJ_COPY_FILE_RANGE_CONDITION@ +GL_COND_OBJ_DIRFD_CONDITION = @GL_COND_OBJ_DIRFD_CONDITION@ +GL_COND_OBJ_DUP2_CONDITION = @GL_COND_OBJ_DUP2_CONDITION@ +GL_COND_OBJ_EUIDACCESS_CONDITION = @GL_COND_OBJ_EUIDACCESS_CONDITION@ +GL_COND_OBJ_EXECINFO_CONDITION = @GL_COND_OBJ_EXECINFO_CONDITION@ +GL_COND_OBJ_EXPLICIT_BZERO_CONDITION = @GL_COND_OBJ_EXPLICIT_BZERO_CONDITION@ +GL_COND_OBJ_FACCESSAT_CONDITION = @GL_COND_OBJ_FACCESSAT_CONDITION@ +GL_COND_OBJ_FCHMODAT_CONDITION = @GL_COND_OBJ_FCHMODAT_CONDITION@ +GL_COND_OBJ_FCNTL_CONDITION = @GL_COND_OBJ_FCNTL_CONDITION@ +GL_COND_OBJ_FDOPENDIR_CONDITION = @GL_COND_OBJ_FDOPENDIR_CONDITION@ +GL_COND_OBJ_FPENDING_CONDITION = @GL_COND_OBJ_FPENDING_CONDITION@ +GL_COND_OBJ_FREE_CONDITION = @GL_COND_OBJ_FREE_CONDITION@ +GL_COND_OBJ_FSTATAT_CONDITION = @GL_COND_OBJ_FSTATAT_CONDITION@ +GL_COND_OBJ_FSUSAGE_CONDITION = @GL_COND_OBJ_FSUSAGE_CONDITION@ +GL_COND_OBJ_FSYNC_CONDITION = @GL_COND_OBJ_FSYNC_CONDITION@ +GL_COND_OBJ_FUTIMENS_CONDITION = @GL_COND_OBJ_FUTIMENS_CONDITION@ +GL_COND_OBJ_GETDTABLESIZE_CONDITION = @GL_COND_OBJ_GETDTABLESIZE_CONDITION@ +GL_COND_OBJ_GETGROUPS_CONDITION = @GL_COND_OBJ_GETGROUPS_CONDITION@ +GL_COND_OBJ_GETLOADAVG_CONDITION = @GL_COND_OBJ_GETLOADAVG_CONDITION@ +GL_COND_OBJ_GETOPT_CONDITION = @GL_COND_OBJ_GETOPT_CONDITION@ +GL_COND_OBJ_GETRANDOM_CONDITION = @GL_COND_OBJ_GETRANDOM_CONDITION@ +GL_COND_OBJ_GETTIMEOFDAY_CONDITION = @GL_COND_OBJ_GETTIMEOFDAY_CONDITION@ +GL_COND_OBJ_GROUP_MEMBER_CONDITION = @GL_COND_OBJ_GROUP_MEMBER_CONDITION@ +GL_COND_OBJ_LCHMOD_CONDITION = @GL_COND_OBJ_LCHMOD_CONDITION@ +GL_COND_OBJ_LSTAT_CONDITION = @GL_COND_OBJ_LSTAT_CONDITION@ +GL_COND_OBJ_MEMPCPY_CONDITION = @GL_COND_OBJ_MEMPCPY_CONDITION@ +GL_COND_OBJ_MEMRCHR_CONDITION = @GL_COND_OBJ_MEMRCHR_CONDITION@ +GL_COND_OBJ_MINI_GMP_GNULIB_CONDITION = @GL_COND_OBJ_MINI_GMP_GNULIB_CONDITION@ +GL_COND_OBJ_MKOSTEMP_CONDITION = @GL_COND_OBJ_MKOSTEMP_CONDITION@ +GL_COND_OBJ_OPEN_CONDITION = @GL_COND_OBJ_OPEN_CONDITION@ +GL_COND_OBJ_PSELECT_CONDITION = @GL_COND_OBJ_PSELECT_CONDITION@ +GL_COND_OBJ_PTHREAD_SIGMASK_CONDITION = @GL_COND_OBJ_PTHREAD_SIGMASK_CONDITION@ +GL_COND_OBJ_RAWMEMCHR_CONDITION = @GL_COND_OBJ_RAWMEMCHR_CONDITION@ +GL_COND_OBJ_READLINKAT_CONDITION = @GL_COND_OBJ_READLINKAT_CONDITION@ +GL_COND_OBJ_READLINK_CONDITION = @GL_COND_OBJ_READLINK_CONDITION@ +GL_COND_OBJ_REGEX_CONDITION = @GL_COND_OBJ_REGEX_CONDITION@ +GL_COND_OBJ_SIG2STR_CONDITION = @GL_COND_OBJ_SIG2STR_CONDITION@ +GL_COND_OBJ_SIGDESCR_NP_CONDITION = @GL_COND_OBJ_SIGDESCR_NP_CONDITION@ +GL_COND_OBJ_STDIO_READ_CONDITION = @GL_COND_OBJ_STDIO_READ_CONDITION@ +GL_COND_OBJ_STDIO_WRITE_CONDITION = @GL_COND_OBJ_STDIO_WRITE_CONDITION@ +GL_COND_OBJ_STPCPY_CONDITION = @GL_COND_OBJ_STPCPY_CONDITION@ +GL_COND_OBJ_STRNLEN_CONDITION = @GL_COND_OBJ_STRNLEN_CONDITION@ +GL_COND_OBJ_STRTOIMAX_CONDITION = @GL_COND_OBJ_STRTOIMAX_CONDITION@ +GL_COND_OBJ_STRTOLL_CONDITION = @GL_COND_OBJ_STRTOLL_CONDITION@ +GL_COND_OBJ_SYMLINK_CONDITION = @GL_COND_OBJ_SYMLINK_CONDITION@ +GL_COND_OBJ_TIMEGM_CONDITION = @GL_COND_OBJ_TIMEGM_CONDITION@ +GL_COND_OBJ_TIME_RZ_CONDITION = @GL_COND_OBJ_TIME_RZ_CONDITION@ +GL_COND_OBJ_TIME_R_CONDITION = @GL_COND_OBJ_TIME_R_CONDITION@ +GL_COND_OBJ_UTIMENSAT_CONDITION = @GL_COND_OBJ_UTIMENSAT_CONDITION@ GL_GENERATE_ALLOCA_H_CONDITION = @GL_GENERATE_ALLOCA_H_CONDITION@ GL_GENERATE_BYTESWAP_H_CONDITION = @GL_GENERATE_BYTESWAP_H_CONDITION@ GL_GENERATE_ERRNO_H_CONDITION = @GL_GENERATE_ERRNO_H_CONDITION@ @@ -974,6 +1030,7 @@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@ +REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@ REPLACE_CREAT = @REPLACE_CREAT@ REPLACE_CTIME = @REPLACE_CTIME@ REPLACE_DIRFD = @REPLACE_DIRFD@ @@ -1197,6 +1254,8 @@ XOBJ = @XOBJ@ XRANDR_CFLAGS = @XRANDR_CFLAGS@ XRANDR_LIBS = @XRANDR_LIBS@ XRENDER_LIBS = @XRENDER_LIBS@ +XSYNC_CFLAGS = @XSYNC_CFLAGS@ +XSYNC_LIBS = @XSYNC_LIBS@ XWIDGETS_OBJ = @XWIDGETS_OBJ@ X_TOOLKIT_TYPE = @X_TOOLKIT_TYPE@ ac_ct_CC = @ac_ct_CC@ @@ -1251,8 +1310,10 @@ gl_GNULIB_ENABLED_rawmemchr_CONDITION = @gl_GNULIB_ENABLED_rawmemchr_CONDITION@ gl_GNULIB_ENABLED_scratch_buffer_CONDITION = @gl_GNULIB_ENABLED_scratch_buffer_CONDITION@ gl_GNULIB_ENABLED_strtoll_CONDITION = @gl_GNULIB_ENABLED_strtoll_CONDITION@ gl_GNULIB_ENABLED_utimens_CONDITION = @gl_GNULIB_ENABLED_utimens_CONDITION@ +gl_LIBOBJDEPS = @gl_LIBOBJDEPS@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ @@ -1303,6 +1364,7 @@ x_default_search_path = @x_default_search_path@ noinst_LIBRARIES += libgnu.a libgnu_a_SOURCES = +libgnu_a_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS) libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) EXTRA_libgnu_a_SOURCES = @@ -1432,10 +1494,9 @@ endif ## begin gnulib module canonicalize-lgpl ifeq (,$(OMIT_GNULIB_MODULE_canonicalize-lgpl)) - -EXTRA_DIST += canonicalize-lgpl.c - -EXTRA_libgnu_a_SOURCES += canonicalize-lgpl.c +ifneq (,$(GL_COND_OBJ_CANONICALIZE_LGPL_CONDITION)) +libgnu_a_SOURCES += canonicalize-lgpl.c +endif endif ## end gnulib module canonicalize-lgpl @@ -1475,10 +1536,9 @@ endif ## begin gnulib module copy-file-range ifeq (,$(OMIT_GNULIB_MODULE_copy-file-range)) - -EXTRA_DIST += copy-file-range.c - -EXTRA_libgnu_a_SOURCES += copy-file-range.c +ifneq (,$(GL_COND_OBJ_COPY_FILE_RANGE_CONDITION)) +libgnu_a_SOURCES += copy-file-range.c +endif endif ## end gnulib module copy-file-range @@ -1621,12 +1681,11 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_dirfd)) ifneq (,$(gl_GNULIB_ENABLED_dirfd_CONDITION)) - +ifneq (,$(GL_COND_OBJ_DIRFD_CONDITION)) +libgnu_a_SOURCES += dirfd.c endif -EXTRA_DIST += dirfd.c - -EXTRA_libgnu_a_SOURCES += dirfd.c +endif endif ## end gnulib module dirfd @@ -1653,10 +1712,9 @@ endif ## begin gnulib module dup2 ifeq (,$(OMIT_GNULIB_MODULE_dup2)) - -EXTRA_DIST += dup2.c - -EXTRA_libgnu_a_SOURCES += dup2.c +ifneq (,$(GL_COND_OBJ_DUP2_CONDITION)) +libgnu_a_SOURCES += dup2.c +endif endif ## end gnulib module dup2 @@ -1747,12 +1805,11 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_euidaccess)) ifneq (,$(gl_GNULIB_ENABLED_euidaccess_CONDITION)) - +ifneq (,$(GL_COND_OBJ_EUIDACCESS_CONDITION)) +libgnu_a_SOURCES += euidaccess.c endif -EXTRA_DIST += euidaccess.c - -EXTRA_libgnu_a_SOURCES += euidaccess.c +endif endif ## end gnulib module euidaccess @@ -1773,9 +1830,11 @@ execinfo.h: $(top_builddir)/config.status endif MOSTLYCLEANFILES += execinfo.h execinfo.h-t -EXTRA_DIST += execinfo.c execinfo.in.h +ifneq (,$(GL_COND_OBJ_EXECINFO_CONDITION)) +libgnu_a_SOURCES += execinfo.c +endif -EXTRA_libgnu_a_SOURCES += execinfo.c +EXTRA_DIST += execinfo.in.h endif ## end gnulib module execinfo @@ -1783,10 +1842,9 @@ endif ## begin gnulib module explicit_bzero ifeq (,$(OMIT_GNULIB_MODULE_explicit_bzero)) - -EXTRA_DIST += explicit_bzero.c - -EXTRA_libgnu_a_SOURCES += explicit_bzero.c +ifneq (,$(GL_COND_OBJ_EXPLICIT_BZERO_CONDITION)) +libgnu_a_SOURCES += explicit_bzero.c +endif endif ## end gnulib module explicit_bzero @@ -1794,10 +1852,13 @@ endif ## begin gnulib module faccessat ifeq (,$(OMIT_GNULIB_MODULE_faccessat)) +ifneq (,$(GL_COND_OBJ_FACCESSAT_CONDITION)) +libgnu_a_SOURCES += faccessat.c +endif -EXTRA_DIST += at-func.c faccessat.c +EXTRA_DIST += at-func.c -EXTRA_libgnu_a_SOURCES += at-func.c faccessat.c +EXTRA_libgnu_a_SOURCES += at-func.c endif ## end gnulib module faccessat @@ -1805,10 +1866,13 @@ endif ## begin gnulib module fchmodat ifeq (,$(OMIT_GNULIB_MODULE_fchmodat)) +ifneq (,$(GL_COND_OBJ_FCHMODAT_CONDITION)) +libgnu_a_SOURCES += fchmodat.c +endif -EXTRA_DIST += at-func.c fchmodat.c +EXTRA_DIST += at-func.c -EXTRA_libgnu_a_SOURCES += at-func.c fchmodat.c +EXTRA_libgnu_a_SOURCES += at-func.c endif ## end gnulib module fchmodat @@ -1816,10 +1880,9 @@ endif ## begin gnulib module fcntl ifeq (,$(OMIT_GNULIB_MODULE_fcntl)) - -EXTRA_DIST += fcntl.c - -EXTRA_libgnu_a_SOURCES += fcntl.c +ifneq (,$(GL_COND_OBJ_FCNTL_CONDITION)) +libgnu_a_SOURCES += fcntl.c +endif endif ## end gnulib module fcntl @@ -1866,10 +1929,9 @@ endif ## begin gnulib module fdopendir ifeq (,$(OMIT_GNULIB_MODULE_fdopendir)) - -EXTRA_DIST += fdopendir.c - -EXTRA_libgnu_a_SOURCES += fdopendir.c +ifneq (,$(GL_COND_OBJ_FDOPENDIR_CONDITION)) +libgnu_a_SOURCES += fdopendir.c +endif endif ## end gnulib module fdopendir @@ -1925,10 +1987,11 @@ endif ## begin gnulib module fpending ifeq (,$(OMIT_GNULIB_MODULE_fpending)) +ifneq (,$(GL_COND_OBJ_FPENDING_CONDITION)) +libgnu_a_SOURCES += fpending.c +endif -EXTRA_DIST += fpending.c fpending.h stdio-impl.h - -EXTRA_libgnu_a_SOURCES += fpending.c +EXTRA_DIST += fpending.h stdio-impl.h endif ## end gnulib module fpending @@ -1936,10 +1999,9 @@ endif ## begin gnulib module free-posix ifeq (,$(OMIT_GNULIB_MODULE_free-posix)) - -EXTRA_DIST += free.c - -EXTRA_libgnu_a_SOURCES += free.c +ifneq (,$(GL_COND_OBJ_FREE_CONDITION)) +libgnu_a_SOURCES += free.c +endif endif ## end gnulib module free-posix @@ -1947,10 +2009,13 @@ endif ## begin gnulib module fstatat ifeq (,$(OMIT_GNULIB_MODULE_fstatat)) +ifneq (,$(GL_COND_OBJ_FSTATAT_CONDITION)) +libgnu_a_SOURCES += fstatat.c +endif -EXTRA_DIST += at-func.c fstatat.c +EXTRA_DIST += at-func.c -EXTRA_libgnu_a_SOURCES += at-func.c fstatat.c +EXTRA_libgnu_a_SOURCES += at-func.c endif ## end gnulib module fstatat @@ -1958,10 +2023,11 @@ endif ## begin gnulib module fsusage ifeq (,$(OMIT_GNULIB_MODULE_fsusage)) +ifneq (,$(GL_COND_OBJ_FSUSAGE_CONDITION)) +libgnu_a_SOURCES += fsusage.c +endif -EXTRA_DIST += fsusage.c fsusage.h - -EXTRA_libgnu_a_SOURCES += fsusage.c +EXTRA_DIST += fsusage.h endif ## end gnulib module fsusage @@ -1969,10 +2035,9 @@ endif ## begin gnulib module fsync ifeq (,$(OMIT_GNULIB_MODULE_fsync)) - -EXTRA_DIST += fsync.c - -EXTRA_libgnu_a_SOURCES += fsync.c +ifneq (,$(GL_COND_OBJ_FSYNC_CONDITION)) +libgnu_a_SOURCES += fsync.c +endif endif ## end gnulib module fsync @@ -1980,10 +2045,9 @@ endif ## begin gnulib module futimens ifeq (,$(OMIT_GNULIB_MODULE_futimens)) - -EXTRA_DIST += futimens.c - -EXTRA_libgnu_a_SOURCES += futimens.c +ifneq (,$(GL_COND_OBJ_FUTIMENS_CONDITION)) +libgnu_a_SOURCES += futimens.c +endif endif ## end gnulib module futimens @@ -2013,12 +2077,11 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_getdtablesize)) ifneq (,$(gl_GNULIB_ENABLED_getdtablesize_CONDITION)) - +ifneq (,$(GL_COND_OBJ_GETDTABLESIZE_CONDITION)) +libgnu_a_SOURCES += getdtablesize.c endif -EXTRA_DIST += getdtablesize.c - -EXTRA_libgnu_a_SOURCES += getdtablesize.c +endif endif ## end gnulib module getdtablesize @@ -2026,22 +2089,20 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_getgroups)) ifneq (,$(gl_GNULIB_ENABLED_getgroups_CONDITION)) - +ifneq (,$(GL_COND_OBJ_GETGROUPS_CONDITION)) +libgnu_a_SOURCES += getgroups.c endif -EXTRA_DIST += getgroups.c - -EXTRA_libgnu_a_SOURCES += getgroups.c +endif endif ## end gnulib module getgroups ## begin gnulib module getloadavg ifeq (,$(OMIT_GNULIB_MODULE_getloadavg)) - -EXTRA_DIST += getloadavg.c - -EXTRA_libgnu_a_SOURCES += getloadavg.c +ifneq (,$(GL_COND_OBJ_GETLOADAVG_CONDITION)) +libgnu_a_SOURCES += getloadavg.c +endif endif ## end gnulib module getloadavg @@ -2083,9 +2144,11 @@ endif MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t -EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.c getopt.in.h getopt1.c getopt_int.h +ifneq (,$(GL_COND_OBJ_GETOPT_CONDITION)) +libgnu_a_SOURCES += getopt.c getopt1.c +endif -EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c +EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.in.h getopt_int.h endif ## end gnulib module getopt-posix @@ -2093,10 +2156,9 @@ endif ## begin gnulib module getrandom ifeq (,$(OMIT_GNULIB_MODULE_getrandom)) - -EXTRA_DIST += getrandom.c - -EXTRA_libgnu_a_SOURCES += getrandom.c +ifneq (,$(GL_COND_OBJ_GETRANDOM_CONDITION)) +libgnu_a_SOURCES += getrandom.c +endif endif ## end gnulib module getrandom @@ -2122,10 +2184,9 @@ endif ## begin gnulib module gettimeofday ifeq (,$(OMIT_GNULIB_MODULE_gettimeofday)) - -EXTRA_DIST += gettimeofday.c - -EXTRA_libgnu_a_SOURCES += gettimeofday.c +ifneq (,$(GL_COND_OBJ_GETTIMEOFDAY_CONDITION)) +libgnu_a_SOURCES += gettimeofday.c +endif endif ## end gnulib module gettimeofday @@ -2143,12 +2204,11 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_group-member)) ifneq (,$(gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_CONDITION)) - +ifneq (,$(GL_COND_OBJ_GROUP_MEMBER_CONDITION)) +libgnu_a_SOURCES += group-member.c endif -EXTRA_DIST += group-member.c - -EXTRA_libgnu_a_SOURCES += group-member.c +endif endif ## end gnulib module group-member @@ -2249,12 +2309,11 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_lchmod)) ifneq (,$(gl_GNULIB_ENABLED_lchmod_CONDITION)) - +ifneq (,$(GL_COND_OBJ_LCHMOD_CONDITION)) +libgnu_a_SOURCES += lchmod.c endif -EXTRA_DIST += lchmod.c - -EXTRA_libgnu_a_SOURCES += lchmod.c +endif endif ## end gnulib module lchmod @@ -2291,9 +2350,13 @@ gmp.h: $(top_builddir)/config.status endif MOSTLYCLEANFILES += gmp.h gmp.h-t -EXTRA_DIST += mini-gmp-gnulib.c mini-gmp.c mini-gmp.h +ifneq (,$(GL_COND_OBJ_MINI_GMP_GNULIB_CONDITION)) +libgnu_a_SOURCES += mini-gmp-gnulib.c +endif + +EXTRA_DIST += mini-gmp.c mini-gmp.h -EXTRA_libgnu_a_SOURCES += mini-gmp-gnulib.c mini-gmp.c +EXTRA_libgnu_a_SOURCES += mini-gmp.c endif ## end gnulib module libgmp @@ -2329,10 +2392,9 @@ endif ## begin gnulib module lstat ifeq (,$(OMIT_GNULIB_MODULE_lstat)) - -EXTRA_DIST += lstat.c - -EXTRA_libgnu_a_SOURCES += lstat.c +ifneq (,$(GL_COND_OBJ_LSTAT_CONDITION)) +libgnu_a_SOURCES += lstat.c +endif endif ## end gnulib module lstat @@ -2377,10 +2439,9 @@ endif ## begin gnulib module mempcpy ifeq (,$(OMIT_GNULIB_MODULE_mempcpy)) - -EXTRA_DIST += mempcpy.c - -EXTRA_libgnu_a_SOURCES += mempcpy.c +ifneq (,$(GL_COND_OBJ_MEMPCPY_CONDITION)) +libgnu_a_SOURCES += mempcpy.c +endif endif ## end gnulib module mempcpy @@ -2388,10 +2449,9 @@ endif ## begin gnulib module memrchr ifeq (,$(OMIT_GNULIB_MODULE_memrchr)) - -EXTRA_DIST += memrchr.c - -EXTRA_libgnu_a_SOURCES += memrchr.c +ifneq (,$(GL_COND_OBJ_MEMRCHR_CONDITION)) +libgnu_a_SOURCES += memrchr.c +endif endif ## end gnulib module memrchr @@ -2407,10 +2467,9 @@ endif ## begin gnulib module mkostemp ifeq (,$(OMIT_GNULIB_MODULE_mkostemp)) - -EXTRA_DIST += mkostemp.c - -EXTRA_libgnu_a_SOURCES += mkostemp.c +ifneq (,$(GL_COND_OBJ_MKOSTEMP_CONDITION)) +libgnu_a_SOURCES += mkostemp.c +endif endif ## end gnulib module mkostemp @@ -2463,12 +2522,11 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_open)) ifneq (,$(gl_GNULIB_ENABLED_open_CONDITION)) - +ifneq (,$(GL_COND_OBJ_OPEN_CONDITION)) +libgnu_a_SOURCES += open.c endif -EXTRA_DIST += open.c - -EXTRA_libgnu_a_SOURCES += open.c +endif endif ## end gnulib module open @@ -2503,10 +2561,9 @@ endif ## begin gnulib module pselect ifeq (,$(OMIT_GNULIB_MODULE_pselect)) - -EXTRA_DIST += pselect.c - -EXTRA_libgnu_a_SOURCES += pselect.c +ifneq (,$(GL_COND_OBJ_PSELECT_CONDITION)) +libgnu_a_SOURCES += pselect.c +endif endif ## end gnulib module pselect @@ -2514,10 +2571,9 @@ endif ## begin gnulib module pthread_sigmask ifeq (,$(OMIT_GNULIB_MODULE_pthread_sigmask)) - -EXTRA_DIST += pthread_sigmask.c - -EXTRA_libgnu_a_SOURCES += pthread_sigmask.c +ifneq (,$(GL_COND_OBJ_PTHREAD_SIGMASK_CONDITION)) +libgnu_a_SOURCES += pthread_sigmask.c +endif endif ## end gnulib module pthread_sigmask @@ -2534,11 +2590,12 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_rawmemchr)) ifneq (,$(gl_GNULIB_ENABLED_rawmemchr_CONDITION)) - +ifneq (,$(GL_COND_OBJ_RAWMEMCHR_CONDITION)) +libgnu_a_SOURCES += rawmemchr.c endif -EXTRA_DIST += rawmemchr.c rawmemchr.valgrind -EXTRA_libgnu_a_SOURCES += rawmemchr.c +endif +EXTRA_DIST += rawmemchr.valgrind endif ## end gnulib module rawmemchr @@ -2546,10 +2603,9 @@ endif ## begin gnulib module readlink ifeq (,$(OMIT_GNULIB_MODULE_readlink)) - -EXTRA_DIST += readlink.c - -EXTRA_libgnu_a_SOURCES += readlink.c +ifneq (,$(GL_COND_OBJ_READLINK_CONDITION)) +libgnu_a_SOURCES += readlink.c +endif endif ## end gnulib module readlink @@ -2557,10 +2613,13 @@ endif ## begin gnulib module readlinkat ifeq (,$(OMIT_GNULIB_MODULE_readlinkat)) +ifneq (,$(GL_COND_OBJ_READLINKAT_CONDITION)) +libgnu_a_SOURCES += readlinkat.c +endif -EXTRA_DIST += at-func.c readlinkat.c +EXTRA_DIST += at-func.c -EXTRA_libgnu_a_SOURCES += at-func.c readlinkat.c +EXTRA_libgnu_a_SOURCES += at-func.c endif ## end gnulib module readlinkat @@ -2594,10 +2653,13 @@ endif ## begin gnulib module regex ifeq (,$(OMIT_GNULIB_MODULE_regex)) +ifneq (,$(GL_COND_OBJ_REGEX_CONDITION)) +libgnu_a_SOURCES += regex.c +endif -EXTRA_DIST += regcomp.c regex.c regex.h regex_internal.c regex_internal.h regexec.c +EXTRA_DIST += regcomp.c regex.h regex_internal.c regex_internal.h regexec.c -EXTRA_libgnu_a_SOURCES += regcomp.c regex.c regex_internal.c regexec.c +EXTRA_libgnu_a_SOURCES += regcomp.c regex_internal.c regexec.c endif ## end gnulib module regex @@ -2641,10 +2703,11 @@ endif ## begin gnulib module sig2str ifeq (,$(OMIT_GNULIB_MODULE_sig2str)) +ifneq (,$(GL_COND_OBJ_SIG2STR_CONDITION)) +libgnu_a_SOURCES += sig2str.c +endif -EXTRA_DIST += sig2str.c sig2str.h - -EXTRA_libgnu_a_SOURCES += sig2str.c +EXTRA_DIST += sig2str.h endif ## end gnulib module sig2str @@ -2652,10 +2715,9 @@ endif ## begin gnulib module sigdescr_np ifeq (,$(OMIT_GNULIB_MODULE_sigdescr_np)) - -EXTRA_DIST += sigdescr_np.c - -EXTRA_libgnu_a_SOURCES += sigdescr_np.c +ifneq (,$(GL_COND_OBJ_SIGDESCR_NP_CONDITION)) +libgnu_a_SOURCES += sigdescr_np.c +endif endif ## end gnulib module sigdescr_np @@ -3004,6 +3066,13 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(AM_V_at)mv $@-t $@ MOSTLYCLEANFILES += stdio.h stdio.h-t +ifneq (,$(GL_COND_OBJ_STDIO_READ_CONDITION)) +libgnu_a_SOURCES += stdio-read.c +endif +ifneq (,$(GL_COND_OBJ_STDIO_WRITE_CONDITION)) +libgnu_a_SOURCES += stdio-write.c +endif + EXTRA_DIST += stdio.in.h endif @@ -3163,10 +3232,9 @@ endif ## begin gnulib module stpcpy ifeq (,$(OMIT_GNULIB_MODULE_stpcpy)) - -EXTRA_DIST += stpcpy.c - -EXTRA_libgnu_a_SOURCES += stpcpy.c +ifneq (,$(GL_COND_OBJ_STPCPY_CONDITION)) +libgnu_a_SOURCES += stpcpy.c +endif endif ## end gnulib module stpcpy @@ -3287,10 +3355,9 @@ endif ## begin gnulib module strnlen ifeq (,$(OMIT_GNULIB_MODULE_strnlen)) - -EXTRA_DIST += strnlen.c - -EXTRA_libgnu_a_SOURCES += strnlen.c +ifneq (,$(GL_COND_OBJ_STRNLEN_CONDITION)) +libgnu_a_SOURCES += strnlen.c +endif endif ## end gnulib module strnlen @@ -3298,10 +3365,9 @@ endif ## begin gnulib module strtoimax ifeq (,$(OMIT_GNULIB_MODULE_strtoimax)) - -EXTRA_DIST += strtoimax.c - -EXTRA_libgnu_a_SOURCES += strtoimax.c +ifneq (,$(GL_COND_OBJ_STRTOIMAX_CONDITION)) +libgnu_a_SOURCES += strtoimax.c +endif endif ## end gnulib module strtoimax @@ -3310,11 +3376,14 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_strtoll)) ifneq (,$(gl_GNULIB_ENABLED_strtoll_CONDITION)) +ifneq (,$(GL_COND_OBJ_STRTOLL_CONDITION)) +libgnu_a_SOURCES += strtoll.c +endif endif -EXTRA_DIST += strtol.c strtoll.c +EXTRA_DIST += strtol.c -EXTRA_libgnu_a_SOURCES += strtol.c strtoll.c +EXTRA_libgnu_a_SOURCES += strtol.c endif ## end gnulib module strtoll @@ -3322,10 +3391,9 @@ endif ## begin gnulib module symlink ifeq (,$(OMIT_GNULIB_MODULE_symlink)) - -EXTRA_DIST += symlink.c - -EXTRA_libgnu_a_SOURCES += symlink.c +ifneq (,$(GL_COND_OBJ_SYMLINK_CONDITION)) +libgnu_a_SOURCES += symlink.c +endif endif ## end gnulib module symlink @@ -3602,10 +3670,9 @@ endif ## begin gnulib module time_r ifeq (,$(OMIT_GNULIB_MODULE_time_r)) - -EXTRA_DIST += time_r.c - -EXTRA_libgnu_a_SOURCES += time_r.c +ifneq (,$(GL_COND_OBJ_TIME_R_CONDITION)) +libgnu_a_SOURCES += time_r.c +endif endif ## end gnulib module time_r @@ -3613,10 +3680,11 @@ endif ## begin gnulib module time_rz ifeq (,$(OMIT_GNULIB_MODULE_time_rz)) +ifneq (,$(GL_COND_OBJ_TIME_RZ_CONDITION)) +libgnu_a_SOURCES += time_rz.c +endif -EXTRA_DIST += time-internal.h time_rz.c - -EXTRA_libgnu_a_SOURCES += time_rz.c +EXTRA_DIST += time-internal.h endif ## end gnulib module time_rz @@ -3624,10 +3692,11 @@ endif ## begin gnulib module timegm ifeq (,$(OMIT_GNULIB_MODULE_timegm)) +ifneq (,$(GL_COND_OBJ_TIMEGM_CONDITION)) +libgnu_a_SOURCES += timegm.c +endif -EXTRA_DIST += mktime-internal.h timegm.c - -EXTRA_libgnu_a_SOURCES += timegm.c +EXTRA_DIST += mktime-internal.h endif ## end gnulib module timegm @@ -3821,6 +3890,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ + -e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \ @@ -3909,10 +3979,13 @@ endif ## begin gnulib module utimensat ifeq (,$(OMIT_GNULIB_MODULE_utimensat)) +ifneq (,$(GL_COND_OBJ_UTIMENSAT_CONDITION)) +libgnu_a_SOURCES += utimensat.c +endif -EXTRA_DIST += at-func.c utimensat.c +EXTRA_DIST += at-func.c -EXTRA_libgnu_a_SOURCES += at-func.c utimensat.c +EXTRA_libgnu_a_SOURCES += at-func.c endif ## end gnulib module utimensat @@ -3954,3 +4027,7 @@ mostlyclean-local: mostlyclean-generic fi; \ done; \ : +distclean-local: distclean-gnulib-libobjs +distclean-gnulib-libobjs: + -rm -f @gl_LIBOBJDEPS@ +maintainer-clean-local: distclean-gnulib-libobjs diff --git a/lib/intprops.h b/lib/intprops.h index 68d6daa570..d4a917f72a 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -229,11 +229,15 @@ /* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow (A, B, P) work when P is non-null. */ -#if defined __has_builtin +#ifdef __EDG__ +/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned + . */ +# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0 +#elif defined __has_builtin # define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow) /* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x, see . */ -#elif 7 <= __GNUC__ && !defined __EDG__ +#elif 7 <= __GNUC__ # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1 #else # define _GL_HAS_BUILTIN_ADD_OVERFLOW 0 diff --git a/lib/lchmod.c b/lib/lchmod.c index 479ed776cb..706dddff7b 100644 --- a/lib/lchmod.c +++ b/lib/lchmod.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/memrchr.c b/lib/memrchr.c index e853996ad0..90fdb86f1f 100644 --- a/lib/memrchr.c +++ b/lib/memrchr.c @@ -11,7 +11,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/mini-gmp-gnulib.c b/lib/mini-gmp-gnulib.c index 7620da38db..a18ee8f6ab 100644 --- a/lib/mini-gmp-gnulib.c +++ b/lib/mini-gmp-gnulib.c @@ -6,7 +6,7 @@ It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". You can redistribute it and/or modify it under either - the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 3, or (at your + by the Free Software Foundation, either version 3, or (at your option) any later version, or - the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) diff --git a/lib/mini-gmp.c b/lib/mini-gmp.c index 8577b59ef6..e7a320a642 100644 --- a/lib/mini-gmp.c +++ b/lib/mini-gmp.c @@ -10,7 +10,7 @@ The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your + Software Foundation, either version 3 of the License, or (at your option) any later version. or diff --git a/lib/mini-gmp.h b/lib/mini-gmp.h index 59c24cf511..508712d235 100644 --- a/lib/mini-gmp.h +++ b/lib/mini-gmp.h @@ -8,7 +8,7 @@ The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your + Software Foundation, either version 3 of the License, or (at your option) any later version. or diff --git a/lib/mktime.c b/lib/mktime.c index aa12e28e16..7dc9d67ef9 100644 --- a/lib/mktime.c +++ b/lib/mktime.c @@ -429,8 +429,13 @@ __mktime_internal (struct tm *tp, time with the right value, and use its UTC offset. Heuristic: probe the adjacent timestamps in both directions, - looking for the desired isdst. This should work for all real - time zone histories in the tz database. */ + looking for the desired isdst. If none is found within a + reasonable duration bound, assume a one-hour DST difference. + This should work for all real time zone histories in the tz + database. */ + + /* +1 if we wanted standard time but got DST, -1 if the reverse. */ + int dst_difference = (isdst == 0) - (tm.tm_isdst == 0); /* Distance between probes when looking for a DST boundary. In tzdata2003a, the shortest period of DST is 601200 seconds @@ -441,12 +446,14 @@ __mktime_internal (struct tm *tp, periods when probing. */ int stride = 601200; - /* The longest period of DST in tzdata2003a is 536454000 seconds - (e.g., America/Jujuy starting 1946-10-01 01:00). The longest - period of non-DST is much longer, but it makes no real sense - to search for more than a year of non-DST, so use the DST - max. */ - int duration_max = 536454000; + /* In TZDB 2021e, the longest period of DST (or of non-DST), in + which the DST (or adjacent DST) difference is not one hour, + is 457243209 seconds: e.g., America/Cambridge_Bay with leap + seconds, starting 1965-10-31 00:00 in a switch from + double-daylight time (-05) to standard time (-07), and + continuing to 1980-04-27 02:00 in a switch from standard time + (-07) to daylight time (-06). */ + int duration_max = 457243209; /* Search in both directions, so the maximum distance is half the duration; add the stride to avoid off-by-1 problems. */ @@ -483,6 +490,11 @@ __mktime_internal (struct tm *tp, } } + /* No unusual DST offset was found nearby. Assume one-hour DST. */ + t += 60 * 60 * dst_difference; + if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm)) + goto offset_found; + __set_errno (EOVERFLOW); return -1; } diff --git a/lib/nstrftime.c b/lib/nstrftime.c index 190ff4d8f2..c1dd554247 100644 --- a/lib/nstrftime.c +++ b/lib/nstrftime.c @@ -3,7 +3,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, @@ -1158,7 +1158,6 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) case L_('q'): /* GNU extension. */ DO_SIGNED_NUMBER (1, false, ((tp->tm_mon * 11) >> 5) + 1); - break; case L_('R'): subfmt = L_("%H:%M"); diff --git a/lib/openat-priv.h b/lib/openat-priv.h index 451cac10cc..5d60810709 100644 --- a/lib/openat-priv.h +++ b/lib/openat-priv.h @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/openat-proc.c b/lib/openat-proc.c index d5f4296d47..3bacf7dbd1 100644 --- a/lib/openat-proc.c +++ b/lib/openat-proc.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/openat.h b/lib/openat.h index dcb2864ffc..5c8ff90b80 100644 --- a/lib/openat.h +++ b/lib/openat.h @@ -3,7 +3,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/qcopy-acl.c b/lib/qcopy-acl.c index 42ae68ffc1..37fb179260 100644 --- a/lib/qcopy-acl.c +++ b/lib/qcopy-acl.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/readlinkat.c b/lib/readlinkat.c index f3d39604d2..ab45e140b5 100644 --- a/lib/readlinkat.c +++ b/lib/readlinkat.c @@ -3,7 +3,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/save-cwd.h b/lib/save-cwd.h index 7aa124c42f..90e8a0747c 100644 --- a/lib/save-cwd.h +++ b/lib/save-cwd.h @@ -5,7 +5,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/set-permissions.c b/lib/set-permissions.c index 7a7c5e4ed0..c1a4b82a0d 100644 --- a/lib/set-permissions.c +++ b/lib/set-permissions.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/sig2str.c b/lib/sig2str.c index f2f01d1f6f..8e2fc0c075 100644 --- a/lib/sig2str.c +++ b/lib/sig2str.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/sig2str.h b/lib/sig2str.h index a507170b64..a45af7f968 100644 --- a/lib/sig2str.h +++ b/lib/sig2str.h @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/strftime.h b/lib/strftime.h index 9e5cdc3f32..a9847084f0 100644 --- a/lib/strftime.h +++ b/lib/strftime.h @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/string.in.h b/lib/string.in.h index 03e6a17a36..c9432948c1 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -563,22 +563,35 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - " # undef strndup # define strndup rpl_strndup # endif -_GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_RPL (strndup, char *, + (char const *__s, size_t __n) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); # else -# if ! @HAVE_DECL_STRNDUP@ -_GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n) - _GL_ARG_NONNULL ((1))); +# if !@HAVE_DECL_STRNDUP@ || __GNUC__ >= 11 +_GL_FUNCDECL_SYS (strndup, char *, + (char const *__s, size_t __n) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); # endif _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); # endif _GL_CXXALIASWARN (strndup); -#elif defined GNULIB_POSIXCHECK -# undef strndup -# if HAVE_RAW_DECL_STRNDUP +#else +# if __GNUC__ >= 11 +/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */ +_GL_FUNCDECL_SYS (strndup, char *, + (char const *__s, size_t __n) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +# if defined GNULIB_POSIXCHECK +# undef strndup +# if HAVE_RAW_DECL_STRNDUP _GL_WARN_ON_USE (strndup, "strndup is unportable - " "use gnulib module strndup for portability"); +# endif # endif #endif diff --git a/lib/strtoimax.c b/lib/strtoimax.c index d562746ee7..cad12d0d9b 100644 --- a/lib/strtoimax.c +++ b/lib/strtoimax.c @@ -5,7 +5,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/strtol.c b/lib/strtol.c index 457f7a5d64..6c2e9333ab 100644 --- a/lib/strtol.c +++ b/lib/strtol.c @@ -8,7 +8,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/strtoll.c b/lib/strtoll.c index 5124168c1b..acea42ee00 100644 --- a/lib/strtoll.c +++ b/lib/strtoll.c @@ -5,7 +5,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/symlink.c b/lib/symlink.c index 51850b2732..26310af7b1 100644 --- a/lib/symlink.c +++ b/lib/symlink.c @@ -3,7 +3,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/time-internal.h b/lib/time-internal.h index e1bb56e53e..c8a2a8ce6b 100644 --- a/lib/time-internal.h +++ b/lib/time-internal.h @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/time_rz.c b/lib/time_rz.c index d0ae717f30..1a91d3778e 100644 --- a/lib/time_rz.c +++ b/lib/time_rz.c @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/timespec-add.c b/lib/timespec-add.c index cd0b5f5f5b..0f270e5bc8 100644 --- a/lib/timespec-add.c +++ b/lib/timespec-add.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/timespec-sub.c b/lib/timespec-sub.c index 2b2aaa5937..36747833e3 100644 --- a/lib/timespec-sub.c +++ b/lib/timespec-sub.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/timespec.c b/lib/timespec.c index 82630c2f5a..9d136cb803 100644 --- a/lib/timespec.c +++ b/lib/timespec.c @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/timespec.h b/lib/timespec.h index e130d2c6e2..9e358289a2 100644 --- a/lib/timespec.h +++ b/lib/timespec.h @@ -5,7 +5,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 3386f0b0f7..57df09ecdf 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -415,16 +415,30 @@ _GL_CXXALIASWARN (close); #if @GNULIB_COPY_FILE_RANGE@ -# if !@HAVE_COPY_FILE_RANGE@ +# if @REPLACE_COPY_FILE_RANGE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef copy_file_range +# define copy_file_range rpl_copy_file_range +# endif +_GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, + int ofd, off_t *opos, + size_t len, unsigned flags)); +_GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, + int ofd, off_t *opos, + size_t len, unsigned flags)); +# else +# if !@HAVE_COPY_FILE_RANGE@ _GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, size_t len, unsigned flags)); +# endif _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, size_t len, unsigned flags)); # endif _GL_CXXALIASWARN (copy_file_range); #elif defined GNULIB_POSIXCHECK +# undef copy_file_range # if HAVE_RAW_DECL_COPY_FILE_RANGE _GL_WARN_ON_USE (copy_file_range, "copy_file_range is unportable - " diff --git a/lib/unlocked-io.h b/lib/unlocked-io.h index ce52f8f977..7461d74095 100644 --- a/lib/unlocked-io.h +++ b/lib/unlocked-io.h @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/utimens.c b/lib/utimens.c index f4907ae4e6..2fa1251850 100644 --- a/lib/utimens.c +++ b/lib/utimens.c @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/utimens.h b/lib/utimens.h index c3054da0c6..2ccc06e5ed 100644 --- a/lib/utimens.h +++ b/lib/utimens.h @@ -4,7 +4,7 @@ This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the + published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, diff --git a/lib/utimensat.c b/lib/utimensat.c index 2e4c7bf966..f81b0c790e 100644 --- a/lib/utimensat.c +++ b/lib/utimensat.c @@ -3,7 +3,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/lib/vla.h b/lib/vla.h index adc8f8f68b..ce02428f53 100644 --- a/lib/vla.h +++ b/lib/vla.h @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/m4/copy-file-range.m4 b/m4/copy-file-range.m4 index 4c7ec4eaaf..1b8b9d8858 100644 --- a/m4/copy-file-range.m4 +++ b/m4/copy-file-range.m4 @@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_COPY_FILE_RANGE], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl Persuade glibc to declare copy_file_range. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) @@ -21,7 +22,7 @@ AC_DEFUN([gl_FUNC_COPY_FILE_RANGE], [AC_LANG_PROGRAM( [[#include ]], - [[ssize_t (*func) (int, off_t *, int, off_t, size_t, unsigned) + [[ssize_t (*func) (int, off_t *, int, off_t *, size_t, unsigned) = copy_file_range; return func (0, 0, 0, 0, 0, 0) & 127; ]]) @@ -32,5 +33,27 @@ AC_DEFUN([gl_FUNC_COPY_FILE_RANGE], if test "$gl_cv_func_copy_file_range" != yes; then HAVE_COPY_FILE_RANGE=0 + else + AC_DEFINE([HAVE_COPY_FILE_RANGE], 1, + [Define to 1 if the function copy_file_range exists.]) + + case $host_os in + linux*) + AC_CACHE_CHECK([whether copy_file_range is known to work], + [gl_cv_copy_file_range_known_to_work], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[#if LINUX_VERSION_CODE < KERNEL_VERSION (5, 3, 0) + #error "copy_file_range is buggy" + #endif + ]])], + [gl_cv_copy_file_range_known_to_work=yes], + [gl_cv_copy_file_range_known_to_work=no])]) + if test "$gl_cv_copy_file_range_known_to_work" = no; then + REPLACE_COPY_FILE_RANGE=1 + fi;; + esac fi ]) diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4 index 2e914dbc07..8a12bddd57 100644 --- a/m4/extern-inline.m4 +++ b/m4/extern-inline.m4 @@ -7,7 +7,22 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_EXTERN_INLINE], [ - AH_VERBATIM([extern_inline], + AC_CACHE_CHECK([whether ctype.h defines __header_inline], + [gl_cv_have___header_inline], + [AC_PREPROC_IFELSE( + [AC_LANG_SOURCE([[#include + #ifndef __header_inline + #error " does not define __header_inline" + #endif + ]])], + [gl_cv_have___header_inline=yes], + [gl_cv_have___header_inline=no])]) + if test "$gl_cv_have___header_inline" = yes; then + AC_DEFINE([HAVE___HEADER_INLINE], [1], + [Define to 1 if ctype.h defines __header_inline.]) + fi + + AH_VERBATIM([HAVE___HEADER_INLINE_1], [/* Please see the Gnulib manual for how to use these macros. Suppress extern inline with HP-UX cc, as it appears to be broken; see @@ -54,7 +69,7 @@ AC_DEFUN([gl_EXTERN_INLINE], */ #if (((defined __APPLE__ && defined __MACH__) \ || defined __DragonFly__ || defined __FreeBSD__) \ - && (defined __header_inline \ + && (defined HAVE___HEADER_INLINE \ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ && ! defined __clang__) \ : ((! defined _DONT_USE_CTYPE_INLINE_ \ diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 87a9a751b6..dbc4079614 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 69 +# gnulib-common.m4 serial 72 dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -181,7 +181,12 @@ AC_DEFUN([gl_COMMON_BODY], [ #else # define _GL_ATTRIBUTE_DEALLOC(f, i) #endif -#define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1) +/* If gnulib's or has already defined this macro, continue + to use this earlier definition, since may not have been included + yet. */ +#ifndef _GL_ATTRIBUTE_DEALLOC_FREE +# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1) +#endif /* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated. The compiler may warn if the entity is used. */ @@ -813,6 +818,24 @@ AC_DEFUN([gl_CACHE_VAL_SILENT], ]) ]) +# gl_CONDITIONAL(conditional, condition) +# is like AM_CONDITIONAL(conditional, condition), except that it does not +# produce an error +# configure: error: conditional "..." was never defined. +# Usually this means the macro was only invoked conditionally. +# when only invoked conditionally. Instead, in that case, both the _TRUE +# and the _FALSE case are disabled. +AC_DEFUN([gl_CONDITIONAL], +[ + pushdef([AC_CONFIG_COMMANDS_PRE], [:])dnl + AM_CONDITIONAL([$1], [$2]) + popdef([AC_CONFIG_COMMANDS_PRE])dnl + if test -z "${[$1]_TRUE}" && test -z "${[$1]_FALSE}"; then + [$1]_TRUE='#' + [$1]_FALSE='#' + fi +]) + # gl_CC_ALLOW_WARNINGS # sets and substitutes a variable GL_CFLAG_ALLOW_WARNINGS, to a $(CC) option # that reverts a preceding '-Werror' option, if available. @@ -879,6 +902,72 @@ AC_DEFUN([gl_CXX_ALLOW_WARNINGS], AC_SUBST([GL_CXXFLAG_ALLOW_WARNINGS]) ]) +# gl_CC_GNULIB_WARNINGS +# sets and substitutes a variable GL_CFLAG_GNULIB_WARNINGS, to a $(CC) option +# set that enables or disables warnings as suitable for the Gnulib coding style. +AC_DEFUN([gl_CC_GNULIB_WARNINGS], +[ + AC_REQUIRE([gl_CC_ALLOW_WARNINGS]) + dnl Assume that the compiler supports -Wno-* options only if it also supports + dnl -Wno-error. + GL_CFLAG_GNULIB_WARNINGS='' + if test -n "$GL_CFLAG_ALLOW_WARNINGS"; then + dnl Enable these warning options: + dnl + dnl GCC clang + dnl -Wno-cast-qual >= 3 >= 3.9 + dnl -Wno-conversion >= 3 >= 3.9 + dnl -Wno-float-conversion >= 4.9 >= 3.9 + dnl -Wno-float-equal >= 3 >= 3.9 + dnl -Wimplicit-fallthrough >= 7 >= 3.9 + dnl -Wno-pedantic >= 4.8 >= 3.9 + dnl -Wno-sign-compare >= 3 >= 3.9 + dnl -Wno-sign-conversion >= 4.3 >= 3.9 + dnl -Wno-type-limits >= 4.3 >= 3.9 + dnl -Wno-undef >= 3 >= 3.9 + dnl -Wno-unsuffixed-float-constants >= 4.5 + dnl -Wno-unused-function >= 3 >= 3.9 + dnl -Wno-unused-parameter >= 3 >= 3.9 + dnl + cat > conftest.c <<\EOF + #if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wno-cast-qual + -Wno-conversion + -Wno-float-equal + -Wno-sign-compare + -Wno-undef + -Wno-unused-function + -Wno-unused-parameter + #endif + #if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wno-float-conversion + #endif + #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wimplicit-fallthrough + #endif + #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wno-pedantic + #endif + #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wno-sign-conversion + -Wno-type-limits + #endif + #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4 + -Wno-unsuffixed-float-constants + #endif +EOF + gl_command="$CC $CFLAGS $CPPFLAGS -E conftest.c > conftest.out" + if AC_TRY_EVAL([gl_command]); then + gl_options=`grep -v '#' conftest.out` + for word in $gl_options; do + GL_CFLAG_GNULIB_WARNINGS="$GL_CFLAG_GNULIB_WARNINGS $word" + done + fi + rm -f conftest.c conftest.out + fi + AC_SUBST([GL_CFLAG_GNULIB_WARNINGS]) +]) + dnl gl_CONDITIONAL_HEADER([foo.h]) dnl takes a shell variable GL_GENERATE_FOO_H (with value true or false) as input dnl and produces @@ -903,7 +992,7 @@ AC_DEFUN([gl_CONDITIONAL_HEADER], *) echo "*** gl_generate_var is not set correctly" 1>&2; exit 1 ;; esac AC_SUBST(gl_header_name) - AM_CONDITIONAL(gl_generate_cond, [$gl_generate_var]) + gl_CONDITIONAL(gl_generate_cond, [$gl_generate_var]) m4_popdef([gl_generate_cond]) m4_popdef([gl_generate_var]) m4_popdef([gl_header_name]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index c47ea915f1..1d31239d2d 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -3,7 +3,7 @@ # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, @@ -236,9 +236,8 @@ AC_DEFUN([gl_INIT], gl_CONDITIONAL_HEADER([byteswap.h]) AC_PROG_MKDIR_P gl_CANONICALIZE_LGPL - if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then - AC_LIBOBJ([canonicalize-lgpl]) - fi + gl_CONDITIONAL([GL_COND_OBJ_CANONICALIZE_LGPL], + [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]) gl_MODULE_INDICATOR([canonicalize-lgpl]) gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name]) gl_STDLIB_MODULE_INDICATOR([realpath]) @@ -247,9 +246,9 @@ AC_DEFUN([gl_INIT], gl_CLOCK_TIME gl_MODULE_INDICATOR([close-stream]) gl_FUNC_COPY_FILE_RANGE - if test $HAVE_COPY_FILE_RANGE = 0; then - AC_LIBOBJ([copy-file-range]) - fi + gl_CONDITIONAL([GL_COND_OBJ_COPY_FILE_RANGE], + [test $HAVE_COPY_FILE_RANGE = 0 || + test $REPLACE_COPY_FILE_RANGE = 1]) gl_UNISTD_MODULE_INDICATOR([copy-file-range]) AC_REQUIRE([AC_C_RESTRICT]) gl_MD5 @@ -265,10 +264,10 @@ AC_DEFUN([gl_INIT], AC_PROG_MKDIR_P gl_DOUBLE_SLASH_ROOT gl_FUNC_DUP2 - if test $REPLACE_DUP2 = 1; then - AC_LIBOBJ([dup2]) + gl_CONDITIONAL([GL_COND_OBJ_DUP2], [test $REPLACE_DUP2 = 1]) + AM_COND_IF([GL_COND_OBJ_DUP2], [ gl_PREREQ_DUP2 - fi + ]) gl_UNISTD_MODULE_INDICATOR([dup2]) gl_ENVIRON gl_UNISTD_MODULE_INDICATOR([environ]) @@ -278,83 +277,77 @@ AC_DEFUN([gl_INIT], gl_EXECINFO_H gl_CONDITIONAL_HEADER([execinfo.h]) AC_PROG_MKDIR_P - if $GL_GENERATE_EXECINFO_H; then - AC_LIBOBJ([execinfo]) - fi + gl_CONDITIONAL([GL_COND_OBJ_EXECINFO], [$GL_GENERATE_EXECINFO_H]) gl_FUNC_EXPLICIT_BZERO - if test $HAVE_EXPLICIT_BZERO = 0; then - AC_LIBOBJ([explicit_bzero]) + gl_CONDITIONAL([GL_COND_OBJ_EXPLICIT_BZERO], [test $HAVE_EXPLICIT_BZERO = 0]) + AM_COND_IF([GL_COND_OBJ_EXPLICIT_BZERO], [ gl_PREREQ_EXPLICIT_BZERO - fi + ]) gl_STRING_MODULE_INDICATOR([explicit_bzero]) AC_REQUIRE([gl_EXTERN_INLINE]) gl_FUNC_FACCESSAT - if test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1; then - AC_LIBOBJ([faccessat]) + gl_CONDITIONAL([GL_COND_OBJ_FACCESSAT], + [test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1]) + AM_COND_IF([GL_COND_OBJ_FACCESSAT], [ gl_PREREQ_FACCESSAT - fi + ]) gl_MODULE_INDICATOR([faccessat]) gl_UNISTD_MODULE_INDICATOR([faccessat]) gl_FUNC_FCHMODAT - if test $HAVE_FCHMODAT = 0 || test $REPLACE_FCHMODAT = 1; then - AC_LIBOBJ([fchmodat]) + gl_CONDITIONAL([GL_COND_OBJ_FCHMODAT], + [test $HAVE_FCHMODAT = 0 || test $REPLACE_FCHMODAT = 1]) + AM_COND_IF([GL_COND_OBJ_FCHMODAT], [ gl_PREREQ_FCHMODAT - fi + ]) gl_SYS_STAT_MODULE_INDICATOR([fchmodat]) gl_FUNC_FCNTL - if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then - AC_LIBOBJ([fcntl]) - fi + gl_CONDITIONAL([GL_COND_OBJ_FCNTL], + [test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1]) gl_FCNTL_MODULE_INDICATOR([fcntl]) gl_FCNTL_H gl_FCNTL_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_FDOPENDIR - if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then - AC_LIBOBJ([fdopendir]) - fi + gl_CONDITIONAL([GL_COND_OBJ_FDOPENDIR], + [test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1]) gl_DIRENT_MODULE_INDICATOR([fdopendir]) gl_MODULE_INDICATOR([fdopendir]) gl_FILE_HAS_ACL gl_FILEMODE AC_C_FLEXIBLE_ARRAY_MEMBER gl_FUNC_FPENDING - if test $gl_cv_func___fpending = no; then - AC_LIBOBJ([fpending]) - fi + gl_CONDITIONAL([GL_COND_OBJ_FPENDING], [test $gl_cv_func___fpending = no]) gl_FUNC_FREE - if test $REPLACE_FREE = 1; then - AC_LIBOBJ([free]) + gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1]) + AM_COND_IF([GL_COND_OBJ_FREE], [ gl_PREREQ_FREE - fi + ]) gl_STDLIB_MODULE_INDICATOR([free-posix]) gl_FUNC_FSTATAT - if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then - AC_LIBOBJ([fstatat]) - fi + gl_CONDITIONAL([GL_COND_OBJ_FSTATAT], + [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]) gl_SYS_STAT_MODULE_INDICATOR([fstatat]) gl_FSUSAGE - if test $gl_cv_fs_space = yes; then - AC_LIBOBJ([fsusage]) + gl_CONDITIONAL([GL_COND_OBJ_FSUSAGE], [test $gl_cv_fs_space = yes]) + AM_COND_IF([GL_COND_OBJ_FSUSAGE], [ gl_PREREQ_FSUSAGE_EXTRA - fi + ]) gl_FUNC_FSYNC - if test $HAVE_FSYNC = 0; then - AC_LIBOBJ([fsync]) + gl_CONDITIONAL([GL_COND_OBJ_FSYNC], [test $HAVE_FSYNC = 0]) + AM_COND_IF([GL_COND_OBJ_FSYNC], [ gl_PREREQ_FSYNC - fi + ]) gl_UNISTD_MODULE_INDICATOR([fsync]) gl_FUNC_FUTIMENS - if test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1; then - AC_LIBOBJ([futimens]) - fi + gl_CONDITIONAL([GL_COND_OBJ_FUTIMENS], + [test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1]) gl_SYS_STAT_MODULE_INDICATOR([futimens]) AC_REQUIRE([AC_CANONICAL_HOST]) gl_GETLOADAVG - if test $HAVE_GETLOADAVG = 0; then - AC_LIBOBJ([getloadavg]) + gl_CONDITIONAL([GL_COND_OBJ_GETLOADAVG], [test $HAVE_GETLOADAVG = 0]) + AM_COND_IF([GL_COND_OBJ_GETLOADAVG], [ gl_PREREQ_GETLOADAVG - fi + ]) gl_STDLIB_MODULE_INDICATOR([getloadavg]) gl_FUNC_GETOPT_GNU dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required @@ -364,26 +357,25 @@ AC_DEFUN([gl_INIT], gl_CONDITIONAL_HEADER([getopt.h]) gl_CONDITIONAL_HEADER([getopt-cdefs.h]) AC_PROG_MKDIR_P - if test $REPLACE_GETOPT = 1; then - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) + gl_CONDITIONAL([GL_COND_OBJ_GETOPT], [test $REPLACE_GETOPT = 1]) + AM_COND_IF([GL_COND_OBJ_GETOPT], [ dnl Define the substituted variable GNULIB_UNISTD_H_GETOPT to 1. gl_UNISTD_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1]) - fi + ]) gl_UNISTD_MODULE_INDICATOR([getopt-posix]) AC_REQUIRE([AC_CANONICAL_HOST]) gl_FUNC_GETRANDOM - if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then - AC_LIBOBJ([getrandom]) - fi + gl_CONDITIONAL([GL_COND_OBJ_GETRANDOM], + [test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1]) gl_SYS_RANDOM_MODULE_INDICATOR([getrandom]) gl_GETTIME gl_FUNC_GETTIMEOFDAY - if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then - AC_LIBOBJ([gettimeofday]) + gl_CONDITIONAL([GL_COND_OBJ_GETTIMEOFDAY], + [test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1]) + AM_COND_IF([GL_COND_OBJ_GETTIMEOFDAY], [ gl_PREREQ_GETTIMEOFDAY - fi + ]) gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) gl_IEEE754_H gl_CONDITIONAL_HEADER([ieee754.h]) @@ -396,17 +388,15 @@ AC_DEFUN([gl_INIT], gl_LIBGMP gl_CONDITIONAL_HEADER([gmp.h]) AC_PROG_MKDIR_P - if test $HAVE_LIBGMP != yes; then - AC_LIBOBJ([mini-gmp-gnulib]) - fi + gl_CONDITIONAL([GL_COND_OBJ_MINI_GMP_GNULIB], [test $HAVE_LIBGMP != yes]) gl_LIMITS_H gl_CONDITIONAL_HEADER([limits.h]) AC_PROG_MKDIR_P gl_FUNC_LSTAT - if test $REPLACE_LSTAT = 1; then - AC_LIBOBJ([lstat]) + gl_CONDITIONAL([GL_COND_OBJ_LSTAT], [test $REPLACE_LSTAT = 1]) + AM_COND_IF([GL_COND_OBJ_LSTAT], [ gl_PREREQ_LSTAT - fi + ]) gl_SYS_STAT_MODULE_INDICATOR([lstat]) gl_FUNC_MEMMEM_SIMPLE if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then @@ -414,23 +404,23 @@ AC_DEFUN([gl_INIT], fi gl_STRING_MODULE_INDICATOR([memmem]) gl_FUNC_MEMPCPY - if test $HAVE_MEMPCPY = 0; then - AC_LIBOBJ([mempcpy]) + gl_CONDITIONAL([GL_COND_OBJ_MEMPCPY], [test $HAVE_MEMPCPY = 0]) + AM_COND_IF([GL_COND_OBJ_MEMPCPY], [ gl_PREREQ_MEMPCPY - fi + ]) gl_STRING_MODULE_INDICATOR([mempcpy]) gl_FUNC_MEMRCHR - if test $ac_cv_func_memrchr = no; then - AC_LIBOBJ([memrchr]) + gl_CONDITIONAL([GL_COND_OBJ_MEMRCHR], [test $ac_cv_func_memrchr = no]) + AM_COND_IF([GL_COND_OBJ_MEMRCHR], [ gl_PREREQ_MEMRCHR - fi + ]) gl_STRING_MODULE_INDICATOR([memrchr]) gl_MINMAX gl_FUNC_MKOSTEMP - if test $HAVE_MKOSTEMP = 0; then - AC_LIBOBJ([mkostemp]) + gl_CONDITIONAL([GL_COND_OBJ_MKOSTEMP], [test $HAVE_MKOSTEMP = 0]) + AM_COND_IF([GL_COND_OBJ_MKOSTEMP], [ gl_PREREQ_MKOSTEMP - fi + ]) gl_MODULE_INDICATOR([mkostemp]) gl_STDLIB_MODULE_INDICATOR([mkostemp]) gl_FUNC_MKTIME @@ -446,41 +436,39 @@ AC_DEFUN([gl_INIT], gl_FUNC_PIPE2 gl_UNISTD_MODULE_INDICATOR([pipe2]) gl_FUNC_PSELECT - if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then - AC_LIBOBJ([pselect]) - fi + gl_CONDITIONAL([GL_COND_OBJ_PSELECT], + [test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1]) gl_SYS_SELECT_MODULE_INDICATOR([pselect]) gl_FUNC_PTHREAD_SIGMASK - if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then - AC_LIBOBJ([pthread_sigmask]) + gl_CONDITIONAL([GL_COND_OBJ_PTHREAD_SIGMASK], + [test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1]) + AM_COND_IF([GL_COND_OBJ_PTHREAD_SIGMASK], [ gl_PREREQ_PTHREAD_SIGMASK - fi + ]) gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask]) gl_FUNC_READLINK - if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then - AC_LIBOBJ([readlink]) + gl_CONDITIONAL([GL_COND_OBJ_READLINK], + [test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1]) + AM_COND_IF([GL_COND_OBJ_READLINK], [ gl_PREREQ_READLINK - fi + ]) gl_UNISTD_MODULE_INDICATOR([readlink]) gl_FUNC_READLINKAT - if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then - AC_LIBOBJ([readlinkat]) - fi + gl_CONDITIONAL([GL_COND_OBJ_READLINKAT], + [test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1]) gl_UNISTD_MODULE_INDICATOR([readlinkat]) gl_REGEX - if test $ac_use_included_regex = yes; then - AC_LIBOBJ([regex]) + gl_CONDITIONAL([GL_COND_OBJ_REGEX], [test $ac_use_included_regex = yes]) + AM_COND_IF([GL_COND_OBJ_REGEX], [ gl_PREREQ_REGEX - fi + ]) gl_FUNC_SIG2STR - if test $ac_cv_func_sig2str = no; then - AC_LIBOBJ([sig2str]) + gl_CONDITIONAL([GL_COND_OBJ_SIG2STR], [test $ac_cv_func_sig2str = no]) + AM_COND_IF([GL_COND_OBJ_SIG2STR], [ gl_PREREQ_SIG2STR - fi + ]) gl_FUNC_SIGDESCR_NP - if test $HAVE_SIGDESCR_NP = 0; then - AC_LIBOBJ([sigdescr_np]) - fi + gl_CONDITIONAL([GL_COND_OBJ_SIGDESCR_NP], [test $HAVE_SIGDESCR_NP = 0]) gl_STRING_MODULE_INDICATOR([sigdescr_np]) gl_SIGNAL_H gl_SIGNAL_H_REQUIRE_DEFAULTS @@ -504,6 +492,8 @@ AC_DEFUN([gl_INIT], gl_STDIO_H gl_STDIO_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P + gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1]) + gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1]) dnl No need to create extra modules for these functions. Everyone who uses dnl likely needs them. gl_STDIO_MODULE_INDICATOR([fscanf]) @@ -531,30 +521,31 @@ AC_DEFUN([gl_INIT], gl_STDLIB_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_STPCPY - if test $HAVE_STPCPY = 0; then - AC_LIBOBJ([stpcpy]) + gl_CONDITIONAL([GL_COND_OBJ_STPCPY], [test $HAVE_STPCPY = 0]) + AM_COND_IF([GL_COND_OBJ_STPCPY], [ gl_PREREQ_STPCPY - fi + ]) gl_STRING_MODULE_INDICATOR([stpcpy]) gl_STRING_H gl_STRING_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_STRNLEN - if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then - AC_LIBOBJ([strnlen]) + gl_CONDITIONAL([GL_COND_OBJ_STRNLEN], + [test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1]) + AM_COND_IF([GL_COND_OBJ_STRNLEN], [ gl_PREREQ_STRNLEN - fi + ]) gl_STRING_MODULE_INDICATOR([strnlen]) gl_FUNC_STRTOIMAX - if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then - AC_LIBOBJ([strtoimax]) + gl_CONDITIONAL([GL_COND_OBJ_STRTOIMAX], + [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]) + AM_COND_IF([GL_COND_OBJ_STRTOIMAX], [ gl_PREREQ_STRTOIMAX - fi + ]) gl_INTTYPES_MODULE_INDICATOR([strtoimax]) gl_FUNC_SYMLINK - if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then - AC_LIBOBJ([symlink]) - fi + gl_CONDITIONAL([GL_COND_OBJ_SYMLINK], + [test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1]) gl_UNISTD_MODULE_INDICATOR([symlink]) gl_SYS_RANDOM_H gl_SYS_RANDOM_H_REQUIRE_DEFAULTS @@ -577,21 +568,21 @@ AC_DEFUN([gl_INIT], gl_TIME_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_TIME_R - if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then - AC_LIBOBJ([time_r]) + gl_CONDITIONAL([GL_COND_OBJ_TIME_R], + [test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1]) + AM_COND_IF([GL_COND_OBJ_TIME_R], [ gl_PREREQ_TIME_R - fi + ]) gl_TIME_MODULE_INDICATOR([time_r]) gl_TIME_RZ - if test $HAVE_TIMEZONE_T = 0; then - AC_LIBOBJ([time_rz]) - fi + gl_CONDITIONAL([GL_COND_OBJ_TIME_RZ], [test $HAVE_TIMEZONE_T = 0]) gl_TIME_MODULE_INDICATOR([time_rz]) gl_FUNC_TIMEGM - if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then - AC_LIBOBJ([timegm]) + gl_CONDITIONAL([GL_COND_OBJ_TIMEGM], + [test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1]) + AM_COND_IF([GL_COND_OBJ_TIMEGM], [ gl_PREREQ_TIMEGM - fi + ]) gl_TIME_MODULE_INDICATOR([timegm]) gl_TIMER_TIME gl_TIMESPEC @@ -610,9 +601,8 @@ AC_DEFUN([gl_INIT], [An alias of GNULIB_STDIO_SINGLE_THREAD.]) gl_FUNC_GLIBC_UNLOCKED_IO gl_FUNC_UTIMENSAT - if test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1; then - AC_LIBOBJ([utimensat]) - fi + gl_CONDITIONAL([GL_COND_OBJ_UTIMENSAT], + [test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1]) gl_SYS_STAT_MODULE_INDICATOR([utimensat]) AC_C_VARARRAYS gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false @@ -660,11 +650,11 @@ AC_DEFUN([gl_INIT], { if ! $gl_gnulib_enabled_dirfd; then gl_FUNC_DIRFD - if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \ - || test $REPLACE_DIRFD = 1; then - AC_LIBOBJ([dirfd]) + gl_CONDITIONAL([GL_COND_OBJ_DIRFD], + [test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no || test $REPLACE_DIRFD = 1]) + AM_COND_IF([GL_COND_OBJ_DIRFD], [ gl_PREREQ_DIRFD - fi + ]) gl_DIRENT_MODULE_INDICATOR([dirfd]) gl_gnulib_enabled_dirfd=true fi @@ -686,10 +676,10 @@ AC_DEFUN([gl_INIT], { if ! $gl_gnulib_enabled_euidaccess; then gl_FUNC_EUIDACCESS - if test $HAVE_EUIDACCESS = 0; then - AC_LIBOBJ([euidaccess]) + gl_CONDITIONAL([GL_COND_OBJ_EUIDACCESS], [test $HAVE_EUIDACCESS = 0]) + AM_COND_IF([GL_COND_OBJ_EUIDACCESS], [ gl_PREREQ_EUIDACCESS - fi + ]) gl_UNISTD_MODULE_INDICATOR([euidaccess]) gl_gnulib_enabled_euidaccess=true if test $HAVE_EUIDACCESS = 0; then @@ -702,10 +692,11 @@ AC_DEFUN([gl_INIT], { if ! $gl_gnulib_enabled_getdtablesize; then gl_FUNC_GETDTABLESIZE - if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then - AC_LIBOBJ([getdtablesize]) + gl_CONDITIONAL([GL_COND_OBJ_GETDTABLESIZE], + [test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1]) + AM_COND_IF([GL_COND_OBJ_GETDTABLESIZE], [ gl_PREREQ_GETDTABLESIZE - fi + ]) gl_UNISTD_MODULE_INDICATOR([getdtablesize]) gl_gnulib_enabled_getdtablesize=true fi @@ -714,9 +705,8 @@ AC_DEFUN([gl_INIT], { if ! $gl_gnulib_enabled_getgroups; then gl_FUNC_GETGROUPS - if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then - AC_LIBOBJ([getgroups]) - fi + gl_CONDITIONAL([GL_COND_OBJ_GETGROUPS], + [test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1]) gl_UNISTD_MODULE_INDICATOR([getgroups]) gl_gnulib_enabled_getgroups=true if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then @@ -736,10 +726,10 @@ AC_DEFUN([gl_INIT], { if ! $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then gl_FUNC_GROUP_MEMBER - if test $HAVE_GROUP_MEMBER = 0; then - AC_LIBOBJ([group-member]) + gl_CONDITIONAL([GL_COND_OBJ_GROUP_MEMBER], [test $HAVE_GROUP_MEMBER = 0]) + AM_COND_IF([GL_COND_OBJ_GROUP_MEMBER], [ gl_PREREQ_GROUP_MEMBER - fi + ]) gl_UNISTD_MODULE_INDICATOR([group-member]) gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=true if test $HAVE_GROUP_MEMBER = 0; then @@ -754,10 +744,10 @@ AC_DEFUN([gl_INIT], { if ! $gl_gnulib_enabled_lchmod; then gl_FUNC_LCHMOD - if test $HAVE_LCHMOD = 0; then - AC_LIBOBJ([lchmod]) + gl_CONDITIONAL([GL_COND_OBJ_LCHMOD], [test $HAVE_LCHMOD = 0]) + AM_COND_IF([GL_COND_OBJ_LCHMOD], [ gl_PREREQ_LCHMOD - fi + ]) gl_SYS_STAT_MODULE_INDICATOR([lchmod]) gl_gnulib_enabled_lchmod=true fi @@ -806,10 +796,10 @@ AC_DEFUN([gl_INIT], { if ! $gl_gnulib_enabled_open; then gl_FUNC_OPEN - if test $REPLACE_OPEN = 1; then - AC_LIBOBJ([open]) + gl_CONDITIONAL([GL_COND_OBJ_OPEN], [test $REPLACE_OPEN = 1]) + AM_COND_IF([GL_COND_OBJ_OPEN], [ gl_PREREQ_OPEN - fi + ]) gl_FCNTL_MODULE_INDICATOR([open]) gl_gnulib_enabled_open=true if test $REPLACE_OPEN = 1; then @@ -827,10 +817,10 @@ AC_DEFUN([gl_INIT], { if ! $gl_gnulib_enabled_rawmemchr; then gl_FUNC_RAWMEMCHR - if test $HAVE_RAWMEMCHR = 0; then - AC_LIBOBJ([rawmemchr]) + gl_CONDITIONAL([GL_COND_OBJ_RAWMEMCHR], [test $HAVE_RAWMEMCHR = 0]) + AM_COND_IF([GL_COND_OBJ_RAWMEMCHR], [ gl_PREREQ_RAWMEMCHR - fi + ]) gl_STRING_MODULE_INDICATOR([rawmemchr]) gl_gnulib_enabled_rawmemchr=true fi @@ -889,10 +879,11 @@ AC_DEFUN([gl_INIT], { if ! $gl_gnulib_enabled_strtoll; then gl_FUNC_STRTOLL - if test $HAVE_STRTOLL = 0 || test $REPLACE_STRTOLL = 1; then - AC_LIBOBJ([strtoll]) + gl_CONDITIONAL([GL_COND_OBJ_STRTOLL], + [test $HAVE_STRTOLL = 0 || test $REPLACE_STRTOLL = 1]) + AM_COND_IF([GL_COND_OBJ_STRTOLL], [ gl_PREREQ_STRTOLL - fi + ]) gl_STDLIB_MODULE_INDICATOR([strtoll]) gl_gnulib_enabled_strtoll=true fi @@ -1035,16 +1026,28 @@ AC_DEFUN([gl_INIT], AC_CONFIG_COMMANDS_PRE([ gl_libobjs= gl_ltlibobjs= + gl_libobjdeps= if test -n "$gl_LIBOBJS"; then # Remove the extension. +changequote(,)dnl sed_drop_objext='s/\.o$//;s/\.obj$//' + sed_dirname1='s,//*,/,g' + sed_dirname2='s,\(.\)/$,\1,' + sed_dirname3='s,^[^/]*$,.,' + sed_dirname4='s,\(.\)/[^/]*$,\1,' + sed_basename1='s,.*/,,' +changequote([, ])dnl for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do gl_libobjs="$gl_libobjs $i.$ac_objext" gl_ltlibobjs="$gl_ltlibobjs $i.lo" + i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"` + i_base=`echo "$i" | sed -e "$sed_basename1"` + gl_libobjdeps="$gl_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po" done fi AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) + AC_SUBST([gl_LIBOBJDEPS], [$gl_libobjdeps]) ]) gltests_libdeps= gltests_ltlibdeps= @@ -1087,17 +1090,30 @@ changequote([, ])dnl AC_CONFIG_COMMANDS_PRE([ gltests_libobjs= gltests_ltlibobjs= + gltests_libobjdeps= if test -n "$gltests_LIBOBJS"; then # Remove the extension. +changequote(,)dnl sed_drop_objext='s/\.o$//;s/\.obj$//' + sed_dirname1='s,//*,/,g' + sed_dirname2='s,\(.\)/$,\1,' + sed_dirname3='s,^[^/]*$,.,' + sed_dirname4='s,\(.\)/[^/]*$,\1,' + sed_basename1='s,.*/,,' +changequote([, ])dnl for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do gltests_libobjs="$gltests_libobjs $i.$ac_objext" gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"` + i_base=`echo "$i" | sed -e "$sed_basename1"` + gltests_libobjdeps="$gltests_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po" done fi AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) + AC_SUBST([gltests_LIBOBJDEPS], [$gltests_libobjdeps]) ]) + AC_REQUIRE([gl_CC_GNULIB_WARNINGS]) LIBGNU_LIBDEPS="$gl_libdeps" AC_SUBST([LIBGNU_LIBDEPS]) LIBGNU_LTLIBDEPS="$gl_ltlibdeps" @@ -1330,6 +1346,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/stddef.in.h lib/stdint.in.h lib/stdio-impl.h + lib/stdio-read.c + lib/stdio-write.c lib/stdio.in.h lib/stdlib.in.h lib/stpcpy.c diff --git a/m4/libgmp.m4 b/m4/libgmp.m4 index a2dee93382..d69dcc7237 100644 --- a/m4/libgmp.m4 +++ b/m4/libgmp.m4 @@ -1,4 +1,4 @@ -# libgmp.m4 serial 6 +# libgmp.m4 serial 7 # Configure the GMP library or a replacement. dnl Copyright 2020-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation @@ -63,8 +63,8 @@ AC_DEFUN([gl_LIBGMP], else GL_GENERATE_GMP_H=true fi - AM_CONDITIONAL([GL_GENERATE_MINI_GMP_H], + gl_CONDITIONAL([GL_GENERATE_MINI_GMP_H], [test $HAVE_LIBGMP != yes]) - AM_CONDITIONAL([GL_GENERATE_GMP_GMP_H], + gl_CONDITIONAL([GL_GENERATE_GMP_GMP_H], [test $HAVE_LIBGMP = yes && test "$ac_cv_header_gmp_h" != yes]) ]) diff --git a/m4/mktime.m4 b/m4/mktime.m4 index d48f40d187..431b17dcb0 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,4 +1,4 @@ -# serial 36 +# serial 37 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2022 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -82,7 +82,8 @@ spring_forward_gap () instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ - putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + if (putenv ("TZ=PST8PDT,M4.1.0,M10.5.0") != 0) + return -1; tm.tm_year = 98; tm.tm_mon = 3; @@ -170,7 +171,8 @@ year_2050_test () instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ - putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + if (putenv ("TZ=PST8PDT,M4.1.0,M10.5.0") != 0) + return -1; t = mktime (&tm); @@ -181,6 +183,25 @@ year_2050_test () || (0 < t && answer - 120 <= t && t <= answer + 120)); } +static int +indiana_test () +{ + if (putenv ("TZ=America/Indiana/Indianapolis") != 0) + return -1; + struct tm tm; + tm.tm_year = 1986 - 1900; tm.tm_mon = 4 - 1; tm.tm_mday = 28; + tm.tm_hour = 16; tm.tm_min = 24; tm.tm_sec = 50; tm.tm_isdst = 0; + time_t std = mktime (&tm); + if (! (std == 515107490 || std == 515107503)) + return 1; + + /* This platform supports TZDB, either without or with leap seconds. + Return true if GNU Bug#48085 is absent. */ + tm.tm_isdst = 1; + time_t dst = mktime (&tm); + return std - dst == 60 * 60; +} + int main () { @@ -236,7 +257,7 @@ main () result |= 16; if (! spring_forward_gap ()) result |= 32; - if (! year_2050_test ()) + if (! year_2050_test () || ! indiana_test ()) result |= 64; return result; }]])], diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index cc80e77365..42e96071f8 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 57 +# stdio_h.m4 serial 59 dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -40,41 +40,32 @@ AC_DEFUN_ONCE([gl_STDIO_H], attribute "__gnu_printf__" instead of "__printf__"]) fi - dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" - dnl "expected source file, required through AC_LIBSOURCES, not found". It is - dnl also an optimization, to avoid performing a configure check whose result - dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING - dnl or GNULIB_NONBLOCKING redundant. + dnl This ifdef is an optimization, to avoid performing a configure check whose + dnl result is not used. But it does not make the test of + dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant. m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_STDIO_READ_FUNCS=1 - AC_LIBOBJ([stdio-read]) fi ]) - dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" - dnl "expected source file, required through AC_LIBSOURCES, not found". It is - dnl also an optimization, to avoid performing a configure check whose result - dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or - dnl GNULIB_SIGPIPE redundant. + dnl This ifdef is an optimization, to avoid performing a configure check whose + dnl result is not used. But it does not make the test of + dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant. m4_ifdef([gl_SIGNAL_SIGPIPE], [ gl_SIGNAL_SIGPIPE if test $gl_cv_header_signal_h_SIGPIPE != yes; then REPLACE_STDIO_WRITE_FUNCS=1 - AC_LIBOBJ([stdio-write]) fi ]) - dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" - dnl "expected source file, required through AC_LIBSOURCES, not found". It is - dnl also an optimization, to avoid performing a configure check whose result - dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING - dnl or GNULIB_NONBLOCKING redundant. + dnl This ifdef is an optimization, to avoid performing a configure check whose + dnl result is not used. But it does not make the test of + dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant. m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_STDIO_WRITE_FUNCS=1 - AC_LIBOBJ([stdio-write]) fi ]) diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index f93f97a1bd..4c66ccc0a4 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -222,6 +222,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) + REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE]) REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL]) commit 995aed477dc9be708920cc46442673126ed75760 Author: Paul Eggert Date: Wed Feb 23 10:52:27 2022 -0800 Port to current Gnulib * configure.ac (AM_COND_IF): New macro, needed because Gnulib normally assumes Automake and now uses this Automake macro. Problem reported by Lars Ingebrigtsen (Bug#32452#47). diff --git a/configure.ac b/configure.ac index 00711cccd5..a315eeb6bd 100644 --- a/configure.ac +++ b/configure.ac @@ -1201,6 +1201,8 @@ dnl Automake replacements. AC_DEFUN([AM_CONDITIONAL], [$2 && $1_CONDITION=1 || $1_CONDITION= AC_SUBST([$1_CONDITION])]) +AC_DEFUN([AM_COND_IF], + [AS_IF([test "$$1_CONDITION"], [$2], [$3])]) dnl Prefer silent make output. For verbose output, use dnl 'configure --disable-silent-rules' or 'make V=1' . commit 435d5c84ed200b24b0cd5b51fa77026e861eff3f Author: Juri Linkov Date: Wed Feb 23 19:58:33 2022 +0200 * lisp/tab-bar.el: Create new unique windows with 'C-x t n' (bug#54038). * lisp/tab-bar.el (tab-bar-new-tab-choice): Replace the value 'nil' with explicit 'clone'. (tab-bar-move-window-to-tab): Ignore possible side/atom window parameters with ignore-window-parameters while deleting window. (tab-bar-new-tab-to): When 'tab-bar-new-tab-choice' is 'clone', create new unique windows with the same layout using window-state-get and window-state-put. Do the same after deleting other windows when 'tab-bar-new-tab-choice' is 'window'. (tab-bar-duplicate-tab): Replace the value 'nil' with 'clone' for 'tab-bar-new-tab-choice'. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 0910502758..245a55a671 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -481,7 +481,7 @@ If the value is a string, use it as a buffer name to switch to if such buffer exists, or switch to a buffer visiting the file or directory that the string specifies. If the value is a function, call it with no arguments and switch to the buffer that it returns. -If nil, duplicate the contents of the tab that was active +If `clone', duplicate the contents of the tab that was active before calling the command that adds a new tab." :type '(choice (const :tag "Current buffer" t) (const :tag "Current window" window) @@ -489,7 +489,7 @@ before calling the command that adds a new tab." (directory :tag "Directory" :value "~/") (file :tag "File" :value "~/.emacs") (function :tag "Function") - (const :tag "Duplicate tab" nil)) + (const :tag "Duplicate tab" clone)) :group 'tab-bar :version "27.1") @@ -1318,7 +1318,8 @@ configuration." (let ((tab-bar-new-tab-choice 'window)) (tab-bar-new-tab)) (tab-bar-switch-to-recent-tab) - (delete-window) + (let ((ignore-window-parameters t)) + (delete-window)) (tab-bar-switch-to-recent-tab)) @@ -1367,14 +1368,20 @@ After the tab is created, the hooks in (select-window (minibuffer-selected-window))) ;; Remove window parameters that can cause problems ;; with `delete-other-windows' and `split-window'. - (set-window-parameter nil 'window-atom nil) - (set-window-parameter nil 'window-side nil) + (unless (eq tab-bar-new-tab-choice 'clone) + (set-window-parameter nil 'window-atom nil) + (set-window-parameter nil 'window-side nil)) (let ((ignore-window-parameters t)) - (delete-other-windows) - (unless (eq tab-bar-new-tab-choice 'window) - ;; Create a new window to get rid of old window parameters - ;; (e.g. prev/next buffers) of old window. - (split-window) (delete-window))) + (if (eq tab-bar-new-tab-choice 'clone) + ;; Create new unique windows with the same layout + (window-state-put (window-state-get)) + (delete-other-windows) + (if (eq tab-bar-new-tab-choice 'window) + ;; Create new unique window from remaining window + (window-state-put (window-state-get)) + ;; Create a new window to get rid of old window parameters + ;; (e.g. prev/next buffers) of old window. + (split-window) (delete-window)))) (let ((buffer (if (functionp tab-bar-new-tab-choice) @@ -1453,7 +1460,7 @@ If FROM-NUMBER is a tab number, a new tab is created from that tab." "Clone the current tab to ARG positions to the right. ARG and FROM-NUMBER have the same meaning as in `tab-bar-new-tab'." (interactive "P") - (let ((tab-bar-new-tab-choice nil) + (let ((tab-bar-new-tab-choice 'clone) (tab-bar-new-tab-group t)) (tab-bar-new-tab arg from-number))) commit 99ba8c03c8fac65c2497265c54e1bea49f7c6dd3 Author: Po Lu Date: Wed Feb 23 21:51:31 2022 +0800 Expand commentary in xterm.c * src/xterm.c: Expand commentary to include sections on optional features and toolkit support. diff --git a/src/xterm.c b/src/xterm.c index 4b463da5f8..1efab513e6 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -200,7 +200,143 @@ along with GNU Emacs. If not, see . */ `x_alloc_nearest_color_1', while the optimization for TrueColor visuals is in `x_make_truecolor_pixel'. Also see `x_query_colors`, which is used to determine the color values for given pixel - values. */ + values. + + OPTIONAL FEATURES + + While X servers and client libraries tend to come with many + extensions to the core X11R6 protocol, dependencies on anything + other than the core X11R6 protocol and Xlib should be optional at + both compile-time and runtime. Emacs should also not crash + regardless of what combination of X server and client-side features + are present. For example, if you are developing a feature that + will need Xfixes, then add a test in configure.ac for the library + at compile-time which defines `HAVE_XFIXES', like this: + + ### Use Xfixes (-lXfixes) if available + HAVE_XFIXES=no + if test "${HAVE_X11}" = "yes"; then + XFIXES_REQUIRED=4.0.0 + XFIXES_MODULES="xfixes >= $XFIXES_REQUIRED" + EMACS_CHECK_MODULES([XFIXES], [$XFIXES_MODULES]) + if test $HAVE_XFIXES = no; then + # Test old way in case pkg-config doesn't have it (older machines). + AC_CHECK_HEADER(X11/extensions/Xfixes.h, + [AC_CHECK_LIB(Xfixes, XFixesHideCursor, HAVE_XFIXES=yes)]) + if test $HAVE_XFIXES = yes; then + XFIXES_LIBS=-lXfixes + fi + fi + if test $HAVE_XFIXES = yes; then + AC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if you have the Xfixes extension.]) + fi + fi + AC_SUBST(XFIXES_CFLAGS) + AC_SUBST(XFIXES_LIBS) + + Then, make sure to adjust CFLAGS and LIBES in src/Makefile.in and + add the new XFIXES_CFLAGS and XFIXES_LIBS variables to + msdos/sed1v2.inp. (The latter has to be adjusted for any new + variables that are included in CFLAGS and LIBES even if the + libraries are not used by the MS-DOS port.) + + Finally, add some fields in `struct x_display_info' which specify + the major and minor versions of the extension, and whether or not to + support them. They (and their accessors) should be protected by the + `HAVE_XFIXES' preprocessor conditional. Then, these fields should + be set in `x_term_init', and all Xfixes calls must be protected by + not only the preprocessor conditional, but also by checks against + those variables. + + X TOOLKIT SUPPORT + + Emacs supports being built with many different toolkits (and also no + toolkit at all), which provide decorations such as menu bars and + scroll bars, along with handy features like file panels, dialog + boxes, font panels, and popup menus. Those configurations can + roughly be classified as belonging to one of three categories: + + - Using no toolkit at all. + - Using the X Toolkit Intrinstics (Xt). + - Using GTK. + + The no toolkit configuration is the simplest: no toolkit widgets are + used, Emacs uses its own implementation of scroll bars, and the + XMenu library that came with X11R2 and earlier versions of X is used + for popup menus. There is also no complicated window structure to + speak of. + + The Xt configurations come in either the Lucid or Motif flavors. + The former utilizes Emacs's own Xt-based Lucid widget library for + menus, and Xaw (or derivatives such as neXTaw and Xaw3d) for dialog + boxes and, optionally, scroll bars. It does not support file + panels. The latter uses either Motif or LessTif for menu bars, + popup menus, dialogs and file panels. + + The GTK configurations come in the GTK+ 2 or GTK 3 configurations, + where the toolkit provides all the aforementioned decorations and + features. They work mostly the same, though GTK 3 has various small + annoyances that complicate maintenance. + + All of those configurations have various special technicalities + about event handling and the layout of windows inside a frame that + must be kept in mind when writing X code which is run on all of + them. + + The no toolkit configuration has no noteworthy aspects about the + layout of windows inside a frame, since each frame has only one + associated window aside from scroll bars. However, in the Xt + configurations, every widget is a separate window, and there are + quite a few widgets. The "outer widget", a widget of class + ApplicationShell, is the top-level window of a frame. Its window is + accessed via the macro `FRAME_OUTER_WINDOW'. The "edit widget", a + widget class of EmacsFrame, is a child of the outer widget that + controls the size of a frame as known to Emacs, and is the widget + that Emacs draws to during display operations. The "menu bar + widget" is the widget holding the menu bar. + + Special care must be taken when performing operations on a frame. + Properties that are used by the window manager, for example, must be + set on the outer widget. Drawing, on the other hand, must be done + to the edit widget, and button press events on the menu bar widget + must be redirected and not sent to Xt until the Lisp code is run to + update the menu bar. + + The EmacsFrame widget is specific to Emacs and is implemented in + widget.c. See that file for more details. + + In the GTK configurations, GTK widgets do not necessarily correspond + to X windows, since the toolkit might decide to keep only a + client-side record of the widgets for performance reasons. + + Because the GtkFixed widget that holds the "edit area" never + corresponds to an X window, drawing operations are directly + performed on the outer window, with special care taken to not + overwrite the surrounding GTK widgets. This also means that the + only important window for most purposes is the outer window, which + on GTK builds can also be accessed using the macro + `FRAME_X_WINDOW'. + + How `handle_one_xevent' is called also depends on the configuration. + Without a toolkit, Emacs performs all event processing by itself, + running XPending and XNextEvent in a loop whenever there is input, + passing the event to `handle_one_xevent'. + + When using Xt, the same is performed, but `handle_one_xevent' may + also decide to call XtDispatchEvent on an event after Emacs finishes + processing it. + + When using GTK, however, `handle_one_xevent' is called from an event + filter installed on the GTK event loop. Unless the event filter + elects to drop the event, it will be passed to GTK right after + leaving the event filter. + + Fortunately, `handle_one_xevent' is provided a `*finish' parameter + that abstracts away all these details. If it is `X_EVENT_DROP', + then the event will not be dispatched to Xt or utilized by GTK. + Code inside `handle_one_xevent' should thus avoid making assumptions + about the event dispatch mechanism and use that parameter + instead. */ #include #include commit 85ad8616007e286c237bb2906d1928bb551462e7 Author: Eli Zaretskii Date: Wed Feb 23 15:07:59 2022 +0200 ; * src/xterm.c: Minor fixes of the commentary. diff --git a/src/xterm.c b/src/xterm.c index a3c3c6f3f4..4b463da5f8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -117,9 +117,10 @@ along with GNU Emacs. If not, see . */ background pixel values. Usually, one graphics context is computed for each face when it is - first about to be displayed, and this graphics context is the one - which is used for future X drawing operations in a glyph string - with that face. (See `prepare_face_for_display' in xfaces.c). + about to be displayed for the first time, and this graphics context + is the one which is used for future X drawing operations in a glyph + string with that face. (See `prepare_face_for_display' in + xfaces.c). However, when drawing glyph strings for special display elements such as the cursor, or mouse sensitive text, different GCs may be @@ -155,11 +156,11 @@ along with GNU Emacs. If not, see . */ onto the physical display. When the visual class is TrueColor, the colormap will be indexed - based on the red, green, and blue components of the pixel values, - and the colormap will be statically allocated as to contain linear - ramps for each component. As such, most of the color allocation - described below is bypassed, and the pixel values are computed - directly from the color. + based on the red, green, and blue (RGB) components of the pixel + values, and the colormap will be statically allocated so as to + contain linear ramps for each component. As such, most of the + color allocation described below is bypassed, and the pixel values + are computed directly from the color. Otherwise, each time Emacs wants a pixel value that corresponds to a color, Emacs has to ask the X server to obtain the pixel value commit b68217fe044c68c0ca73e43a3c1dee7fb73a9284 Author: Protesilaos Stavrou Date: Wed Feb 23 09:42:40 2022 +0200 Update modus-themes to version 2.2.0 * doc/misc/modus-themes.org (Enable and load) (Differences between loading and enabling): Clarify wording. (Customization Options): Update sample configuration. (Option for completion framework aesthetics): Refactor 'modus-themes-completions' to accept an alist value instead of a symbol. (Override colors): Elaborate on the example. (Toggle themes without reloading them): Document sample command that uses 'enable-theme' instead of 'load-theme'. (Acknowledgements): Update names of contributors to ideas. * etc/themes/modus-themes.el (modus-themes-operandi-colors) (modus-themes-vivendi-colors): Tweak the palette's completion-related background colors. (modus-themes-completion-standard-first-match) (modus-themes-completion-standard-selected) (modus-themes-completion-extra-selected): Deprecate faces and replace them with 'modus-themes-completion-selection'. (modus-themes-completion-key-binding): Rename it to 'modus-themes-key-binding'. (modus-themes-mode-line): Remove faulty default value. (modus-themes-completions): Refactor it to accept an alist value. (modus-themes-box-buttons): Fix typo. (modus-themes--standard-completions, modus-themes--extra-completions) (modus-themes--extra-completions-line): Remove outdated private functions. (modus-themes--completion): Add new private function. (modus-themes-faces): Update faces. * etc/themes/modus-operandi-theme.el: * etc/themes/modus-vivendi-theme.el: Bump file's version. For a detailed change log, read: . diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index a3bc468413..70f1e8bd1d 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org @@ -5,9 +5,9 @@ #+options: ':t toc:nil author:t email:t num:t #+startup: content -#+macro: stable-version 2.1.0 -#+macro: release-date 2022-02-17 -#+macro: development-version 2.2.0-dev +#+macro: stable-version 2.2.0 +#+macro: release-date 2022-02-23 +#+macro: development-version 2.3.0-dev #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ #+macro: space @@texinfo:@: @@ #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ @@ -260,9 +260,9 @@ a theme with either of the following expressions: Changes to the available customization options must always be evaluated before loading a theme ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). An exception to this norm is when using the various Custom interfaces or with commands like -{{{kbd(M-x customize-set-variable)}}}, which automatically reload the theme by -default ([[#h:9001527a-4e2c-43e0-98e8-3ef72d770639][Option for inhibiting theme reload]]). This is how a basic setup -could look like: +{{{kbd(M-x customize-set-variable)}}}, which can automatically reload +the theme ([[#h:9001527a-4e2c-43e0-98e8-3ef72d770639][Option for inhibiting theme reload]]). This is how a basic +setup could look like: #+begin_src emacs-lisp (require 'modus-themes) @@ -372,9 +372,9 @@ it might appear to the unsuspecting user that the themes are somehow broken whenever they try to assign a new value to a customization option or some face. -This "reset" that ~load-theme~ conducts does, however, come at the cost -of being somewhat slower than ~enable-theme~. Users who have a stable -setup and who seldom update their variables during a given Emacs +This "reset" that ~load-theme~ brings about does, however, come at the +cost of being somewhat slower than ~enable-theme~. Users who have a +stable setup and who seldom update their variables during a given Emacs session, are better off using something like this: #+begin_src emacs-lisp @@ -385,6 +385,8 @@ session, are better off using something like this: (enable-theme 'modus-operandi) ;; OR (enable-theme 'modus-vivendi) #+end_src +[[#h:b40aca50-a3b2-4c43-be58-2c26fcd14237][Toggle themes without reloading them]]. + [[#h:e979734c-a9e1-4373-9365-0f2cd36107b8][Sample configuration with and without use-package]]. With the above granted, other sections of the manual discuss how to @@ -472,7 +474,22 @@ this manual. ;; symbols: `background', `bold', `gray', `intense', `italic' modus-themes-prompts '(intense bold) - modus-themes-completions 'moderate ; {nil,'moderate,'opinionated,'super-opinionated} + ;; The `modus-themes-completions' is an alist that reads three + ;; keys: `matches', `selection', `popup'. Each accepts a nil + ;; value (or empty list) or a list of properties that can include + ;; any of the following (for WEIGHT read further below): + ;; + ;; `key' - `background', `intense', `underline', `italic', WEIGHT + ;; `selection' - `accented', `intense', `underline', `italic', WEIGHT + ;; `popup' - same as `selected' + ;; `t' - applies to any key not explicitly referenced (check docs) + ;; + ;; WEIGHT is a symbol such as `semibold', `light', or anything + ;; covered in `modus-themes-weights'. Bold is used in the absence + ;; of an explicit WEIGHT. + modus-themes-completions '((matches . (extrabold)) + (selection . (semibold accented)) + (popup . (accented intense))) modus-themes-mail-citations nil ; {nil,'intense,'faint,'monochrome} @@ -1058,53 +1075,103 @@ Centaur tabs package. ** Option for completion framework aesthetics :properties: :alt_title: Completion UIs -:description: Choose among standard, moderate, or opinionated looks +:description: Choose among several styles for completion UIs :custom_id: h:f1c20c02-7b34-4c35-9c65-99170efb2882 :end: #+vindex: modus-themes-completions Brief: Set the overall style of completion framework interfaces. -Symbol: ~modus-themes-completions~ (=choice= type) +Symbol: ~modus-themes-completions~ (=alist= type properties) -Possible values: +This affects Company, Corfu, Flx, Helm, Icomplete/Fido, Ido, Ivy, Mct, +Orderless, Selectrum, Vertico. The value is an alist that takes the +form of a =(key . properties)= combination. Here is a sample, followed +by a description of the particularities: -1. ~nil~ (default) -2. ~moderate~ -3. ~opinionated~ -4. ~super-opinionated~ - -This is a special option that has different effects depending on the -completion UI. The interfaces can be grouped in two categories, based -on their default aesthetics: (i) those that only or mostly use -foreground colors for their interaction model, and (ii) those that -combine background and foreground values for some of their metaphors. -The former category encompasses Icomplete, Ido, Selectrum, Vertico, Mct, -as well as pattern matching styles like Orderless and Flx. The latter -covers Helm and Ivy. - -A value of nil (the default) will simply respect the metaphors of each -completion framework. - -Option ~moderate~ applies a combination of background and foreground that -is fairly subtle. For Icomplete and friends this constitutes a -departure from their default aesthetics, however the difference is -small. While Helm and Ivy appear slightly different than their original -looks, as they are toned down a bit. - -Option ~opinionated~ uses color combinations that refashion the completion -UI. For the Icomplete camp this means that intense background and -foreground combinations are used: in effect their looks approximate -those of Helm and Ivy in their original style. Whereas the other group -of packages will revert to an even more nuanced aesthetic with some -additional changes to the choice of hues. - -Option ~super-opinionated~ is like the ~opinionated~ though it has a more -pronounced effect, especially on the color of the current -line/candidate. - -To appreciate the scope of this customization option, you should spend -some time with every one of those presets. +#+begin_src emacs-lisp +(setq modus-themes-completions + '((matches . (extrabold background intense)) + (selection . (semibold accented intense)) + (popup . (accented)))) +#+end_src + +The ~matches~ key refers to the highlighted characters that correspond +to the user's input. By default (nil or an empty list), they have a +bold weight and a colored foreground. The list of properties may +include any of the following symbols regardless of the order they may +appear in: + +- ~background~ to add a background color; + +- ~intense~ to increase the overall coloration (also amplifies + the ~background~, if present); + +- ~underline~ to draw a line below the characters; + +- ~italic~ to use a slanted font (italic or oblique forms); + +- The symbol of a font weight attribute such as ~light~, ~semibold~, et + cetera. Valid symbols are defined in the ~modus-themes-weights~ + variable. The absence of a weight means that bold will be used. + +The ~selection~ key applies to the current line or currently matched +candidate, depending on the specifics of the User Interface. By default +(nil or an empty list), it has a subtle gray background and a bold +weight. The list of properties it accepts is as follows (order is not +significant): + +- ~accented~ to make the background colorful instead of gray; + +- ~intense~ to increase the overall coloration; + +- ~underline~ to draw a line below the characters; + +- ~italic~ to use a slanted font (italic or oblique forms); + +- The symbol of a font weight attribute such as ~light~, ~semibold~, et + cetera. Valid symbols are defined in the ~modus-themes-weights~ + variable. The absence of a weight means that bold will be used. + +The ~popup~ key takes the same values as ~selection~. + +Apart from specfying each key separately, a fallback list is accepted. +This is only useful when the desired aesthetic is the same across all +keys that are not explicitly referenced. For example, this: + +#+begin_src emacs-lisp +(setq modus-themes-completions + '((t . (extrabold intense)))) +#+end_src + +Is the same as: + +#+begin_src emacs-lisp +(setq modus-themes-completions + '((matches . (extrabold intense)) + (selection . (extrabold intense)) + (popup . (extrabold intense)))) +#+end_src + +In the case of the fallback, any property that does not apply to the +corresponding key is simply ignored (~matches~ does not have ~accented~, +~selection~ and ~popup~ do not have ~background~). + +A concise expression of those associations can be written as follows, +where the ~car~ is always the key and the ~cdr~ is the list of +properties (whatever order they may appear in): + +#+begin_src emacs-lisp +(setq modus-themes-completions + '((matches extrabold background intense) + (selection semibold accented intense) + (popup accented))) +#+end_src + +[[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]]. + +Also refer to the Orderless documentation for its intersection with +Company (if you choose to use those in tandem). ** Option for mail citations :properties: @@ -2551,8 +2618,7 @@ both themes and expands to some more assosiations in the palette: (bg-header . "#ede3e0") (bg-tab-bar . "#dcd3d3") (bg-tab-active . "#fdf6eb") - (bg-tab-inactive . "#c8bab8") - (fg-unfocused . "#55556f")) + (bg-tab-inactive . "#c8bab8")) modus-themes-vivendi-color-overrides '((bg-main . "#100b17") (bg-dim . "#161129") @@ -2564,17 +2630,34 @@ both themes and expands to some more assosiations in the palette: (bg-header . "#202037") (bg-tab-bar . "#262b41") (bg-tab-active . "#120f18") - (bg-tab-inactive . "#3a3a5a") - (fg-unfocused . "#9a9aab"))) + (bg-tab-inactive . "#3a3a5a"))) (setq modus-themes-operandi-color-overrides nil modus-themes-vivendi-color-overrides nil))) #+end_src -With this in place, one can invoke {{{kbd(M-x my-modus-themes-tinted)}}} and -then load the Modus theme of their choice. The new palette subset will -come into effect: subtle ochre tints for Modus Operandi and night sky -shades for Modus Vivendi. Switching between the two themes, such as -with {{{kbd(M-x modus-themes-toggle)}}} will also use the overrides. +A more neutral style for ~modus-themes-operandi-color-overrides~ can +look like this: + +#+begin_src emacs-lisp +'((bg-main . "#f7f7f7") + (bg-dim . "#f2f2f2") + (bg-alt . "#e8e8e8") + (bg-hl-line . "#eaeaef") + (bg-active . "#e0e0e0") + (bg-inactive . "#e6e6e6") + (bg-region . "#b5b5b5") + (bg-header . "#e4e4e4") + (bg-tab-bar . "#d1d1d4") + (bg-tab-active . "#f5f5f5") + (bg-tab-inactive . "#c0c0c0")) +#+end_src + +With those in place, one can use {{{kbd(M-x my-modus-themes-tinted)}}} +and then load the Modus theme of their choice. The new palette subset +will come into effect: subtle ochre tints (or shades of gray) for Modus +Operandi and night sky blue shades for Modus Vivendi. Switching between +the two themes, such as with {{{kbd(M-x modus-themes-toggle)}}} will +also use the overrides. Given that this is a user-level customisation, one is free to implement whatever color values they desire, even if the possible combinations @@ -3465,6 +3548,35 @@ to be specified as well: (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) #+end_src +** Toggle themes without reloading them +:properties: +:custom_id: h:b40aca50-a3b2-4c43-be58-2c26fcd14237 +:end: +#+cindex: Switch themes without load-theme + +Users who have a stable setup and who only ever need to toggle between +the themes without triggering a full reload, are better off defining +their own command which calls ~enable-theme~ instead of ~load-theme~: + +#+begin_src emacs-lisp +(defun my-modus-themes-toggle () + "Toggle between `modus-operandi' and `modus-vivendi' themes. +This uses `enable-theme' instead of the standard method of +`load-theme'. The technicalities are covered in the Modus themes +manual." + (interactive) + (pcase (modus-themes--current-theme) + ('modus-operandi (progn (enable-theme 'modus-vivendi) + (disable-theme 'modus-operandi))) + ('modus-vivendi (progn (enable-theme 'modus-operandi) + (disable-theme 'modus-vivendi))) + (_ (error "No Modus theme is loaded; evaluate `modus-themes-load-themes' first")))) +#+end_src + +[[#h:e68560b3-7fb0-42bc-a151-e015948f8a35][Differences between loading and enabling]]. + +Recall that ~modus-themes-toggle~ uses ~load-theme~. + ** A theme-agnostic hook for theme loading :properties: :custom_id: h:86f6906b-f090-46cc-9816-1fe8aeb38776 @@ -5173,25 +5285,26 @@ The Modus themes are a collective effort. Every bit of work matters. + Ideas and user feedback :: Aaron Jensen, Adam Porter, Adam Spiers, Adrian Manea, Alex Griffin, Alex Koen, Alex Peitsinis, Alexey Shmalko, Alok Singh, Anders Johansson, André Alexandre Gomes, Arif Rezai, Basil - L.{{{space()}}} Contovounesios, Burgess Chang, Christian Tietze, Christopher - Dimech, Damien Cassou, Daniel Mendler, Dario Gjorgjevski, David - Edmondson, Davor Rotim, Divan Santana, Eliraz Kedmi, Emanuele Michele - Alberto Monterosso, Farasha Euker, Feng Shu, Gautier Ponsinet, Gerry - Agbobada, Gianluca Recchia, Guilherme Semente, Gustavo Barros, + L.{{{space()}}} Contovounesios, Burgess Chang, Christian Tietze, + Christopher Dimech, Damien Cassou, Daniel Mendler, Dario Gjorgjevski, + David Edmondson, Davor Rotim, Divan Santana, Eliraz Kedmi, Emanuele + Michele Alberto Monterosso, Farasha Euker, Feng Shu, Gautier Ponsinet, + Gerry Agbobada, Gianluca Recchia, Guilherme Semente, Gustavo Barros, Hörmetjan Yiltiz, Ilja Kocken, Iris Garcia, Jeremy Friesen, Jerry - Zhang, Johannes Grødem, John Haman, Joshua O'Connor, Kevin Fleming, - Kévin Le Gouguec, Kostadin Ninev, Len Trigg, Magne Hov, Manuel Uberti, - Mark Bestley, Mark Burton, Markus Beppler, Mauro Aranda, Michael - Goldenberg, Morgan Smith, Murilo Pereira, Nicky van Foreest, Nicolas - De Jaeghere, Paul Poloskov, Pengji Zhang, Pete Kazmier, Peter Wu, - Philip Kaludercic, Pierre Téchoueyres, Roman Rudakov, Ryan Phillips, - Rudolf Adamkovič, Sam Kleinman, Samuel Culpepper, Saša Janiška, - Shreyas Ragavan, Simon Pugnet, Tassilo Horn, Thibaut Verron, Thomas - Heartman, Togan Muftuoglu, Trey Merkley, Tomasz Hołubowicz, Toon - Claes, Uri Sharf, Utkarsh Singh, Vincent Foley. As well as users: - Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, Fredrik, - Moesasji, Nick, TheBlob42, Trey, bepolymathe, bit9tream, derek-upham, - doolio, fleimgruber, gitrj95, iSeeU, jixiuf, okamsn, pRot0ta1p. + Zhang, Johannes Grødem, John Haman, Joshua O'Connor, Kenta Usami, + Kevin Fleming, Kévin Le Gouguec, Kostadin Ninev, Len Trigg, Magne Hov, + Manuel Uberti, Mark Bestley, Mark Burton, Markus Beppler, Mauro + Aranda, Michael Goldenberg, Morgan Smith, Murilo Pereira, Nicky van + Foreest, Nicolas De Jaeghere, Paul Poloskov, Pengji Zhang, Pete + Kazmier, Peter Wu, Philip Kaludercic, Pierre Téchoueyres, Roman + Rudakov, Ryan Phillips, Rudolf Adamkovič, Sam Kleinman, Samuel + Culpepper, Saša Janiška, Shreyas Ragavan, Simon Pugnet, Tassilo Horn, + Thibaut Verron, Thomas Heartman, Togan Muftuoglu, Trey Merkley, Tomasz + Hołubowicz, Toon Claes, Uri Sharf, Utkarsh Singh, Vincent Foley. As + well as users: Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, + Fredrik, Moesasji, Nick, TheBlob42, Trey, bepolymathe, bit9tream, + derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, okamsn, + pRot0ta1p. + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, Glenn Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core Emacs), diff --git a/etc/themes/modus-operandi-theme.el b/etc/themes/modus-operandi-theme.el index aac5b04c6a..f71962e3f1 100644 --- a/etc/themes/modus-operandi-theme.el +++ b/etc/themes/modus-operandi-theme.el @@ -4,7 +4,7 @@ ;; Author: Protesilaos Stavrou ;; URL: https://gitlab.com/protesilaos/modus-themes -;; Version: 2.1.0 +;; Version: 2.2.0 ;; Package-Requires: ((emacs "27.1")) ;; Keywords: faces, theme, accessibility diff --git a/etc/themes/modus-themes.el b/etc/themes/modus-themes.el index a902cc8ca2..067fc22ee4 100644 --- a/etc/themes/modus-themes.el +++ b/etc/themes/modus-themes.el @@ -4,8 +4,8 @@ ;; Author: Protesilaos Stavrou ;; URL: https://gitlab.com/protesilaos/modus-themes -;; Version: 2.1.0 -;; Last-Modified: <2022-02-17 10:36:27 +0200> +;; Version: 2.2.0 +;; Last-Modified: <2022-02-23 08:56:46 +0200> ;; Package-Requires: ((emacs "27.1")) ;; Keywords: faces, theme, accessibility @@ -35,6 +35,7 @@ ;; ;; The themes share the following customization variables: ;; +;; modus-themes-completions (alist) ;; modus-themes-headings (alist) ;; modus-themes-org-agenda (alist) ;; modus-themes-bold-constructs (boolean) @@ -45,7 +46,6 @@ ;; modus-themes-subtle-line-numbers (boolean) ;; modus-themes-variable-pitch-ui (boolean) ;; modus-themes-box-buttons (choice) -;; modus-themes-completions (choice) ;; modus-themes-diffs (choice) ;; modus-themes-fringes (choice) ;; modus-themes-hl-line (choice) @@ -586,9 +586,8 @@ cover the blue-cyan-magenta side of the spectrum." (bg-region-accent . "#afafef") (bg-region-accent-subtle . "#efdfff") - (bg-completion-nuanced . "#dfe5ff") - (bg-completion-subtle . "#c3d4ff") - (bg-completion-intense . "#9fc8ff") + (bg-completion . "#b7dbff") + (bg-completion-subtle . "#def3ff") (bg-tab-active . "#f6f6f6") (bg-tab-inactive . "#b7b7b7") @@ -833,9 +832,8 @@ symbol and the latter as a string.") (bg-region-accent . "#4f3d88") (bg-region-accent-subtle . "#240f55") - (bg-completion-nuanced . "#1a2854") - (bg-completion-subtle . "#282878") - (bg-completion-intense . "#323da2") + (bg-completion . "#142f69") + (bg-completion-subtle . "#0e194b") (bg-tab-active . "#0e0e0e") (bg-tab-inactive . "#424242") @@ -1611,23 +1609,53 @@ The actual styling of the face is done by `modus-themes-faces'." The actual styling of the face is done by `modus-themes-faces'." :group 'modus-themes-faces) -(defface modus-themes-completion-standard-first-match nil - "Face for the Icomplete/Ido style first match. +(define-obsolete-face-alias + 'modus-themes-completion-standard-first-match + 'modus-themes-completion-selection + "2.2.0") + +(define-obsolete-face-alias + 'modus-themes-completion-standard-selected + 'modus-themes-completion-selection + "2.2.0") + +(define-obsolete-face-alias + 'modus-themes-completion-extra-selected + 'modus-themes-completion-selection + "2.2.0") + +(define-obsolete-face-alias + 'modus-themes-completion-key-binding + 'modus-themes-key-binding + "2.2.0") + +(defface modus-themes-completion-selected nil + "Face for current selection in completion UIs. +The actual styling of the face is done by `modus-themes-faces'." + :group 'modus-themes-faces) + +(defface modus-themes-completion-selected-popup nil + "Face for current selection in completion UI popups. +The actual styling of the face is done by `modus-themes-faces'." + :group 'modus-themes-faces) + +(defface modus-themes-completion-match-0 nil + "Face for completions matches 0. The actual styling of the face is done by `modus-themes-faces'." :group 'modus-themes-faces) -(defface modus-themes-completion-standard-selected nil - "Face for the standard completion UI current selection. +(defface modus-themes-completion-match-1 nil + "Face for completions matches 1. The actual styling of the face is done by `modus-themes-faces'." :group 'modus-themes-faces) -(defface modus-themes-completion-extra-selected nil - "Face for the extra completion UI current selection. +(defface modus-themes-completion-match-2 nil + "Face for completions matches 2. The actual styling of the face is done by `modus-themes-faces'." :group 'modus-themes-faces) -(defface modus-themes-completion-key-binding nil - "Face for key bindings in a completion UI context. +(defface modus-themes-completion-match-3 nil + "Face for completions matches 3. The actual styling of the face is done by `modus-themes-faces'." :group 'modus-themes-faces) @@ -2414,7 +2442,7 @@ instead of a box style, it is strongly advised to set (const :tag "No box effects (Moody-compatible)" moody)) (const :tag "Colored background" accented) (const :tag "Without border color" borderless) - (natnum :tag "With extra padding" :value 6)) + (natnum :tag "With extra padding")) :set #'modus-themes--set-option :initialize #'custom-initialize-default :link '(info-link "(modus-themes) Mode line")) @@ -2462,50 +2490,153 @@ interest of optimizing for such a use-case." :link '(info-link "(modus-themes) Diffs")) (defcustom modus-themes-completions nil - "Control the style of the completion framework's interface. - -This is a special option that has different effects depending on -the completion UI. The interfaces can be grouped in two -categories, based on their default aesthetics: (i) those that -only or mostly use foreground colors for their interaction model, -and (ii) those that combine background and foreground values for -some of their metaphors. The former category encompasses -Icomplete, Ido, Selectrum, Vertico, Mct, as well as pattern -matching styles like Orderless and Flx. The latter covers Helm -and Ivy. - -A value of nil (the default) will simply respect the metaphors of -each completion framework. - -Option `moderate' applies a combination of background and -foreground that is fairly subtle. For Icomplete and friends this -constitutes a departure from their default aesthetics, however -the difference is small. While Helm and Ivy appear slightly -different than their original looks, as they are toned down a -bit. - -Option `opinionated' uses color combinations that refashion the -completion UI. For the Icomplete camp this means that intense -background and foreground combinations are used: in effect their -looks approximate those of Helm and Ivy in their original style. -Whereas the other group of packages will revert to an even more -nuanced aesthetic with some additional changes to the choice of -hues. - -Option `super-opinionated' is like the `opinionated' though it -has a more pronounced effect, especially on the color of the -current line/candidate. - -To appreciate the scope of this customization option, you should -spend some time with each of those presets." + "Control the style of completion user interfaces. + +This affects Company, Corfu, Flx, Helm, Icomplete/Fido, Ido, Ivy, +Mct, Orderless, Selectrum, Vertico. The value is an alist that +takes the form of a (key . properties) combination. Here is a +sample, followed by a description of the particularities: + + (setq modus-themes-completions + (quote ((matches . (extrabold background intense)) + (selection . (semibold accented intense)) + (popup . (accented))))) + +The `matches' key refers to the highlighted characters that +correspond to the user's input. By default (nil or an empty +list), they have a bold weight and a colored foreground. The +list of properties may include any of the following symbols +regardless of the order they may appear in: + +- `background' to add a background color; + +- `intense' to increase the overall coloration (also amplifies + the `background', if present); + +- `underline' to draw a line below the characters; + +- `italic' to use a slanted font (italic or oblique forms); + +- The symbol of a font weight attribute such as `light', + `semibold', et cetera. Valid symbols are defined in the + variable `modus-themes-weights'. The absence of a weight means + that bold will be used. + +The `selection' key applies to the current line or currently +matched candidate, depending on the specifics of the User +Interface. By default (nil or an empty list), it has a subtle +gray background and a bold weight. The list of properties it +accepts is as follows (order is not significant): + +- `accented' to make the background colorful instead of gray; + +- `intense' to increase the overall coloration; + +- `underline' to draw a line below the characters; + +- `italic' to use a slanted font (italic or oblique forms); + +- The symbol of a font weight attribute such as `light', + `semibold', et cetera. Valid symbols are defined in the + variable `modus-themes-weights'. The absence of a weight means + that bold will be used. + +The `popup' key takes the same values as `selection'. + +Apart from specfying each key separately, a fallback list is +accepted. This is only useful when the desired aesthetic is the +same across all keys that are not explicitly referenced. For +example, this: + + (setq modus-themes-completions + (quote ((t . (extrabold intense))))) + +Is the same as: + + (setq modus-themes-completions + (quote ((matches . (extrabold intense)) + (selection . (extrabold intense)) + (popup . (extrabold intense))))) + +In the case of the fallback, any property that does not apply to +the corresponding key is simply ignored (`matches' does not have +`accented', `selection' and `popup' do not have `background'). + +A concise expression of those associations can be written as +follows, where the `car' is always the key and the `cdr' is the +list of properties (whatever order they may appear in): + + (setq modus-themes-completions + (quote ((matches extrabold background intense) + (selection semibold accented intense) + (popup accented)))) + +Check the manual for tweaking `bold' and `italic' faces: Info +node `(modus-themes) Configure bold and italic faces'. + +Also refer to the Orderless documentation for its intersection +with Company (if you choose to use those in tandem)." :group 'modus-themes - :package-version '(modus-themes . "2.1.0") + :package-version '(modus-themes . "2.2.0") :version "29.1" - :type '(choice - (const :format "[%v] %t\n" :tag "Respect the framework's established aesthetic (default)" nil) - (const :format "[%v] %t\n" :tag "Subtle backgrounds for various elements" moderate) - (const :format "[%v] %t\n" :tag "Alternative to the framework's looks" opinionated) - (const :format "[%v] %t\n" :tag "Radical alternative to the framework's looks" super-opinionated)) + :type `(set + (cons :tag "Matches" + (const matches) + (set :tag "Style of matches" :greedy t + (choice :tag "Font weight (must be supported by the typeface)" + (const :tag "Bold (default)" nil) + (const :tag "Thin" thin) + (const :tag "Ultra-light" ultralight) + (const :tag "Extra-light" extralight) + (const :tag "Light" light) + (const :tag "Semi-light" semilight) + (const :tag "Regular" regular) + (const :tag "Medium" medium) + (const :tag "Semi-bold" semibold) + (const :tag "Extra-bold" extrabold) + (const :tag "Ultra-bold" ultrabold)) + (const :tag "With added background" background) + (const :tag "Increased coloration" intense) + (const :tag "Italic font (oblique or slanted forms)" italic) + (const :tag "Underline" underline))) + (cons :tag "Selection" + (const selection) + (set :tag "Style of selection" :greedy t + (choice :tag "Font weight (must be supported by the typeface)" + (const :tag "Bold (default)" nil) + (const :tag "Thin" thin) + (const :tag "Ultra-light" ultralight) + (const :tag "Extra-light" extralight) + (const :tag "Light" light) + (const :tag "Semi-light" semilight) + (const :tag "Regular" regular) + (const :tag "Medium" medium) + (const :tag "Semi-bold" semibold) + (const :tag "Extra-bold" extrabold) + (const :tag "Ultra-bold" ultrabold)) + (const :tag "With accented background" accented) + (const :tag "Increased coloration" intense) + (const :tag "Italic font (oblique or slanted forms)" italic) + (const :tag "Underline" underline))) + (cons :tag "Popup" + (const popup) + (set :tag "Style of completion pop-ups" :greedy t + (choice :tag "Font weight (must be supported by the typeface)" + (const :tag "Bold (default)" nil) + (const :tag "Thin" thin) + (const :tag "Ultra-light" ultralight) + (const :tag "Extra-light" extralight) + (const :tag "Light" light) + (const :tag "Semi-light" semilight) + (const :tag "Regular" regular) + (const :tag "Medium" medium) + (const :tag "Semi-bold" semibold) + (const :tag "Extra-bold" extrabold) + (const :tag "Ultra-bold" ultrabold)) + (const :tag "With accented background" accented) + (const :tag "Increased coloration" intense) + (const :tag "Italic font (oblique or slanted forms)" italic) + (const :tag "Underline" underline)))) :set #'modus-themes--set-option :initialize #'custom-initialize-default :link '(info-link "(modus-themes) Completion UIs")) @@ -2999,7 +3130,7 @@ In user configuration files the form may look like this: (const :tag "Extra-light" extralight) (const :tag "Light" light) (const :tag "Semi-light" semilight) - (const :tag "Regulat (default)" nil) + (const :tag "Regular (default)" nil) (const :tag "Medium" medium) (const :tag "Bold" bold) (const :tag "Semi-bold" semibold) @@ -3676,47 +3807,61 @@ unspecified." (list deuteran) (list main))) -(defun modus-themes--standard-completions (mainfg subtlebg subtlefg intensebg intensefg &optional superbg superfg) - "Combinations for `modus-themes-completions'. - -MAINFG is an accented foreground value. SUBTLEBG is an accented -background value that can be combined with SUBTLEFG. INTENSEBG -and INTENSEFG are accented colors that are designed to be used in -tandem. Same principle for the optional SUPERBG and SUPERFG. - -These are intended for Icomplete, Ido, and related." - (pcase modus-themes-completions - ('super-opinionated (list :background (or superbg intensebg) :foreground (or superfg intensefg))) - ('opinionated (list :background intensebg :foreground intensefg)) - ('moderate (list :background subtlebg :foreground subtlefg)) - (_ (list :foreground mainfg)))) - -(defun modus-themes--extra-completions (default moderate opinionated) - "Combinations for `modus-themes-completions'. - -DEFAULT, MODERATE, and OPINIONATED are faces that correspond to -the stylistic variants of the aforementioned user option. - -These are intended for Ivy and Helm." - (pcase modus-themes-completions - ('super-opinionated (list :inherit (list 'bold opinionated))) - ('opinionated (list :inherit (list 'bold opinionated))) - ('moderate (list :inherit (list 'bold moderate))) - (_ (list :inherit (list 'bold default))))) - -(defun modus-themes--extra-completions-line (mainfg mainbg modbg opbg sopbg) - "Combinations for `modus-themes-completions'. - -MAINFG and MAINBG form the basic intense style. MODBG, OPBG, and -SOPBG are the moderate, opinionated, and super-opinionated -backgrounds, respectively. - -These are intended for Ivy and Helm." - (pcase modus-themes-completions - ('super-opinionated (list :inherit 'bold :background sopbg :foreground mainfg)) - ('opinionated (list :inherit 'bold :background opbg :foreground mainfg)) - ('moderate (list :inherit 'bold :background modbg :foreground mainfg)) - (_ (list :inherit 'bold :background mainbg :foreground mainfg)))) +(defun modus-themes--completion (key bg fg bgintense fgintense &optional bgaccent bgaccentintense) + "Styles for `modus-themes-completions'. +KEY is the key of a cons cell. BG and FG are the main colors. +BGINTENSE works with the main foreground. FGINTENSE works on its +own. BGACCENT and BGACCENTINTENSE are colorful variants of the +other backgrounds." + (let* ((var (if (listp modus-themes-completions) + modus-themes-completions + (prog1 nil + (warn (concat "`modus-themes-completions' has changed." + "\n" + "Its value must now be an alist." + "\n" + "Please read the updated doc string."))))) + (properties (or (alist-get key var) (alist-get t var))) + (popup (eq key 'popup)) + (selection (eq key 'selection)) + (line (or popup selection)) + (background (or line (memq 'background properties))) + (base-fg (if selection fg 'unspecified)) + (accented (memq 'accented properties)) + (intense (memq 'intense properties)) + (italic (memq 'italic properties)) + (weight (modus-themes--weight properties)) + (bold (when (and weight (eq weight 'bold)) 'bold))) + (list + :inherit + (cond + ((and italic weight (not (eq weight 'bold))) + 'italic) + ((and weight (not (eq weight 'bold))) + 'unspecified) + (italic 'bold-italic) + ('bold)) + :background + (cond + ((and accented intense line) + bgaccentintense) + ((and accented line) + bgaccent) + ((and background intense) + bgintense) + (background bg) + ('unspecified)) + :foreground + (cond + ((and background intense) + base-fg) + (background fg) + (intense fgintense) + (fg)) + :underline + (if (memq 'underline properties) t 'unspecified) + :weight + (if (and weight (null bold)) weight 'unspecified)))) (defun modus-themes--link (fg fgfaint underline bg bgneutral) "Conditional application of link styles. @@ -4359,27 +4504,32 @@ by virtue of calling either of `modus-themes-load-operandi' and `(modus-themes-tab-backdrop ((,class ,@(modus-themes--tab bg-active bg-active-accent nil nil nil nil t)))) `(modus-themes-tab-inactive ((,class ,@(modus-themes--tab bg-tab-inactive bg-tab-inactive-accent fg-dim nil t)))) ;;;;; completion frameworks - `(modus-themes-completion-standard-first-match - ((,class :inherit bold - ,@(modus-themes--standard-completions - magenta bg-alt magenta-alt - bg-active fg-main - blue-intense-bg)))) - `(modus-themes-completion-standard-selected - ((,class :inherit bold :foreground ,fg-main - :background ,@(pcase modus-themes-completions - ('super-opinionated (list bg-completion-intense)) - ('opinionated (list bg-active)) - ('moderate (list bg-completion-nuanced)) - (_ (list bg-inactive)))))) - `(modus-themes-completion-extra-selected - ((,class ,@(modus-themes--extra-completions-line - fg-main bg-completion-intense bg-completion-subtle - bg-completion-nuanced bg-active)))) - `(modus-themes-completion-key-binding - ((,class ,@(if (null modus-themes-completions) - (list :foreground magenta-alt-other) - (list :inherit 'modus-themes-key-binding))))) + `(modus-themes-completion-match-0 + ((,class ,@(modus-themes--completion + 'matches bg-special-faint-calm magenta-alt + magenta-subtle-bg magenta-intense)))) + `(modus-themes-completion-match-1 + ((,class ,@(modus-themes--completion + 'matches bg-special-faint-cold cyan + cyan-subtle-bg cyan-intense)))) + `(modus-themes-completion-match-2 + ((,class ,@(modus-themes--completion + 'matches bg-special-faint-mild green + green-subtle-bg green-intense)))) + `(modus-themes-completion-match-3 + ((,class ,@(modus-themes--completion + 'matches bg-special-faint-warm yellow + yellow-subtle-bg orange-intense)))) + `(modus-themes-completion-selected + ((,class ,@(modus-themes--completion + 'selection bg-inactive 'unspecified + bg-active 'unspecified + bg-completion-subtle bg-completion)))) + `(modus-themes-completion-selected-popup + ((,class ,@(modus-themes--completion + 'popup bg-active 'unspecified + bg-region 'unspecified + cyan-subtle-bg cyan-refine-bg)))) ;;;;; buttons `(modus-themes-box-button ((,class ,@(modus-themes--button bg-active bg-main bg-active-accent @@ -4771,23 +4921,21 @@ by virtue of calling either of `modus-themes-load-operandi' and ;;;;; column-enforce-mode `(column-enforce-face ((,class :inherit modus-themes-refine-yellow))) ;;;;; company-mode - `(company-echo-common ((,class :foreground ,magenta-alt-other))) + `(company-echo-common ((,class :inherit modus-themes-completion-match-0))) `(company-preview ((,class :background ,bg-dim :foreground ,fg-dim))) - `(company-preview-common ((,class :foreground ,blue-alt))) + `(company-preview-common ((,class :inherit company-echo-common))) `(company-preview-search ((,class :inherit modus-themes-special-calm))) `(company-template-field ((,class :inherit modus-themes-intense-magenta))) `(company-tooltip ((,class :background ,bg-alt :foreground ,fg-alt))) - `(company-tooltip-annotation ((,class :inherit modus-themes-slant :foreground ,fg-special-cold))) - `(company-tooltip-annotation-selection ((,class :inherit bold :foreground ,fg-main))) - `(company-tooltip-common ((,class :inherit bold :foreground ,blue-alt))) - `(company-tooltip-common-selection ((,class :foreground ,fg-main))) + `(company-tooltip-annotation ((,class :inherit completions-annotations))) + `(company-tooltip-common ((,class :inherit company-echo-common))) `(company-tooltip-deprecated ((,class :inherit company-tooltip :strike-through t))) - `(company-tooltip-mouse ((,class :inherit modus-themes-intense-blue))) + `(company-tooltip-mouse ((,class :inherit highlight))) `(company-tooltip-scrollbar-thumb ((,class :background ,fg-active))) `(company-tooltip-scrollbar-track ((,class :background ,bg-active))) `(company-tooltip-search ((,class :inherit (modus-themes-search-success-lazy bold)))) `(company-tooltip-search-selection ((,class :inherit (modus-themes-search-success bold) :underline t))) - `(company-tooltip-selection ((,class :inherit (modus-themes-subtle-cyan bold)))) + `(company-tooltip-selection ((,class :inherit modus-themes-completion-selected-popup))) ;;;;; company-posframe `(company-posframe-active-backend-name ((,class :inherit bold :background ,bg-active :foreground ,blue-active))) `(company-posframe-inactive-backend-name ((,class :background ,bg-active :foreground ,fg-active))) @@ -4803,13 +4951,8 @@ by virtue of calling either of `modus-themes-load-operandi' and `(compilation-warning ((,class :inherit modus-themes-bold :foreground ,yellow-alt))) ;;;;; completions `(completions-annotations ((,class :inherit modus-themes-slant :foreground ,cyan-faint))) - `(completions-common-part ((,class ,@(modus-themes--standard-completions - blue-alt bg-special-mild fg-special-mild - cyan-refine-bg cyan-refine-fg)))) - `(completions-first-difference ((,class :inherit bold - ,@(modus-themes--standard-completions - magenta-alt bg-special-calm fg-special-calm - magenta-intense-bg fg-main)))) + `(completions-common-part ((,class :inherit modus-themes-completion-match-0))) + `(completions-first-difference ((,class :inherit modus-themes-completion-match-1))) ;;;;; consult `(consult-async-running ((,class :inherit bold :foreground ,blue))) `(consult-async-split ((,class :foreground ,magenta-alt))) @@ -4824,7 +4967,7 @@ by virtue of calling either of `modus-themes-load-operandi' and `(consult-preview-error ((,class :inherit modus-themes-intense-red))) `(consult-preview-line ((,class :background ,bg-hl-alt-intense))) ;;;;; corfu - `(corfu-current ((,class :inherit bold :background ,cyan-subtle-bg))) + `(corfu-current ((,class :inherit modus-themes-completion-selected-popup))) `(corfu-bar ((,class :background ,fg-alt))) `(corfu-border ((,class :background ,bg-active))) `(corfu-default ((,class :background ,bg-alt))) @@ -4887,6 +5030,7 @@ by virtue of calling either of `modus-themes-load-operandi' and `(custom-set ((,class :foreground ,blue-alt))) `(custom-state ((,class :foreground ,red-alt-faint))) `(custom-themed ((,class :inherit modus-themes-subtle-blue))) + `(custom-variable-obsolete ((,class :inherit shadow))) `(custom-variable-tag ((,class :foreground ,cyan))) ;;;;; dap-mode `(dap-mouse-eval-thing-face ((,class :box (:line-width -1 :color ,blue-active :style nil) @@ -5196,7 +5340,7 @@ by virtue of calling either of `modus-themes-load-operandi' and `(elpher-gemini-heading2 ((,class :inherit modus-themes-heading-2))) `(elpher-gemini-heading3 ((,class :inherit modus-themes-heading-3))) ;;;;; embark - `(embark-keybinding ((,class :inherit modus-themes-completion-key-binding))) + `(embark-keybinding ((,class :inherit modus-themes-key-binding))) ;;;;; ement (ement.el) `(ement-room-fully-read-marker ((,class :background ,cyan-subtle-bg))) `(ement-room-membership ((,class :inherit shadow))) @@ -5440,10 +5584,7 @@ by virtue of calling either of `modus-themes-load-operandi' and `(flyspell-duplicate ((,class :inherit modus-themes-lang-warning))) `(flyspell-incorrect ((,class :inherit modus-themes-lang-error))) ;;;;; flx - `(flx-highlight-face ((,class ,@(modus-themes--extra-completions - 'modus-themes-intense-magenta - 'modus-themes-subtle-magenta - 'modus-themes-special-calm)))) + `(flx-highlight-face ((,class :inherit modus-themes-completion-match-0))) ;;;;; freeze-it `(freeze-it-show ((,class :background ,bg-dim :foreground ,fg-special-warm))) ;;;;; frog-menu @@ -5695,10 +5836,7 @@ by virtue of calling either of `modus-themes-load-operandi' and `(helm-eshell-prompts-promptidx ((,class :foreground ,cyan-active))) `(helm-etags-file ((,class :foreground ,fg-dim :underline t))) `(helm-ff-backup-file ((,class :inherit shadow))) - `(helm-ff-denied ((,class ,@(modus-themes--extra-completions - 'modus-themes-intense-red - 'modus-themes-subtle-red - 'modus-themes-special-warm)))) + `(helm-ff-denied ((,class :inherit modus-themes-intense-red))) `(helm-ff-directory ((,class :inherit helm-buffer-directory))) `(helm-ff-dirs ((,class :inherit bold :foreground ,blue-alt-other))) `(helm-ff-dotted-directory ((,class :inherit bold :background ,bg-alt :foreground ,fg-alt))) @@ -5707,59 +5845,35 @@ by virtue of calling either of `modus-themes-load-operandi' and `(helm-ff-file ((,class :foreground ,fg-main))) `(helm-ff-file-extension ((,class :foreground ,fg-special-warm))) `(helm-ff-invalid-symlink ((,class :inherit modus-themes-link-broken))) - `(helm-ff-pipe ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-magenta - 'modus-themes-subtle-magenta - 'modus-themes-special-calm)))) - `(helm-ff-prefix ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-yellow - 'modus-themes-subtle-yellow - 'modus-themes-special-warm)))) + `(helm-ff-pipe ((,class :inherit modus-themes-special-calm))) + `(helm-ff-prefix ((,class :inherit modus-themes-special-warm))) `(helm-ff-socket ((,class :foreground ,red-alt-other))) - `(helm-ff-suid ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-red - 'modus-themes-subtle-red - 'modus-themes-special-warm)))) + `(helm-ff-suid ((,class :inherit modus-themes-special-warm))) `(helm-ff-symlink ((,class :inherit modus-themes-link-symlink))) `(helm-ff-truename ((,class :foreground ,blue-alt-other))) - `(helm-fd-finish ((,class :foreground ,green-active))) + `(helm-fd-finish ((,class :inherit success))) `(helm-grep-cmd-line ((,class :foreground ,yellow-alt-other))) `(helm-grep-file ((,class :inherit bold :foreground ,fg-special-cold))) - `(helm-grep-finish ((,class :foreground ,green-active))) + `(helm-grep-finish ((,class :inherit bold))) `(helm-grep-lineno ((,class :foreground ,fg-special-warm))) `(helm-grep-match ((,class :inherit modus-themes-special-calm))) `(helm-header ((,class :inherit bold :foreground ,fg-special-cold))) `(helm-header-line-left-margin ((,class :inherit bold :foreground ,yellow-intense))) - `(helm-history-deleted ((,class ,@(modus-themes--extra-completions - 'modus-themes-intense-red - 'modus-themes-subtle-red - 'modus-themes-special-warm)))) + `(helm-history-deleted ((,class :inherit modus-themes-special-warm))) `(helm-history-remote ((,class :foreground ,red-alt-other))) - `(helm-lisp-completion-info ((,class :inherit compilation-info))) - `(helm-lisp-show-completion ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-yellow - 'modus-themes-subtle-yellow - 'modus-themes-special-warm)))) + `(helm-lisp-completion-info ((,class :inherit modus-themes-bold :foreground ,fg-special-cold))) + `(helm-lisp-show-completion ((,class :inherit modus-themes-special-warm))) `(helm-locate-finish ((,class :inherit success))) - `(helm-match ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-cyan - 'modus-themes-subtle-cyan - 'modus-themes-special-mild)))) + `(helm-match ((,class :inherit modus-themes-completion-match-0))) `(helm-match-item ((,class :inherit helm-match))) `(helm-minibuffer-prompt ((,class :inherit modus-themes-prompt))) `(helm-moccur-buffer ((,class :inherit button :foreground ,cyan-alt-other))) - `(helm-mode-prefix ((,class ,@(modus-themes--extra-completions - 'modus-themes-intense-magenta - 'modus-themes-subtle-magenta - 'modus-themes-special-calm)))) + `(helm-mode-prefix ((,class :inherit modus-themes-special-calm))) `(helm-non-file-buffer ((,class :inherit shadow))) `(helm-prefarg ((,class :foreground ,red-active))) - `(helm-resume-need-update ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-magenta - 'modus-themes-subtle-magenta - 'modus-themes-special-calm)))) - `(helm-selection ((,class :inherit modus-themes-completion-extra-selected))) - `(helm-selection-line ((,class :inherit modus-themes-special-cold))) + `(helm-resume-need-update ((,class :inherit modus-themes-special-calm))) + `(helm-selection ((,class :inherit modus-themes-completion-selected))) + `(helm-selection-line ((,class :background ,bg-hl-alt-intense))) `(helm-separator ((,class :foreground ,fg-special-mild))) `(helm-time-zone-current ((,class :foreground ,green))) `(helm-time-zone-home ((,class :foreground ,magenta))) @@ -5778,12 +5892,9 @@ by virtue of calling either of `modus-themes-load-operandi' and `(helm-ls-git-renamed-modified-face ((,class :foreground ,magenta))) `(helm-ls-git-untracked-face ((,class :foreground ,fg-special-cold))) ;;;;; helm-switch-shell - `(helm-switch-shell-new-shell-face ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-magenta - 'modus-themes-subtle-magenta - 'modus-themes-nuanced-magenta)))) + `(helm-switch-shell-new-shell-face ((,class :inherit modus-themes-completion-match-0))) ;;;;; helm-xref - `(helm-xref-file-name ((,class :inherit compilation-info))) + `(helm-xref-file-name ((,class :inherit modus-themes-bold :foreground ,fg-special-cold))) ;;;;; helpful `(helpful-heading ((,class :inherit modus-themes-heading-1))) ;;;;; highlight region or ad-hoc regexp @@ -5826,17 +5937,17 @@ by virtue of calling either of `modus-themes-load-operandi' and `(hydra-face-red ((,class :inherit bold :foreground ,red-faint))) `(hydra-face-teal ((,class :inherit bold :foreground ,cyan-alt-other))) ;;;;; icomplete - `(icomplete-first-match ((,class :inherit modus-themes-completion-standard-first-match))) - `(icomplete-selected-match ((,class :inherit modus-themes-completion-standard-selected))) + `(icomplete-first-match ((,class :inherit modus-themes-completion-match-0))) + `(icomplete-selected-match ((,class :inherit modus-themes-completion-selected))) ;;;;; icomplete-vertical `(icomplete-vertical-separator ((,class :inherit shadow))) ;;;;; ido-mode - `(ido-first-match ((,class :inherit modus-themes-completion-standard-first-match))) + `(ido-first-match ((,class :inherit modus-themes-completion-selected))) `(ido-incomplete-regexp ((,class :inherit error))) `(ido-indicator ((,class :inherit modus-themes-subtle-yellow))) `(ido-only-match ((,class :inherit ido-first-match))) `(ido-subdir ((,class :foreground ,blue))) - `(ido-virtual ((,class :foreground ,fg-special-warm))) + `(ido-virtual ((,class :foreground ,magenta-alt-other))) ;;;;; iedit `(iedit-occurrence ((,class :inherit modus-themes-refine-blue))) `(iedit-read-only-occurrence ((,class :inherit modus-themes-intense-yellow))) @@ -5914,32 +6025,20 @@ by virtue of calling either of `modus-themes-load-operandi' and ;;;;; ivy `(ivy-action ((,class :inherit modus-themes-key-binding))) `(ivy-confirm-face ((,class :inherit success))) - `(ivy-current-match ((,class :inherit modus-themes-completion-extra-selected))) + `(ivy-current-match ((,class :inherit modus-themes-completion-selected))) `(ivy-cursor ((,class :background ,fg-main :foreground ,bg-main))) `(ivy-highlight-face ((,class :foreground ,magenta))) `(ivy-match-required-face ((,class :inherit error))) - `(ivy-minibuffer-match-face-1 ((,class :inherit modus-themes-subtle-neutral))) - `(ivy-minibuffer-match-face-2 ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-green - 'modus-themes-subtle-green - 'modus-themes-special-mild)))) - `(ivy-minibuffer-match-face-3 ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-blue - 'modus-themes-subtle-blue - 'modus-themes-special-cold)))) - `(ivy-minibuffer-match-face-4 ((,class ,@(modus-themes--extra-completions - 'modus-themes-refine-magenta - 'modus-themes-subtle-magenta - 'modus-themes-special-calm)))) - `(ivy-modified-buffer ((,class :inherit modus-themes-slant :foreground ,yellow))) - `(ivy-modified-outside-buffer ((,class :inherit modus-themes-slant :foreground ,red-alt))) + `(ivy-minibuffer-match-face-1 (( ))) + `(ivy-minibuffer-match-face-2 ((,class :inherit modus-themes-completion-match-0))) + `(ivy-minibuffer-match-face-3 ((,class :inherit modus-themes-completion-match-1))) + `(ivy-minibuffer-match-face-4 ((,class :inherit modus-themes-completion-match-2))) `(ivy-org ((,class :foreground ,cyan-alt-other))) `(ivy-remote ((,class :foreground ,magenta))) `(ivy-separator ((,class :inherit shadow))) `(ivy-subdir ((,class :foreground ,blue))) `(ivy-virtual ((,class :foreground ,magenta-alt-other))) ;;;;; ivy-posframe - `(ivy-posframe ((,class :background ,bg-dim :foreground ,fg-main))) `(ivy-posframe-border ((,class :background ,fg-window-divider-inner))) `(ivy-posframe-cursor ((,class :background ,fg-main :foreground ,bg-main))) ;;;;; jira (org-jira) @@ -6214,7 +6313,7 @@ by virtue of calling either of `modus-themes-load-operandi' and `(marginalia-file-priv-read ((,class :foreground ,fg-main))) `(marginalia-file-priv-write ((,class :foreground ,cyan))) `(marginalia-function ((,class :foreground ,magenta-alt-faint))) - `(marginalia-key ((,class :inherit modus-themes-completion-key-binding))) + `(marginalia-key ((,class :inherit modus-themes-key-binding))) `(marginalia-lighter ((,class :foreground ,blue-alt))) `(marginalia-list ((,class :foreground ,magenta-alt-other-faint))) `(marginalia-mode ((,class :foreground ,cyan))) @@ -6312,7 +6411,7 @@ by virtue of calling either of `modus-themes-load-operandi' and `(markup-title-5-face ((,class :inherit modus-themes-heading-6))) `(markup-verbatim-face ((,class :inherit modus-themes-fixed-pitch :background ,bg-alt))) ;;;;; mct - `(mct-highlight-candidate ((,class :inherit modus-themes-completion-standard-selected))) + `(mct-highlight-candidate ((,class :inherit modus-themes-completion-selected))) ;;;;; mentor `(mentor-download-message ((,class :foreground ,fg-special-warm))) `(mentor-download-name ((,class :foreground ,fg-special-cold))) @@ -6510,22 +6609,10 @@ by virtue of calling either of `modus-themes-load-operandi' and `(nxml-ref ((,class :inherit modus-themes-bold :foreground ,fg-special-mild))) `(rng-error ((,class :inherit error))) ;;;;; orderless - `(orderless-match-face-0 ((,class :inherit bold - ,@(modus-themes--standard-completions - blue-alt-other bg-special-cold fg-special-cold - blue-refine-bg blue-refine-fg)))) - `(orderless-match-face-1 ((,class :inherit bold - ,@(modus-themes--standard-completions - magenta-alt bg-special-calm fg-special-calm - magenta-refine-bg magenta-refine-fg)))) - `(orderless-match-face-2 ((,class :inherit bold - ,@(modus-themes--standard-completions - green bg-special-mild fg-special-mild - green-refine-bg green-refine-fg)))) - `(orderless-match-face-3 ((,class :inherit bold - ,@(modus-themes--standard-completions - yellow bg-special-warm fg-special-warm - yellow-refine-bg yellow-refine-fg)))) + `(orderless-match-face-0 ((,class :inherit modus-themes-completion-match-0))) + `(orderless-match-face-1 ((,class :inherit modus-themes-completion-match-1))) + `(orderless-match-face-2 ((,class :inherit modus-themes-completion-match-2))) + `(orderless-match-face-3 ((,class :inherit modus-themes-completion-match-3))) ;;;;; org `(org-agenda-calendar-event ((,class ,@(modus-themes--agenda-event blue-alt)))) `(org-agenda-calendar-sexp ((,class ,@(modus-themes--agenda-event blue-alt t)))) @@ -6560,8 +6647,7 @@ by virtue of calling either of `modus-themes-load-operandi' and bg-dim fg-special-cold bg-alt fg-alt)))) `(org-block-end-line ((,class :inherit org-block-begin-line))) - `(org-checkbox ((,class :box (:line-width 1 :color ,bg-active) - :background ,bg-inactive :foreground ,fg-active))) + `(org-checkbox (( ))) `(org-checkbox-statistics-done ((,class :inherit org-done))) `(org-checkbox-statistics-todo ((,class :inherit org-todo))) `(org-clock-overlay ((,class :inherit modus-themes-special-cold))) @@ -6781,9 +6867,9 @@ by virtue of calling either of `modus-themes-load-operandi' and `(pomidor-work-face ((,class :inherit modus-themes-grue))) ;;;;; popup `(popup-face ((,class :background ,bg-alt :foreground ,fg-main))) - `(popup-isearch-match ((,class :inherit (modus-themes-refine-cyan bold)))) - `(popup-menu-mouse-face ((,class :inherit modus-themes-intense-blue))) - `(popup-menu-selection-face ((,class :inherit (modus-themes-subtle-cyan bold)))) + `(popup-isearch-match ((,class :inherit (modus-themes-search-success bold)))) + `(popup-menu-mouse-face ((,class :inherit highlight))) + `(popup-menu-selection-face ((,class :inherit modus-themes-completion-selected-popup))) `(popup-scroll-bar-background-face ((,class :background ,bg-active))) `(popup-scroll-bar-foreground-face ((,class :foreground ,fg-active))) `(popup-summary-face ((,class :background ,bg-active :foreground ,fg-inactive))) @@ -6918,23 +7004,15 @@ by virtue of calling either of `modus-themes-load-operandi' and `(ruler-mode-pad ((,class :inherit ruler-mode-default :background ,bg-active :foreground ,fg-inactive))) `(ruler-mode-tab-stop ((,class :inherit ruler-mode-default :foreground ,fg-special-warm))) ;;;;; selectrum - `(selectrum-current-candidate ((,class :inherit modus-themes-completion-standard-selected))) + `(selectrum-current-candidate ((,class :inherit modus-themes-completion-selected))) `(selectrum-mouse-highlight ((,class :inherit highlight))) `(selectrum-quick-keys-highlight ((,class :inherit modus-themes-refine-red))) `(selectrum-quick-keys-match ((,class :inherit (bold modus-themes-search-success)))) ;;;;; selectrum-prescient - `(selectrum-prescient-primary-highlight - ((,class :inherit bold - ,@(modus-themes--standard-completions - magenta-alt bg-special-calm fg-special-calm - magenta-refine-bg magenta-refine-fg)))) - `(selectrum-prescient-secondary-highlight - ((,class :inherit bold - ,@(modus-themes--standard-completions - cyan-alt-other bg-special-cold fg-special-cold - cyan-refine-bg cyan-refine-fg)))) + `(selectrum-prescient-primary-highlight ((,class :inherit modus-themes-completion-match-0))) + `(selectrum-prescient-secondary-highlight ((,class :inherit modus-themes-completion-match-1))) ;;;;; semantic `(semantic-complete-inline-face ((,class :foreground ,fg-special-warm :underline t))) `(semantic-decoration-on-fileless-includes ((,class :inherit modus-themes-refine-green))) @@ -7091,15 +7169,15 @@ by virtue of calling either of `modus-themes-load-operandi' and `(switch-window-background ((,class :background ,bg-dim))) `(switch-window-label ((,class :height 3.0 :foreground ,blue-intense))) ;;;;; swiper - `(swiper-background-match-face-1 ((,class :inherit modus-themes-subtle-neutral))) - `(swiper-background-match-face-2 ((,class :inherit modus-themes-refine-cyan))) - `(swiper-background-match-face-3 ((,class :inherit modus-themes-refine-magenta))) - `(swiper-background-match-face-4 ((,class :inherit modus-themes-refine-yellow))) - `(swiper-line-face ((,class :inherit modus-themes-special-cold))) - `(swiper-match-face-1 ((,class :inherit (bold modus-themes-intense-neutral)))) - `(swiper-match-face-2 ((,class :inherit (bold modus-themes-intense-green)))) - `(swiper-match-face-3 ((,class :inherit (bold modus-themes-intense-blue)))) - `(swiper-match-face-4 ((,class :inherit (bold modus-themes-intense-red)))) + `(swiper-background-match-face-1 (( ))) + `(swiper-background-match-face-2 ((,class :inherit modus-themes-completion-match-0))) + `(swiper-background-match-face-3 ((,class :inherit modus-themes-completion-match-1))) + `(swiper-background-match-face-4 ((,class :inherit modus-themes-completion-match-2))) + `(swiper-line-face ((,class :background ,bg-hl-alt-intense))) + `(swiper-match-face-1 (( ))) + `(swiper-match-face-2 ((,class :inherit modus-themes-completion-match-0))) + `(swiper-match-face-3 ((,class :inherit modus-themes-completion-match-1))) + `(swiper-match-face-4 ((,class :inherit modus-themes-completion-match-2))) ;;;;; sx `(sx-inbox-item-type ((,class :foreground ,magenta-alt-other))) `(sx-inbox-item-type-unread ((,class :inherit (sx-inbox-item-type bold)))) @@ -7348,7 +7426,7 @@ by virtue of calling either of `modus-themes-load-operandi' and `(vc-state-base ((,class :foreground ,fg-active))) `(vc-up-to-date-state ((,class :foreground ,fg-special-cold))) ;;;;; vertico - `(vertico-current ((,class :inherit modus-themes-completion-standard-selected))) + `(vertico-current ((,class :inherit modus-themes-completion-selected))) ;;;;; vertico-quick `(vertico-quick1 ((,class :inherit (modus-themes-intense-magenta bold)))) `(vertico-quick2 ((,class :inherit (modus-themes-refine-cyan bold)))) diff --git a/etc/themes/modus-vivendi-theme.el b/etc/themes/modus-vivendi-theme.el index 3e78a6c959..7d38e5cbf2 100644 --- a/etc/themes/modus-vivendi-theme.el +++ b/etc/themes/modus-vivendi-theme.el @@ -4,7 +4,7 @@ ;; Author: Protesilaos Stavrou ;; URL: https://gitlab.com/protesilaos/modus-themes -;; Version: 2.1.0 +;; Version: 2.2.0 ;; Package-Requires: ((emacs "27.1")) ;; Keywords: faces, theme, accessibility commit 76fcfe1eb1b6b8086cb58966801d2509fd55d9f9 Author: Jim Porter Date: Mon Feb 21 12:14:34 2022 -0800 Ignore 'eshell-broken-pipe' error in 'eshell-sentinel' This can happen if 'eshell-sentinel' tries to write output to another process, but that process has already terminated. * lisp/eshell/esh-proc.el (eshell-sentinel): Use 'ignore-error' instead of 'unwind-protect'. diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index ed37de85f7..d7d22d2a9e 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -435,12 +435,12 @@ PROC is the process that's exiting. STRING is the exit message." (lambda () (if (nth 4 entry) (run-at-time 0 nil finish-io) - (unwind-protect - (when str - (eshell-output-object - str nil handles)) - (eshell-close-handles - status 'nil handles)))))) + (when str + (ignore-error 'eshell-pipe-broken + (eshell-output-object + str nil handles))) + (eshell-close-handles + status 'nil handles))))) (funcall finish-io))))) (eshell-remove-process-entry entry)))) (eshell-kill-process-function proc string))))) commit 5942504391df1b81ded820f9c8cd3047a05f3543 (refs/remotes/origin/emacs-28) Author: Lars Ingebrigtsen Date: Wed Feb 23 12:58:37 2022 +0100 Reword face-remap-add-relative manual entry * doc/lispref/display.texi (Face Remapping): Clarify the face-remap-add-relative (bug#54114). diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 3fd54cb147..0ea421c774 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -3197,10 +3197,10 @@ and @code{face-remap-reset-base} functions; it is intended for major modes to remap faces in the buffers they control. @defun face-remap-add-relative face &rest specs -This function adds the face spec in @var{specs} as relative -remappings for face @var{face} in the current buffer. The remaining -arguments, @var{specs}, should form either a list of face names, or a -property list of attribute/value pairs. +This function adds @var{specs} as relative remappings for face +@var{face} in the current buffer. @var{specs} should be a list where +each element is either a face name, or a property list of +attribute/value pairs. The return value is a Lisp object that serves as a cookie; you can pass this object as an argument to @code{face-remap-remove-relative} commit 7b0b27971b583c09cbc524d2215546f5dfe4a0e1 Author: Lars Ingebrigtsen Date: Wed Feb 23 12:50:07 2022 +0100 Make face-remap-set-base work with a single face again * lisp/face-remap.el (face-remap-set-base): Fix regression introduced by cece37cf09de9 (bug#46973). diff --git a/lisp/face-remap.el b/lisp/face-remap.el index eb4f6b9534..50306a5e8a 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -207,10 +207,12 @@ If SPECS is empty or a single face `eq' to FACE, call `face-remap-reset-base' to use the normal definition of FACE as the base remapping; note that this is different from SPECS containing a single value nil, which means not to inherit from the global definition of FACE at all." + ;; Simplify the specs in the case where it's just a single face (and + ;; it's not a list with just a nil). (while (and (consp specs) (not (null (car specs))) (null (cdr specs))) (setq specs (car specs))) (if (or (null specs) - (and (eq (car specs) face) (null (cdr specs)))) ; default + (eq specs face)) ; default ;; Set entry back to default (face-remap-reset-base face) ;; Set the base remapping commit 4f53789a0a8f219b9134546aa0b9b705bdf0086d Author: Po Lu Date: Wed Feb 23 18:11:29 2022 +0800 * src/xterm.c (x_term_init): Catch some errors from defective X servers. diff --git a/src/xterm.c b/src/xterm.c index d78c5d7250..a3c3c6f3f4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -16414,9 +16414,10 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) request results in an error. If that doesn't work, however, then it's the latter, so decrease the minor until the version that GTK requested is found. */ - x_catch_errors (dpyinfo->display); #endif + x_catch_errors (dpyinfo->display); + rc = XIQueryVersion (dpyinfo->display, &major, &minor); #ifdef HAVE_GTK3 @@ -16460,6 +16461,11 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) } else x_uncatch_errors_after_check (); +#else + if (x_had_errors_p (dpyinfo->display)) + rc = BadRequest; + + x_uncatch_errors_after_check (); #endif if (rc == Success) @@ -16468,6 +16474,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) x_init_master_valuators (dpyinfo); } } + dpyinfo->xi2_version = minor; #endif