commit 6fd4ab250b690736e706245106f396cc93f3f5f0 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Sun Aug 7 11:47:26 2022 +0800 Revert "Improve X event timestamp tracking" This reverts commit 4b98a79a508ebdc719abfcf51ee6de32e46d0e1c. This change was installed without answering several important questions. diff --git a/lisp/server.el b/lisp/server.el index cd3a8f80f0..a06f2f952f 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1721,9 +1721,7 @@ be a cons cell (LINENUMBER . COLUMNNUMBER)." ;; a minibuffer/dedicated-window (if there's no other). (error (pop-to-buffer next-buffer))))))) (when server-raise-frame - (let ((frame (window-frame))) - (frame-note-oob-interaction frame) - (select-frame-set-input-focus frame))))) + (select-frame-set-input-focus (window-frame))))) (defvar server-stop-automatically nil "Internal status variable for `server-stop-automatically'.") diff --git a/src/frame.c b/src/frame.c index 084df8ef21..25d71e0769 100644 --- a/src/frame.c +++ b/src/frame.c @@ -5942,25 +5942,6 @@ This function is for internal use only. */) return f->was_invisible ? Qt : Qnil; } - -DEFUN ("frame-note-oob-interaction", - Fframe_note_oob_interaction, - Sframe_note_oob_interaction, 0, 1, 0, - doc: /* Note that the user has interacted with a frame. -This function is useful when the user interacts with Emacs out-of-band -(e.g., via the server) and we want to pretend for purposes of Emacs -interacting with the window system that the last interaction time was -the time of that out-of-band interaction, not the time of the last -window system input event delivered to that frame. */) - (Lisp_Object frame) -{ - struct frame *f = decode_any_frame (frame); - if (FRAME_LIVE_P (f) && - FRAME_TERMINAL (f)->note_oob_interaction_hook) - FRAME_TERMINAL (f)->note_oob_interaction_hook (f); - return Qnil; -} - /*********************************************************************** Multimonitor data @@ -6645,7 +6626,6 @@ iconify the top level frame instead. */); defsubr (&Sframe_window_state_change); defsubr (&Sset_frame_window_state_change); defsubr (&Sframe_scale_factor); - defsubr (&Sframe_note_oob_interaction); #ifdef HAVE_WINDOW_SYSTEM defsubr (&Sx_get_resource); diff --git a/src/gtkutil.c b/src/gtkutil.c index b2af5ff5c2..a6bba096a4 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -6658,17 +6658,6 @@ xg_filter_key (struct frame *frame, XEvent *xkey) } #endif -#ifndef HAVE_PGTK -void -xg_set_user_timestamp (struct frame *frame, guint32 time) -{ - GtkWidget *widget = FRAME_GTK_OUTER_WIDGET (frame); - GdkWindow *window = gtk_widget_get_window (widget); - eassert (window); - gdk_x11_window_set_user_time (window, time); -} -#endif - #if GTK_CHECK_VERSION (3, 10, 0) static void xg_widget_style_updated (GtkWidget *widget, gpointer user_data) diff --git a/src/gtkutil.h b/src/gtkutil.h index bca7ea8176..190d662831 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -224,10 +224,6 @@ extern bool xg_is_menu_window (Display *dpy, Window); extern bool xg_filter_key (struct frame *frame, XEvent *xkey); #endif -#ifndef HAVE_PGTK -extern void xg_set_user_timestamp (struct frame *frame, guint32 time); -#endif - /* Mark all callback data that are Lisp_Objects during GC. */ extern void xg_mark_data (void); diff --git a/src/termhooks.h b/src/termhooks.h index 2c204afeca..c5f1e286e9 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -860,13 +860,6 @@ struct terminal will be considered as grabbed. */ bool (*any_grab_hook) (Display_Info *); #endif - - /* Called to note that the user has interacted with a window system - frame outside the window system and that we should update the - window system's notion of the user's last interaction time with - that frame. */ - void (*note_oob_interaction_hook) (struct frame *); - } GCALIGNED_STRUCT; INLINE bool diff --git a/src/xterm.c b/src/xterm.c index 29295cfe7b..97985c8d9e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6581,6 +6581,12 @@ x_set_frame_alpha (struct frame *f) x_stop_ignoring_errors (dpyinfo); } +/*********************************************************************** + Starting and ending an update + ***********************************************************************/ + +#if defined HAVE_XSYNC && !defined USE_GTK + /* Wait for an event matching PREDICATE to show up in the event queue, or TIMEOUT to elapse. @@ -6634,12 +6640,6 @@ x_if_event (Display *dpy, XEvent *event_return, } } -/*********************************************************************** - Starting and ending an update - ***********************************************************************/ - -#if defined HAVE_XSYNC && !defined USE_GTK - /* Return the monotonic time corresponding to the high-resolution server timestamp TIMESTAMP. Return 0 if the necessary information is not available. */ @@ -7521,25 +7521,26 @@ static void x_check_font (struct frame *, struct font *); user time. We don't sanitize timestamps from events sent by the X server itself because some Lisp might have set the user time to a ridiculously large value, and this way a more reasonable timestamp - can be obtained upon the next event. If EXPLICIT_FRAME is NULL, - update the focused frame's timestamp; otherwise, update - EXPLICIT_FRAME's. */ + can be obtained upon the next event. */ static void -x_display_set_last_user_time_1 (struct x_display_info *dpyinfo, Time time, - bool send_event, - struct frame *explicit_frame) +x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, + bool send_event) { - struct frame *frame; +#ifndef USE_GTK + struct frame *focus_frame; Time old_time; -#if defined HAVE_XSYNC && !defined USE_GTK +#if defined HAVE_XSYNC uint64_t monotonic_time; #endif - frame = explicit_frame ? explicit_frame : dpyinfo->x_focus_frame; + focus_frame = dpyinfo->x_focus_frame; old_time = dpyinfo->last_user_time; +#endif +#ifdef ENABLE_CHECKING eassert (time <= X_ULONG_MAX); +#endif if (!send_event || time > dpyinfo->last_user_time) dpyinfo->last_user_time = time; @@ -7566,35 +7567,23 @@ x_display_set_last_user_time_1 (struct x_display_info *dpyinfo, Time time, } #endif - /* Don't waste bandwidth if the time hasn't actually changed. - Update anyway if we're updating the timestamp for a non-focused - frame, since the event loop might not have gotten around to - updating that frame's timestamp. */ - if (frame && (explicit_frame || old_time != dpyinfo->last_user_time)) +#ifndef USE_GTK + /* Don't waste bandwidth if the time hasn't actually changed. */ + if (focus_frame && old_time != dpyinfo->last_user_time) { time = dpyinfo->last_user_time; - while (FRAME_PARENT_FRAME (frame)) - frame = FRAME_PARENT_FRAME (frame); + while (FRAME_PARENT_FRAME (focus_frame)) + focus_frame = FRAME_PARENT_FRAME (focus_frame); -#if defined USE_GTK - xg_set_user_timestamp (frame, time); -#else - if (FRAME_X_OUTPUT (frame)->user_time_window != None) + if (FRAME_X_OUTPUT (focus_frame)->user_time_window != None) XChangeProperty (dpyinfo->display, - FRAME_X_OUTPUT (frame)->user_time_window, + FRAME_X_OUTPUT (focus_frame)->user_time_window, dpyinfo->Xatom_net_wm_user_time, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &time, 1); -#endif } -} - -static void -x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, - bool send_event) -{ - x_display_set_last_user_time_1 (dpyinfo, time, send_event, NULL); +#endif } #ifdef USE_GTK @@ -25894,11 +25883,9 @@ xembed_request_focus (struct frame *f) XEMBED_REQUEST_FOCUS, 0, 0, 0); } -/* Activate frame with Extended Window Manager Hints - -Return whether we were successful in doing so. */ +/* Activate frame with Extended Window Manager Hints */ -static bool +static void x_ewmh_activate_frame (struct frame *f) { XEvent msg; @@ -25906,7 +25893,8 @@ x_ewmh_activate_frame (struct frame *f) dpyinfo = FRAME_DISPLAY_INFO (f); - if (x_wm_supports (f, dpyinfo->Xatom_net_active_window)) + if (FRAME_VISIBLE_P (f) + && x_wm_supports (f, dpyinfo->Xatom_net_active_window)) { /* See the documentation at https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html @@ -25926,9 +25914,7 @@ x_ewmh_activate_frame (struct frame *f) XSendEvent (dpyinfo->display, dpyinfo->root_window, False, (SubstructureRedirectMask | SubstructureNotifyMask), &msg); - return true; } - return false; } static Lisp_Object @@ -25966,14 +25952,16 @@ x_focus_frame (struct frame *f, bool noactivate) events. See XEmbed Protocol Specification at https://freedesktop.org/wiki/Specifications/xembed-spec/ */ xembed_request_focus (f); - else if (noactivate || - (!FRAME_PARENT_FRAME (f) && !x_ewmh_activate_frame (f))) + else { /* Ignore any BadMatch error this request might result in. */ x_ignore_errors_for_next_request (dpyinfo); XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), RevertToParent, CurrentTime); x_stop_ignoring_errors (dpyinfo); + + if (!noactivate) + x_ewmh_activate_frame (f); } } @@ -28588,55 +28576,6 @@ x_have_any_grab (struct x_display_info *dpyinfo) } #endif -static Bool -server_timestamp_predicate (Display *display, - XEvent *xevent, - XPointer arg) -{ - XID *args = (XID *) arg; - - if (xevent->type == PropertyNotify - && xevent->xproperty.window == args[0] - && xevent->xproperty.atom == args[1]) - return True; - - return False; -} - -static bool -x_get_server_time (struct frame *f, Time *time) -{ - struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); - Atom property_atom = dpyinfo->Xatom_EMACS_SERVER_TIME_PROP; - XEvent event; - - XChangeProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f), - property_atom, XA_ATOM, 32, - PropModeReplace, (unsigned char *) &property_atom, 1); - - if (x_if_event (dpyinfo->display, &event, server_timestamp_predicate, - (XPointer) &(XID[]) {FRAME_OUTER_WINDOW (f), property_atom}, - dtotimespec (XFLOAT_DATA (Vx_wait_for_event_timeout)))) - return false; - *time = event.xproperty.time; - return true; -} - -static void -x_note_oob_interaction (struct frame *f) -{ - while (FRAME_PARENT_FRAME (f)) - f = FRAME_PARENT_FRAME (f); - if (FRAME_LIVE_P (f)) - { - Time server_time; - if (!x_get_server_time (f, &server_time)) - error ("Timed out waiting for server timestamp"); - x_display_set_last_user_time_1 ( - FRAME_DISPLAY_INFO (f), server_time, false, f); - } -} - /* Create a struct terminal, initialize it with the X11 specific functions and make DISPLAY->TERMINAL point to it. */ @@ -28707,7 +28646,6 @@ x_create_terminal (struct x_display_info *dpyinfo) #ifdef HAVE_XINPUT2 terminal->any_grab_hook = x_have_any_grab; #endif - terminal->note_oob_interaction_hook = x_note_oob_interaction; /* Other hooks are NULL by default. */ return terminal; commit 4b98a79a508ebdc719abfcf51ee6de32e46d0e1c Author: Daniel Colascione Date: Sat Aug 6 23:42:36 2022 -0400 Improve X event timestamp tracking Fix two problems with our handling of X timestamps 1) We're not properly updating the X interaction timestamp after receiving certain input events, and 2) X events sent in response to emacsclient commands get stale timestamps because the timestamp tracking doesn't take into account that interactions with the user can occur outside the X input event channel. * src/xterm.c: (x_display_set_last_user_time_1): New function. (x_display_set_last_user_time): Call it. (x_ewmh_activate_frame): Refactor. (x_focus_frame): Don't call XSetInputFocus if we can use EWMH activation. (server_timestamp_predicate): New function. (x_get_server_time): New function. (x_note_oob_interaction): New function. (x_create_terminal): Register new function as terminal hook. * src/termhooks.h: New hook: note_oob_interaction_hook. * src/gtkutil.h: (xg_set_user_timestamp): Declare. * src/gtkutil.c: (xg_set_user_timestamp): New function. * src/frame.c: (Fframe_note_oob_interaction): New function. (syms_of_frame): Register it. * lisp/server.el: (server-switch-buffer): Call frame-note-oob-interaction when user requests frame be raised. diff --git a/lisp/server.el b/lisp/server.el index a06f2f952f..cd3a8f80f0 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1721,7 +1721,9 @@ be a cons cell (LINENUMBER . COLUMNNUMBER)." ;; a minibuffer/dedicated-window (if there's no other). (error (pop-to-buffer next-buffer))))))) (when server-raise-frame - (select-frame-set-input-focus (window-frame))))) + (let ((frame (window-frame))) + (frame-note-oob-interaction frame) + (select-frame-set-input-focus frame))))) (defvar server-stop-automatically nil "Internal status variable for `server-stop-automatically'.") diff --git a/src/frame.c b/src/frame.c index 25d71e0769..084df8ef21 100644 --- a/src/frame.c +++ b/src/frame.c @@ -5942,6 +5942,25 @@ This function is for internal use only. */) return f->was_invisible ? Qt : Qnil; } + +DEFUN ("frame-note-oob-interaction", + Fframe_note_oob_interaction, + Sframe_note_oob_interaction, 0, 1, 0, + doc: /* Note that the user has interacted with a frame. +This function is useful when the user interacts with Emacs out-of-band +(e.g., via the server) and we want to pretend for purposes of Emacs +interacting with the window system that the last interaction time was +the time of that out-of-band interaction, not the time of the last +window system input event delivered to that frame. */) + (Lisp_Object frame) +{ + struct frame *f = decode_any_frame (frame); + if (FRAME_LIVE_P (f) && + FRAME_TERMINAL (f)->note_oob_interaction_hook) + FRAME_TERMINAL (f)->note_oob_interaction_hook (f); + return Qnil; +} + /*********************************************************************** Multimonitor data @@ -6626,6 +6645,7 @@ iconify the top level frame instead. */); defsubr (&Sframe_window_state_change); defsubr (&Sset_frame_window_state_change); defsubr (&Sframe_scale_factor); + defsubr (&Sframe_note_oob_interaction); #ifdef HAVE_WINDOW_SYSTEM defsubr (&Sx_get_resource); diff --git a/src/gtkutil.c b/src/gtkutil.c index a6bba096a4..b2af5ff5c2 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -6658,6 +6658,17 @@ xg_filter_key (struct frame *frame, XEvent *xkey) } #endif +#ifndef HAVE_PGTK +void +xg_set_user_timestamp (struct frame *frame, guint32 time) +{ + GtkWidget *widget = FRAME_GTK_OUTER_WIDGET (frame); + GdkWindow *window = gtk_widget_get_window (widget); + eassert (window); + gdk_x11_window_set_user_time (window, time); +} +#endif + #if GTK_CHECK_VERSION (3, 10, 0) static void xg_widget_style_updated (GtkWidget *widget, gpointer user_data) diff --git a/src/gtkutil.h b/src/gtkutil.h index 190d662831..bca7ea8176 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -224,6 +224,10 @@ extern bool xg_is_menu_window (Display *dpy, Window); extern bool xg_filter_key (struct frame *frame, XEvent *xkey); #endif +#ifndef HAVE_PGTK +extern void xg_set_user_timestamp (struct frame *frame, guint32 time); +#endif + /* Mark all callback data that are Lisp_Objects during GC. */ extern void xg_mark_data (void); diff --git a/src/termhooks.h b/src/termhooks.h index c5f1e286e9..2c204afeca 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -860,6 +860,13 @@ struct terminal will be considered as grabbed. */ bool (*any_grab_hook) (Display_Info *); #endif + + /* Called to note that the user has interacted with a window system + frame outside the window system and that we should update the + window system's notion of the user's last interaction time with + that frame. */ + void (*note_oob_interaction_hook) (struct frame *); + } GCALIGNED_STRUCT; INLINE bool diff --git a/src/xterm.c b/src/xterm.c index 97985c8d9e..29295cfe7b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6581,12 +6581,6 @@ x_set_frame_alpha (struct frame *f) x_stop_ignoring_errors (dpyinfo); } -/*********************************************************************** - Starting and ending an update - ***********************************************************************/ - -#if defined HAVE_XSYNC && !defined USE_GTK - /* Wait for an event matching PREDICATE to show up in the event queue, or TIMEOUT to elapse. @@ -6640,6 +6634,12 @@ x_if_event (Display *dpy, XEvent *event_return, } } +/*********************************************************************** + Starting and ending an update + ***********************************************************************/ + +#if defined HAVE_XSYNC && !defined USE_GTK + /* Return the monotonic time corresponding to the high-resolution server timestamp TIMESTAMP. Return 0 if the necessary information is not available. */ @@ -7521,26 +7521,25 @@ static void x_check_font (struct frame *, struct font *); user time. We don't sanitize timestamps from events sent by the X server itself because some Lisp might have set the user time to a ridiculously large value, and this way a more reasonable timestamp - can be obtained upon the next event. */ + can be obtained upon the next event. If EXPLICIT_FRAME is NULL, + update the focused frame's timestamp; otherwise, update + EXPLICIT_FRAME's. */ static void -x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, - bool send_event) +x_display_set_last_user_time_1 (struct x_display_info *dpyinfo, Time time, + bool send_event, + struct frame *explicit_frame) { -#ifndef USE_GTK - struct frame *focus_frame; + struct frame *frame; Time old_time; -#if defined HAVE_XSYNC +#if defined HAVE_XSYNC && !defined USE_GTK uint64_t monotonic_time; #endif - focus_frame = dpyinfo->x_focus_frame; + frame = explicit_frame ? explicit_frame : dpyinfo->x_focus_frame; old_time = dpyinfo->last_user_time; -#endif -#ifdef ENABLE_CHECKING eassert (time <= X_ULONG_MAX); -#endif if (!send_event || time > dpyinfo->last_user_time) dpyinfo->last_user_time = time; @@ -7567,23 +7566,35 @@ x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, } #endif -#ifndef USE_GTK - /* Don't waste bandwidth if the time hasn't actually changed. */ - if (focus_frame && old_time != dpyinfo->last_user_time) + /* Don't waste bandwidth if the time hasn't actually changed. + Update anyway if we're updating the timestamp for a non-focused + frame, since the event loop might not have gotten around to + updating that frame's timestamp. */ + if (frame && (explicit_frame || old_time != dpyinfo->last_user_time)) { time = dpyinfo->last_user_time; - while (FRAME_PARENT_FRAME (focus_frame)) - focus_frame = FRAME_PARENT_FRAME (focus_frame); + while (FRAME_PARENT_FRAME (frame)) + frame = FRAME_PARENT_FRAME (frame); - if (FRAME_X_OUTPUT (focus_frame)->user_time_window != None) +#if defined USE_GTK + xg_set_user_timestamp (frame, time); +#else + if (FRAME_X_OUTPUT (frame)->user_time_window != None) XChangeProperty (dpyinfo->display, - FRAME_X_OUTPUT (focus_frame)->user_time_window, + FRAME_X_OUTPUT (frame)->user_time_window, dpyinfo->Xatom_net_wm_user_time, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &time, 1); - } #endif + } +} + +static void +x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, + bool send_event) +{ + x_display_set_last_user_time_1 (dpyinfo, time, send_event, NULL); } #ifdef USE_GTK @@ -25883,9 +25894,11 @@ xembed_request_focus (struct frame *f) XEMBED_REQUEST_FOCUS, 0, 0, 0); } -/* Activate frame with Extended Window Manager Hints */ +/* Activate frame with Extended Window Manager Hints -static void +Return whether we were successful in doing so. */ + +static bool x_ewmh_activate_frame (struct frame *f) { XEvent msg; @@ -25893,8 +25906,7 @@ x_ewmh_activate_frame (struct frame *f) dpyinfo = FRAME_DISPLAY_INFO (f); - if (FRAME_VISIBLE_P (f) - && x_wm_supports (f, dpyinfo->Xatom_net_active_window)) + if (x_wm_supports (f, dpyinfo->Xatom_net_active_window)) { /* See the documentation at https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html @@ -25914,7 +25926,9 @@ x_ewmh_activate_frame (struct frame *f) XSendEvent (dpyinfo->display, dpyinfo->root_window, False, (SubstructureRedirectMask | SubstructureNotifyMask), &msg); + return true; } + return false; } static Lisp_Object @@ -25952,16 +25966,14 @@ x_focus_frame (struct frame *f, bool noactivate) events. See XEmbed Protocol Specification at https://freedesktop.org/wiki/Specifications/xembed-spec/ */ xembed_request_focus (f); - else + else if (noactivate || + (!FRAME_PARENT_FRAME (f) && !x_ewmh_activate_frame (f))) { /* Ignore any BadMatch error this request might result in. */ x_ignore_errors_for_next_request (dpyinfo); XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), RevertToParent, CurrentTime); x_stop_ignoring_errors (dpyinfo); - - if (!noactivate) - x_ewmh_activate_frame (f); } } @@ -28576,6 +28588,55 @@ x_have_any_grab (struct x_display_info *dpyinfo) } #endif +static Bool +server_timestamp_predicate (Display *display, + XEvent *xevent, + XPointer arg) +{ + XID *args = (XID *) arg; + + if (xevent->type == PropertyNotify + && xevent->xproperty.window == args[0] + && xevent->xproperty.atom == args[1]) + return True; + + return False; +} + +static bool +x_get_server_time (struct frame *f, Time *time) +{ + struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); + Atom property_atom = dpyinfo->Xatom_EMACS_SERVER_TIME_PROP; + XEvent event; + + XChangeProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f), + property_atom, XA_ATOM, 32, + PropModeReplace, (unsigned char *) &property_atom, 1); + + if (x_if_event (dpyinfo->display, &event, server_timestamp_predicate, + (XPointer) &(XID[]) {FRAME_OUTER_WINDOW (f), property_atom}, + dtotimespec (XFLOAT_DATA (Vx_wait_for_event_timeout)))) + return false; + *time = event.xproperty.time; + return true; +} + +static void +x_note_oob_interaction (struct frame *f) +{ + while (FRAME_PARENT_FRAME (f)) + f = FRAME_PARENT_FRAME (f); + if (FRAME_LIVE_P (f)) + { + Time server_time; + if (!x_get_server_time (f, &server_time)) + error ("Timed out waiting for server timestamp"); + x_display_set_last_user_time_1 ( + FRAME_DISPLAY_INFO (f), server_time, false, f); + } +} + /* Create a struct terminal, initialize it with the X11 specific functions and make DISPLAY->TERMINAL point to it. */ @@ -28646,6 +28707,7 @@ x_create_terminal (struct x_display_info *dpyinfo) #ifdef HAVE_XINPUT2 terminal->any_grab_hook = x_have_any_grab; #endif + terminal->note_oob_interaction_hook = x_note_oob_interaction; /* Other hooks are NULL by default. */ return terminal; commit 02ee0254873d4c102728c942dc9659f942c5cfa6 Author: Po Lu Date: Sun Aug 7 10:18:14 2022 +0800 Correctly set user time on GTK+ for key press events * src/xterm.c (x_set_gtk_user_time): New function. (handle_one_xevent): Call that after key press event on GTK+. diff --git a/src/xterm.c b/src/xterm.c index 8f84edc63e..97985c8d9e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7586,6 +7586,26 @@ x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, #endif } +#ifdef USE_GTK + +static void +x_set_gtk_user_time (struct frame *f, Time time) +{ + GtkWidget *widget; + GdkWindow *window; + + widget = FRAME_GTK_OUTER_WIDGET (f); + window = gtk_widget_get_window (widget); + + /* This widget isn't realized yet. */ + if (!window) + return; + + gdk_x11_window_set_user_time (window, time); +} + +#endif + /* Not needed on GTK because GTK handles reporting the user time itself. */ @@ -18211,6 +18231,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, x_display_set_last_user_time (dpyinfo, event->xkey.time, event->xkey.send_event); ignore_next_mouse_click_timeout = 0; + coding = Qlatin_1; #if defined (USE_X_TOOLKIT) || defined (USE_GTK) @@ -18221,6 +18242,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, f = any; +#ifdef USE_GTK + if (f) + x_set_gtk_user_time (f, event->xkey.time); +#endif + /* If mouse-highlight is an integer, input clears out mouse highlighting. */ if (!hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight) @@ -21593,6 +21619,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, f = x_any_window_to_frame (dpyinfo, xev->event); + /* GTK handles TAB events in an undesirable manner, so + keyboard events are always dropped. But as a side + effect, the user time will no longer be set by GDK, + so do that manually. */ +#ifdef USE_GTK + if (f) + x_set_gtk_user_time (f, xev->time); +#endif + if (f) { /* If the user interacts with a frame that's focused commit 6706506c2b2a408c561ae86b666daee6aabe1b2f Author: Jonas Bernoulli Date: Sun Aug 7 00:28:18 2022 +0200 * lisp/transient.el: Update to package version v0.3.7-158-gc09b34e diff --git a/lisp/transient.el b/lisp/transient.el index 250201903d..a415858970 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3250,9 +3250,9 @@ have a history of their own.") (goto-char (point-min)) (when transient-enable-popup-navigation (transient--goto-button focus)) - (magit--fit-window-to-buffer transient--window))))) + (transient--fit-window-to-buffer transient--window))))) -(defun magit--fit-window-to-buffer (window) +(defun transient--fit-window-to-buffer (window) (let ((window-resize-pixelwise t) (window-size-fixed nil)) (if (eq (car (window-parameter window 'quit-restore)) 'other) commit e43fa98a71d228475877a4b8d44b96e10c507ffa Author: Alan Mackenzie Date: Sat Aug 6 21:11:18 2022 +0000 CC Mode: Optimize font-locking stanzas for long raw strings. Also replace some regexp searches which had caused regexp engine stack overflows with simple end-of-line calls. * lisp/progmodes/cc-fonts.el (c-make-syntactic-matcher) (c-make-font-lock-search-form): Start the generated functions with a skipping of comments and strings. (c-make-font-lock-BO-decl-search-function): Start the generated function with a (fast) movement to the start of any literal. * lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings) (c-after-change-mark-abnormal-strings): Replace complicated regexp searches for end of logical line with basic Lisp functions. diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 625010b04b..2495d21a10 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -285,6 +285,7 @@ (byte-compile `(lambda (limit) (let (res) + (c-skip-comments-and-strings limit) (while (and (setq res (re-search-forward ,regexp limit t)) (progn (goto-char (match-beginning 0)) @@ -300,43 +301,45 @@ ;; with HIGHLIGHTS, a list of highlighters as specified on page ;; "Search-based Fontification" in the elisp manual. If CHECK-POINT ;; is non-nil, we will check (< (point) limit) in the main loop. - `(while - ,(if check-point - `(and (< (point) limit) - (re-search-forward ,regexp limit t)) - `(re-search-forward ,regexp limit t)) - (unless (progn - (goto-char (match-beginning 0)) - (c-skip-comments-and-strings limit)) - (goto-char (match-end 0)) - ,@(mapcar - (lambda (highlight) - (if (integerp (car highlight)) - ;; e.g. highlight is (1 font-lock-type-face t) - (progn - (unless (eq (nth 2 highlight) t) - (error - "The override flag must currently be t in %s" - highlight)) - (when (nth 3 highlight) - (error - "The laxmatch flag may currently not be set in %s" - highlight)) - `(save-match-data - (c-put-font-lock-face - (match-beginning ,(car highlight)) - (match-end ,(car highlight)) - ,(elt highlight 1)))) - ;; highlight is an "ANCHORED HIGHLIGHTER" of the form - ;; (ANCHORED-MATCHER PRE-FORM POST-FORM SUBEXP-HIGHLIGHTERS...) - (when (nth 3 highlight) - (error "Match highlights currently not supported in %s" + `(progn + (c-skip-comments-and-strings limit) + (while + ,(if check-point + `(and (< (point) limit) + (re-search-forward ,regexp limit t)) + `(re-search-forward ,regexp limit t)) + (unless (progn + (goto-char (match-beginning 0)) + (c-skip-comments-and-strings limit)) + (goto-char (match-end 0)) + ,@(mapcar + (lambda (highlight) + (if (integerp (car highlight)) + ;; e.g. highlight is (1 font-lock-type-face t) + (progn + (unless (eq (nth 2 highlight) t) + (error + "The override flag must currently be t in %s" + highlight)) + (when (nth 3 highlight) + (error + "The laxmatch flag may currently not be set in %s" highlight)) - `(progn - ,(nth 1 highlight) - (save-match-data ,(car highlight)) - ,(nth 2 highlight)))) - highlights)))) + `(save-match-data + (c-put-font-lock-face + (match-beginning ,(car highlight)) + (match-end ,(car highlight)) + ,(elt highlight 1)))) + ;; highlight is an "ANCHORED HIGHLIGHTER" of the form + ;; (ANCHORED-MATCHER PRE-FORM POST-FORM SUBEXP-HIGHLIGHTERS...) + (when (nth 3 highlight) + (error "Match highlights currently not supported in %s" + highlight)) + `(progn + ,(nth 1 highlight) + (save-match-data ,(car highlight)) + ,(nth 2 highlight)))) + highlights))))) (defun c-make-font-lock-search-function (regexp &rest highlights) ;; This function makes a byte compiled function that works much like @@ -416,6 +419,8 @@ ;; lambda more easily. (byte-compile `(lambda (limit) + (let ((lit-start (c-literal-start))) + (when lit-start (goto-char lit-start))) (let ( ;; The font-lock package in Emacs is known to clobber ;; `parse-sexp-lookup-properties' (when it exists). (parse-sexp-lookup-properties diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 70fc1cb73a..ca4df2d1c7 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1518,7 +1518,10 @@ Note that the style variables are always made local to the buffer." ;; Move to end of logical line (as it will be after the change, or as it ;; was before unescaping a NL.) - (re-search-forward "\\(?:\\\\\\(?:.\\|\n\\)\\|[^\\\n\r]\\)*" nil t) + (while + (progn (end-of-line) + (eq (char-before) ?\\)) + (forward-line)) ;; We're at an EOLL or point-max. (if (equal (c-get-char-property (point) 'syntax-table) '(15)) (if (memq (char-after) '(?\n ?\r)) @@ -1636,8 +1639,10 @@ Note that the style variables are always made local to the buffer." (min (1+ end) ; 1+, if we're inside an escaped NL. (point-max)) end)) - (re-search-forward "\\(?:\\\\\\(?:.\\|\n\\)\\|[^\\\n\r]\\)*" - nil t) + (while + (progn (end-of-line) + (eq (char-before) ?\\)) + (forward-line)) (point)) c-new-END)) s) commit b459e275c3824226c260ebe59641f87bb4d26403 Author: Stefan Kangas Date: Sat Aug 6 20:36:13 2022 +0200 Finish up obsoletion of mh-compat.el * lisp/obsolete/mh-compat.el: Add "Obsolete-since" header. * lisp/mh-e/mh-e.el (mh-compat): Don't require. * lisp/mh-e/mh-utils.el (mailabbrev): Require. diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index a3a363e33f..3762445271 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -86,7 +86,6 @@ (require 'cl-lib) (require 'mh-buffers) -(require 'mh-compat) diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index d7a92be5b5..ed32716ffa 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el @@ -29,6 +29,7 @@ (require 'mh-e) (require 'font-lock) +(require 'mailabbrev) ;;; CL Replacements diff --git a/lisp/obsolete/mh-compat.el b/lisp/obsolete/mh-compat.el index b7a1271b4e..8025105083 100644 --- a/lisp/obsolete/mh-compat.el +++ b/lisp/obsolete/mh-compat.el @@ -5,6 +5,7 @@ ;; Author: Bill Wohler ;; Keywords: mail ;; See: mh-e.el +;; Obsolete-since: 29.1 ;; This file is part of GNU Emacs. commit 0a060a2bfe9d86469059584d06a6bbc7764b9d7e Author: Stefan Kangas Date: Sat Aug 6 20:34:45 2022 +0200 Make mh-compat.el obsolete This used to be for XEmacs and old version compatibility, but nowadays everything in this file is obsolete. * lisp/mh-e/mh-compat.el: Move from here... * lisp/obsolete/mh-compat.el: ...to here. diff --git a/lisp/mh-e/mh-compat.el b/lisp/obsolete/mh-compat.el similarity index 100% rename from lisp/mh-e/mh-compat.el rename to lisp/obsolete/mh-compat.el commit f8354d1935c8900a5b8dada7ba564cdd6dafdc93 Author: Stefan Kangas Date: Sat Aug 6 20:33:50 2022 +0200 Move mh-flet macro to mh-acros.el * lisp/mh-e/mh-compat.el (mh-flet): Move from here... * lisp/mh-e/mh-acros.el (mh-flet): ...to here. diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el index 805b0820b0..31630b43ca 100644 --- a/lisp/mh-e/mh-acros.el +++ b/lisp/mh-e/mh-acros.el @@ -269,6 +269,22 @@ MH-E functions." binders) (let* ,binders ,@body)))) +;; Emacs 24 made flet obsolete and suggested either cl-flet or +;; cl-letf. This macro is based upon gmm-flet from Gnus. +(defmacro mh-flet (bindings &rest body) + "Make temporary overriding function definitions. +That is, temporarily rebind the functions listed in BINDINGS and then +execute BODY. BINDINGS is a list containing one or more lists of the +form (FUNCNAME ARGLIST BODY...), similar to defun." + (declare (indent 1) (debug ((&rest (sexp sexp &rest form)) &rest form))) + (if (fboundp 'cl-letf) + `(cl-letf ,(mapcar (lambda (binding) + `((symbol-function ',(car binding)) + (lambda ,@(cdr binding)))) + bindings) + ,@body) + `(flet ,bindings ,@body))) + (provide 'mh-acros) ;; Local Variables: diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el index 27158fc53a..b7a1271b4e 100644 --- a/lisp/mh-e/mh-compat.el +++ b/lisp/mh-e/mh-compat.el @@ -42,22 +42,6 @@ (define-obsolete-function-alias 'mh-assoc-string #'assoc-string "29.1") (define-obsolete-function-alias 'mh-cancel-timer #'cancel-timer "29.1") -;; Emacs 24 made flet obsolete and suggested either cl-flet or -;; cl-letf. This macro is based upon gmm-flet from Gnus. -(defmacro mh-flet (bindings &rest body) - "Make temporary overriding function definitions. -That is, temporarily rebind the functions listed in BINDINGS and then -execute BODY. BINDINGS is a list containing one or more lists of the -form (FUNCNAME ARGLIST BODY...), similar to defun." - (declare (indent 1) (debug ((&rest (sexp sexp &rest form)) &rest form))) - (if (fboundp 'cl-letf) - `(cl-letf ,(mapcar (lambda (binding) - `((symbol-function ',(car binding)) - (lambda ,@(cdr binding)))) - bindings) - ,@body) - `(flet ,bindings ,@body))) - (define-obsolete-function-alias 'mh-display-color-cells #'display-color-cells "29.1") commit db2b5e784b2031f788af455f7056015bd15ce719 Author: Stefan Kangas Date: Sat Aug 6 20:32:59 2022 +0200 Make compat macro mh-display-completion-list obsolete * lisp/mh-e/mh-compat.el (mh-display-completion-list): Make compat macro obsolete. Update callers. diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el index 7a09429e4e..27158fc53a 100644 --- a/lisp/mh-e/mh-compat.el +++ b/lisp/mh-e/mh-compat.el @@ -69,6 +69,7 @@ The optional argument COMMON-SUBSTRING, if non-nil, should be a string specifying a common substring for adding the faces `completions-first-difference' and `completions-common-part' to the completions." + (declare (obsolete nil "29.1")) `(display-completion-list (completion-hilit-commonality ,completions ,(length common-substring) nil))) diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index 4e3e101231..78355101c1 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el @@ -864,16 +864,17 @@ Any match found replaces the text from BEGIN to END." ((stringp completion) (if (equal word completion) (with-output-to-temp-buffer completions-buffer - (mh-display-completion-list - (all-completions word choices) - ;; The `common-substring' arg only works if it's a prefix. - (unless (and (functionp choices) - (let ((bounds - (funcall choices - word nil '(boundaries . "")))) - (and (eq 'boundaries (car-safe bounds)) - (< 0 (cadr bounds))))) - word))) + (display-completion-list + (completion-hilit-commonality + (all-completions word choices) + ;; The `common-substring' arg only works if it's a prefix. + (unless (and (functionp choices) + (let ((bounds + (funcall choices + word nil '(boundaries . "")))) + (and (eq 'boundaries (car-safe bounds)) + (< 0 (cadr bounds))))) + word)))) (ignore-errors (kill-buffer completions-buffer)) (delete-region begin end) commit b9c65203d0f419306ac062e59a59643db9a1a541 Author: Michael Albinus Date: Sat Aug 6 18:09:35 2022 +0200 Adapt Tramp for Android 12 * lisp/net/tramp-adb.el (tramp-methods): Use "%d". (tramp-adb-handle-directory-files-and-attributes): Fix "." and ".." in listing. (tramp-adb-sh-fix-ls-output): Fix file names with spaces. (tramp-adb-maybe-open-connection): Compute args from `tramp-login-args'. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-handle-make-process): Check for adb device if indicated. * test/lisp/net/tramp-tests.el (tramp-test17-insert-directory) (tramp-test22-file-times): Adapt tests. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 918de68ea9..ed51628c4a 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -95,7 +95,7 @@ It is used for TCP/IP devices." (add-to-list 'tramp-methods `(,tramp-adb-method (tramp-login-program ,tramp-adb-program) - (tramp-login-args (("shell"))) + (tramp-login-args (("-s" "%d") ("shell"))) (tramp-direct-async t) (tramp-tmpdir "/data/local/tmp") (tramp-default-port 5555))) @@ -325,6 +325,11 @@ arguments to pass to the OPERATION." (tramp-compat-file-name-concat localname ".")) (tramp-shell-quote-argument (tramp-compat-file-name-concat localname "..")))) + (replace-regexp-in-region + (regexp-quote + (tramp-compat-file-name-unquote + (file-name-as-directory localname))) + "" (point-min)) (widen))) (tramp-adb-sh-fix-ls-output) (tramp-do-parse-file-attributes-with-ls v)))) @@ -357,6 +362,10 @@ arguments to pass to the OPERATION." Android's \"ls\" command doesn't insert size column for directories: Emacs dired can't find files." (save-excursion + ;; Fix file names with spaces. + ;; FIXME: It would be better if we could call "ls" with proper + ;; argument or environment variable. + (replace-string-in-region "\\ " " " (point-min)) ;; Insert missing size. (goto-char (point-min)) (while @@ -1240,9 +1249,8 @@ connection if a previous connection has died for some reason." (with-tramp-progress-reporter vec 3 "Opening adb shell connection" (let* ((coding-system-for-read 'utf-8-dos) ; Is this correct? (process-connection-type tramp-process-connection-type) - (args (if (> (length host) 0) - (list "-s" device "shell") - (list "shell"))) + (args (tramp-expand-args + vec 'tramp-login-args ?d (or device ""))) (p (let ((default-directory tramp-compat-temporary-file-directory)) (apply #'start-process (tramp-get-connection-name vec) buf diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ae31287ece..4cc4ee0722 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -263,6 +263,7 @@ pair of the form (KEY VALUE). The following KEYs are defined: argument if it is supported. - \"%z\" is replaced by the `tramp-scp-direct-remote-copying' argument if it is supported. + - \"%d\" is replaced by the device detected by `tramp-adb-get-device'. The existence of `tramp-login-args', combined with the absence of `tramp-copy-args', is an indication that the @@ -4755,6 +4756,7 @@ substitution. SPEC-LIST is a list of char/value pairs used for ;; is different between tramp-sh.el, and tramp-adb.el or ;; tramp-sshfs.el. (let* ((sh-file-name-handler-p (tramp-sh-file-name-handler-p v)) + (adb-file-name-handler-p (tramp-adb-file-name-p v)) (login-program (tramp-get-method-parameter v 'tramp-login-program)) ;; We don't create the temporary file. In fact, it @@ -4774,6 +4776,10 @@ substitution. SPEC-LIST is a list of char/value pairs used for (when sh-file-name-handler-p (tramp-compat-funcall 'tramp-ssh-controlmaster-options v))) + (device + (when adb-file-name-handler-p + (tramp-compat-funcall + 'tramp-adb-get-device v))) login-args p) ;; Replace `login-args' place holders. Split @@ -4790,7 +4796,7 @@ substitution. SPEC-LIST is a list of char/value pairs used for v 'tramp-login-args ?h (or host "") ?u (or user "") ?p (or port "") ?c (format-spec (or options "") (format-spec-make ?t tmpfile)) - ?l "")))) + ?d (or device "") ?l "")))) p (make-process :name name :buffer buffer :command (append `(,login-program) login-args command) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index e2d4ed781b..e2cafc240b 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -3232,20 +3232,21 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (goto-char (point-min)) (should (looking-at-p (format "^.+ %s/$" (regexp-quote tmp-name1))))) - (with-temp-buffer - (insert-directory - (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p) - (goto-char (point-min)) - (should - (looking-at-p - (concat - ;; There might be a summary line. - "\\(total.+[[:digit:]]+ ?[kKMGTPEZY]?i?B?\n\\)?" - ;; We don't know in which order ".", ".." and "foo" appear. - (format - "\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}" - (regexp-opt (directory-files tmp-name1)) - (length (directory-files tmp-name1))))))) + (let ((directory-files (directory-files tmp-name1))) + (with-temp-buffer + (insert-directory + (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p) + (goto-char (point-min)) + (should + (looking-at-p + (concat + ;; There might be a summary line. + "\\(total.+[[:digit:]]+ ?[kKMGTPEZY]?i?B?\n\\)?" + ;; We don't know in which order ".", ".." and "foo" appear. + (format + "\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}" + (regexp-opt directory-files) + (length directory-files))))))) ;; Check error cases. (when (and (tramp--test-supports-set-file-modes-p) @@ -4167,9 +4168,16 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (file-attributes tmp-name1)) tramp-time-dont-know) (should - (tramp-compat-time-equal-p - (file-attribute-modification-time (file-attributes tmp-name1)) - (seconds-to-time 1))) + (or (tramp-compat-time-equal-p + (file-attribute-modification-time + (file-attributes tmp-name1)) + (seconds-to-time 1)) + ;; Some remote machines cannot resolve seconds. + ;; The return the modification time `(0 0). + (tramp-compat-time-equal-p + (file-attribute-modification-time + (file-attributes tmp-name1)) + (seconds-to-time 0)))) ;; Setting the time for not existing files shall fail. (should-error (set-file-times tmp-name2) @@ -4186,10 +4194,16 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (with-no-warnings (set-file-times tmp-name1 (seconds-to-time 1) 'nofollow) (should - (tramp-compat-time-equal-p - (file-attribute-modification-time - (file-attributes tmp-name1)) - (seconds-to-time 1))))))) + (or (tramp-compat-time-equal-p + (file-attribute-modification-time + (file-attributes tmp-name1)) + (seconds-to-time 1)) + ;; Some remote machines cannot resolve seconds. + ;; The return the modification time `(0 0). + (tramp-compat-time-equal-p + (file-attribute-modification-time + (file-attributes tmp-name1)) + (seconds-to-time 0)))))))) ;; Cleanup. (ignore-errors commit a2127251a5c66f3b7d47fd13893e2e628a8d2105 Author: Eli Zaretskii Date: Sat Aug 6 18:37:57 2022 +0300 ; * src/composite.c: Include stdlib.h. diff --git a/src/composite.c b/src/composite.c index a236bd063b..22422cca09 100644 --- a/src/composite.c +++ b/src/composite.c @@ -24,6 +24,8 @@ along with GNU Emacs. If not, see . */ #include +#include /* for qsort */ + #include "lisp.h" #include "character.h" #include "composite.h" commit 7c8332e096ab92546db38ae27b582971b26cfdfd Author: Stefan Kangas Date: Sat Aug 6 17:00:13 2022 +0200 Fix namespacing problem in allout.el * lisp/allout.el (allout-outlinify-sticky): Rename from 'outlineify-sticky'. Make old name into obsolete alias. (outlinify-sticky): Make into obsolete function alias for 'allout-outlinify-sticky'. (allout-mode): Doc fix. diff --git a/etc/NEWS b/etc/NEWS index bca3c4da78..ea26c5e6ba 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2234,6 +2234,10 @@ remote host are shown. Alternatively, the user option 'proced-show-remote-processes' can be set to non-nil. 'proced-signal-function' has been marked obsolete. +--- +*** 'outlineify-sticky' command is renamed to 'allout-outlinify-sticky'. +The old name is still available as an obsolete function alias. + * New Modes and Packages in Emacs 29.1 diff --git a/lisp/allout.el b/lisp/allout.el index 7421a03738..8e303a8a02 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1699,7 +1699,7 @@ the HOT-SPOT Operation section. Misc commands: ------------- -M-x outlineify-sticky Activate outline mode for current buffer, +\\[allout-outlinify-sticky] Activate outline mode for current buffer, and establish a default file-var setting for `allout-layout'. \\[allout-mark-topic] `allout-mark-topic' @@ -6184,19 +6184,18 @@ save. See `allout-encrypt-unencrypted-on-saves' for more info." ;;;_ #9 miscellaneous ;;;_ : Mode: -;;;_ > outlineify-sticky () -;; outlinify-sticky is correct spelling; provide this alias for sticklers: +;;;_ > allout-outlinify-sticky () ;;;###autoload -(defalias 'outlinify-sticky #'outlineify-sticky) +(define-obsolete-function-alias 'outlinify-sticky #'allout-outlinify-sticky "29.1") ;;;###autoload -(defun outlineify-sticky (&optional _arg) +(define-obsolete-function-alias 'outlineify-sticky #'allout-outlinify-sticky "29.1") +;;;###autoload +(defun allout-outlinify-sticky (&optional _arg) "Activate outline mode and establish file var so it is started subsequently. See `allout-layout' and customization of `allout-auto-activation' for details on preparing Emacs for automatic allout activation." - (interactive "P") - (if (allout-mode-p) (allout-mode)) ; deactivate so we can re-activate... (allout-mode) commit a3e894810a484aeac56d97f13d1c507e3d4eb0d5 Author: Stefan Kangas Date: Sat Aug 6 16:47:22 2022 +0200 Fix defvar-keymap example in elisp manual * lisp/textmodes/text-mode.el (text-mode-map): Convert to defvar-keymap. * doc/lispref/modes.texi (Example Major Modes): Fix example to match code. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index e94093318f..75eb21522f 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1356,11 +1356,10 @@ the conventions listed above: ;; @r{Create the keymap for this mode.} @group (defvar-keymap text-mode-map - "C-M-i" #'ispell-complete-word - @dots{}) - "Keymap for `text-mode'. -Many other modes, such as `mail-mode', `outline-mode' and -`indented-text-mode', inherit all the commands defined in this map.") + :doc "Keymap for `text-mode'. +Many other modes, such as `mail-mode' and `outline-mode', inherit all +the commands defined in this map." + "C-M-i" #'ispell-complete-word) @end group @end smallexample diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index 2275ab2a3c..9e8f3747c5 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -67,13 +67,11 @@ st) "Syntax table used while in `text-mode'.") -(defvar text-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\e\t" #'ispell-complete-word) - map) - "Keymap for `text-mode'. +(defvar-keymap text-mode-map + :doc "Keymap for `text-mode'. Many other modes, such as `mail-mode' and `outline-mode', inherit -all the commands defined in this map.") +all the commands defined in this map." + "C-M-i" #'ispell-complete-word) (easy-menu-define text-mode-menu text-mode-map "Menu for `text-mode'." commit 56783e605c847c5af57fd6382157f75dd6b14e6f Author: Stefan Kangas Date: Sat Aug 6 16:44:29 2022 +0200 Make indented-text-mode alias obsolete * lisp/textmodes/text-mode.el (indented-text-mode): Make compat alias obsolete. * lisp/allout.el (allout-use-hanging-indents): * lisp/emulation/viper.el (viper-vi-state-mode-list): * lisp/textmodes/remember.el (remember-mode): * lisp/textmodes/text-mode.el (text-mode-map): * lisp/vc/ediff-util.el (ediff-choose-syntax-table): Don't mention or use above obsolete alias. diff --git a/lisp/allout.el b/lisp/allout.el index e07bac4ef9..7421a03738 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -394,9 +394,8 @@ else allout's special hanging-indent maintaining auto-fill function, ;;;_ = allout-use-hanging-indents (defcustom allout-use-hanging-indents t "If non-nil, topic body text auto-indent defaults to indent of the header. -Ie, it is indented to be just past the header prefix. This is -relevant mostly for use with `indented-text-mode', or other situations -where auto-fill occurs." +I.e., it is indented to be just past the header prefix. This is +relevant mostly for situations where auto-fill occurs." :type 'boolean :group 'allout) (make-variable-buffer-local 'allout-use-hanging-indents) diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 4c2ee1ce23..d1634c64ad 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -379,7 +379,7 @@ widget." flora-mode sql-mode - text-mode indented-text-mode + text-mode tex-mode latex-mode bibtex-mode ps-mode diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index 9ec7517418..c7a9f20ea2 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -556,7 +556,7 @@ If this is nil, then `diary-file' will be used instead." map) "Keymap used in `remember-mode'.") -(define-derived-mode remember-mode indented-text-mode "Remember" +(define-derived-mode remember-mode text-mode "Remember" "Major mode for output from \\[remember]. This buffer is used to collect data that you want to remember. \\ diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index 076f8dd98f..2275ab2a3c 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -72,8 +72,8 @@ (define-key map "\e\t" #'ispell-complete-word) map) "Keymap for `text-mode'. -Many other modes, such as `mail-mode', `outline-mode' and `indented-text-mode', -inherit all the commands defined in this map.") +Many other modes, such as `mail-mode' and `outline-mode', inherit +all the commands defined in this map.") (easy-menu-define text-mode-menu text-mode-map "Menu for `text-mode'." @@ -164,8 +164,6 @@ Turning on Paragraph-Indent minor mode runs the normal hook (remove-function (local 'indent-line-function) #'indent-to-left-margin))) -(defalias 'indented-text-mode #'text-mode) - ;; This can be made a no-op once all modes that use text-mode-hook ;; are "derived" from text-mode. (As of 2015/04, and probably well before, ;; the only one I can find that doesn't so derive is rmail-edit-mode.) @@ -245,6 +243,8 @@ The argument NLINES says how many lines to center." (setq nlines (1+ nlines)) (forward-line -1))))) +(define-obsolete-function-alias 'indented-text-mode #'text-mode "29.1") + (provide 'text-mode) ;;; text-mode.el ends here diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 3641b75251..1bfab508f8 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -4011,9 +4011,8 @@ Mail anyway? (y or n) ") (defun ediff-choose-syntax-table () (setq ediff-syntax-table (ediff-with-current-buffer ediff-buffer-A - (if (not (memq major-mode - '(fundamental-mode text-mode indented-text-mode))) - (syntax-table)))) + (unless (memq major-mode '(fundamental-mode text-mode)) + (syntax-table)))) (if (not ediff-syntax-table) (setq ediff-syntax-table (ediff-with-current-buffer ediff-buffer-B commit 2bbc5c597445cad9961b2480f31490f93a5d1ffa Author: Stefan Kangas Date: Sat Aug 6 16:29:14 2022 +0200 Make {close,replace}-rectangle compat aliases obsolete * lisp/rect.el (close-rectangle, replace-rectangle): Make compat aliases obsolete. diff --git a/lisp/rect.el b/lisp/rect.el index eebbf999d4..6babd04605 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -407,7 +407,7 @@ no text on the right side of the rectangle." (point)))))) ;;;###autoload -(defalias 'close-rectangle 'delete-whitespace-rectangle) ;; Old name +(define-obsolete-function-alias 'close-rectangle #'delete-whitespace-rectangle "29.1") ;;;###autoload (defun delete-whitespace-rectangle (start end &optional fill) @@ -536,7 +536,7 @@ Called from a program, takes three args; START, END and STRING." (apply-on-rectangle 'string-rectangle-line start end string t))) ;;;###autoload -(defalias 'replace-rectangle 'string-rectangle) +(define-obsolete-function-alias 'replace-rectangle #'string-rectangle "29.1") ;;;###autoload (defun string-insert-rectangle (start end string) commit fad87d84df8eace5f7c0df12c6e657950ec638cb Author: Stefan Kangas Date: Sat Aug 6 16:20:56 2022 +0200 Don't mention test failures on Ubuntu 16.04 in PROBLEMS Ubuntu 16.04 LTS reached end of life on April 30th, 2021. Furthermore, test failures don't seem significant enough to warrant an entry. It's rather cosmetic. * etc/PROBLEMS: Delete entry on test failures on Ubuntu 16.04. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 781a54c06b..c72322811b 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -3546,15 +3546,6 @@ as a macro. If the definition (in both unex*.c and malloc.c) is wrong, it can cause problems like this. You might be able to find the correct value in the man page for a.out(5). -* 'make check' failures - -** emacs-module-tests fail on Ubuntu 16.04 - -This is due to a bug in GCC that was fixed in 2015; see -. -You can work around the problem by using a later version of GCC or of -Ubuntu, or by configuring without modules. - * Problems on legacy systems This section covers bugs reported on very old hardware or software. commit 6223e251a5e2e8c54dcbc0ab642f94a6c4944603 Author: Eli Zaretskii Date: Sat Aug 6 18:00:16 2022 +0300 ; * src/composite.c (Fcomposition_sort_rules): Fix last change. diff --git a/src/composite.c b/src/composite.c index b09b755d34..a236bd063b 100644 --- a/src/composite.c +++ b/src/composite.c @@ -2096,9 +2096,9 @@ of the way buffer text is examined for matching one of the rules. */) } qsort (sortvec, nrules, sizeof (Lisp_Object), compare_composition_rules); rules = Flist (nrules, sortvec); + SAFE_FREE (); } - SAFE_FREE (); return rules; } commit 315b00ff8d7ece419e6026c7fffa182fd5b83a70 Author: Eli Zaretskii Date: Sat Aug 6 17:58:08 2022 +0300 New function 'composition-sort-rules' * src/composite.c (Fcomposition_sort_rules) (compare_composition_rules): New functions. diff --git a/src/composite.c b/src/composite.c index a13839939b..b09b755d34 100644 --- a/src/composite.c +++ b/src/composite.c @@ -2054,6 +2054,54 @@ See `find-composition' for more details. */) return Fcons (make_fixnum (start), Fcons (make_fixnum (end), tail)); } +static int +compare_composition_rules (const void *r1, const void *r2) +{ + Lisp_Object vec1 = *(Lisp_Object *)r1, vec2 = *(Lisp_Object *)r2; + + return XFIXNAT (AREF (vec2, 1)) - XFIXNAT (AREF (vec1, 1)); +} + +DEFUN ("composition-sort-rules", Fcomposition_sort_rules, + Scomposition_sort_rules, 1, 1, 0, + doc: /* Sort composition RULES by their LOOKBACK parameter. + +If RULES include just one rule, return RULES. +Otherwise, return a new list of rules where all the rules are +arranged in decreasing order of the LOOKBACK parameter of the +rules (the second element of the rule's vector). This is required +when combining composition rules from different sources, because +of the way buffer text is examined for matching one of the rules. */) + (Lisp_Object rules) +{ + ptrdiff_t nrules; + USE_SAFE_ALLOCA; + + CHECK_LIST (rules); + nrules = list_length (rules); + if (nrules > 1) + { + ptrdiff_t i; + Lisp_Object *sortvec; + + SAFE_NALLOCA (sortvec, 1, nrules); + for (i = 0; i < nrules; i++) + { + Lisp_Object elt = XCAR (rules); + if (VECTORP (elt) && ASIZE (elt) == 3 && FIXNATP (AREF (elt, 1))) + sortvec[i] = elt; + else + error ("Invalid composition rule in RULES argument"); + rules = XCDR (rules); + } + qsort (sortvec, nrules, sizeof (Lisp_Object), compare_composition_rules); + rules = Flist (nrules, sortvec); + } + + SAFE_FREE (); + return rules; +} + void syms_of_composite (void) @@ -2185,4 +2233,5 @@ This list is auto-generated, you should not need to modify it. */); defsubr (&Sfind_composition_internal); defsubr (&Scomposition_get_gstring); defsubr (&Sclear_composition_cache); + defsubr (&Scomposition_sort_rules); } commit bee6ee9de179a412f6c4b1c072408066e7912ff6 Author: Jonas Bernoulli Date: Sat Aug 6 15:26:15 2022 +0200 * doc/misc/transient.texi: Update to transient v0.3.7-156-ga5562cb Eventually we want to be able to generate "transient.texi" from "transient.org", without having to either give up on idiomatic texinfo or making it much more painful to maintain the org file. We are much closer to that now, but there are still a few areas where additional work is needed. This was mostly accomplished by using Org macros. The most significant outstanding issue is that the generated references don't yet look like an experienced texinfo author like Eli would like them to look. Additionally it is not yet possible to use a macro that produces @dots{} in the places Eli added them, and in Org code blocks it is not possible to use macros, so we cannot have @var{...} appear in "@lisp ... @end lisp". The last issue probably cannot be changed on Org's side, but since there are only two such code blocks, this might be a situation where the compromise has to come from the texinfo side. There are also three other very minor and inconsequential differences. For now I have regenerated the texinfo file from the org file and then discarded the differences mentioned in the previous paragraph. The process of merging (1) Eli's changes to the texinfo file (including, but certainly not limited to markup), (2) changes to the org source (updated content, formatting changes backported earlier, fixes for formatting changes Eli did not fix, etc.) and (3) changes to the code that converts the org source to texinfo, was very laborious and painful. In essence, this amounted to a (at least) three-way merge across three different languages and three repositories. I tried very hard to not waste any of the effort Eli had put into fixing up the generated texinfo file. I.e., I went back and forth making improvements to the org source, implementing org macros, regenerating the texinfo and comparing the remaining difference, and creating commits on both sides. This resulted in a dozen commits on both sides and took me well over a day. I could have put in even more effort to absolutely ensure nothing at all is lost in the process, but I think that would have amounted to a colossal waste of my time. Going forward, if you find unidiomatic texinfo, then please don't fix each instance. Instead write me an email, explaining what the problem is. You are welcome to make limited fixes to the content or fix one-of markup issue in the texinfo file; those are relatively simple to backport in comparison. diff --git a/doc/misc/transient.texi b/doc/misc/transient.texi index d634ad5197..24c3090ef7 100644 --- a/doc/misc/transient.texi +++ b/doc/misc/transient.texi @@ -47,9 +47,9 @@ General Public License for more details. Taking inspiration from prefix keys and prefix arguments, Transient implements a similar abstraction involving a prefix command, infix arguments and suffix commands. We could call this abstraction a -``transient command'', but because it always involves at least two +“transient command”, but because it always involves at least two commands (a prefix and a suffix) we prefer to call it just a -``transient''. +“transient”. When the user calls a transient prefix command, a transient (temporary) keymap is activated, which binds the transient's infix @@ -97,7 +97,7 @@ Usage * Getting Help for Suffix Commands:: * Enabling and Disabling Suffixes:: * Other Commands:: -* Other Options:: +* Configuration:: Defining New Commands @@ -144,20 +144,20 @@ Related Abstractions and Packages Taking inspiration from prefix keys and prefix arguments, Transient implements a similar abstraction involving a prefix command, infix arguments and suffix commands. We could call this abstraction a -``transient command'', but because it always involves at least two +“transient command”, but because it always involves at least two commands (a prefix and a suffix) we prefer to call it just a -``transient''. +“transient”. +@cindex transient prefix command @quotation Transient keymaps are a feature provided by Emacs. Transients as implemented by this package involve the use of transient keymaps. -@cindex transient prefix command Emacs provides a feature that it calls @dfn{prefix commands}. When we -talk about ``prefix commands'' in this manual, then we mean our own kind -of ``prefix commands'', unless specified otherwise. To avoid ambiguity +talk about “prefix commands” in this manual, then we mean our own kind +of “prefix commands”, unless specified otherwise. To avoid ambiguity we sometimes use the terms @dfn{transient prefix command} for our kind and -``regular prefix command'' for the Emacs' kind. +“regular prefix command” for Emacs' kind. @end quotation @@ -208,7 +208,7 @@ looks a bit like this: @quotation This is a simplified version of @code{magit-tag}. Info manuals do not -support images or colored text, so the above ``screenshot'' lacks some +support images or colored text, so the above “screenshot” lacks some information; in practice you would be able to tell whether the arguments @code{--force} and @code{--annotate} are enabled or not based on their color. @@ -216,11 +216,11 @@ color. @end quotation @cindex command dispatchers -Transient can be used to implement simple ``command dispatchers''. The +Transient can be used to implement simple “command dispatchers”. The main benefit then is that the user can see all the available commands in a popup buffer. That is useful by itself because it frees the user from having to remember all the keys that are valid after a certain -prefix key or command. Magit's @code{magit-dispatch} (on @code{C-x M-g}) command is +prefix key or command. Magit's @code{magit-dispatch} (on @kbd{C-x M-g}) command is an example of using Transient to merely implement a command dispatcher. @@ -235,22 +235,22 @@ argument means to a certain command. Transient suffix commands, on the other hand, can accept dozens of different arguments without the user having to remember anything. -When using Transient, one can call a command with arguments that -are just as complex as when calling the same function non-interactively +When using Transient, one can call a command with arguments that are +just as complex as when calling the same function non-interactively from Lisp. Invoking a transient command with arguments is similar to invoking a command in a shell with command-line completion and history enabled. One benefit of the Transient interface is that it remembers history -not only on a global level (``this command was invoked using these -arguments, and previously it was invoked using those other arguments''), +not only on a global level (“this command was invoked using these +arguments, and previously it was invoked using those other arguments”), but also remembers the values of individual arguments independently. @xref{Using History}. -After a transient prefix command is invoked, @kbd{C-h @var{key}} can be used to -show the documentation for the infix or suffix command that @kbd{@var{key}} is +After a transient prefix command is invoked, @kbd{C-h @var{KEY}} can be used to +show the documentation for the infix or suffix command that @kbd{@var{KEY}} is bound to (@pxref{Getting Help for Suffix Commands}), and infixes and -suffixes can be removed from the transient using @kbd{C-x l @var{key}}. Infixes +suffixes can be removed from the transient using @kbd{C-x l @var{KEY}}. Infixes and suffixes that are disabled by default can be enabled the same way. @xref{Enabling and Disabling Suffixes}. @@ -273,11 +273,12 @@ to implementing yet). * Getting Help for Suffix Commands:: * Enabling and Disabling Suffixes:: * Other Commands:: -* Other Options:: +* Configuration:: @end menu @node Invoking Transients @section Invoking Transients + @cindex invoking transients A transient prefix command is invoked like any other command by @@ -290,9 +291,9 @@ disabled while the transient state is in effect. There are two kinds of commands that are available after invoking a transient prefix command; infix and suffix commands. Infix commands set some value (which is then shown in a popup buffer), without -leaving the transient. Suffix commands, on the other hand, usually quit -the transient and they may use the values set by the infix commands, -i.e.@: the infix @strong{arguments}. +leaving the transient. Suffix commands, on the other hand, usually +quit the transient and they may use the values set by the infix +commands, i.e., the infix @strong{arguments}. Instead of setting arguments to be used by a suffix command, infix commands may also set some value by side-effect, e.g., by setting the @@ -300,11 +301,12 @@ value of some variable. @node Aborting and Resuming Transients @section Aborting and Resuming Transients + @cindex aborting transients @cindex resuming transients @cindex quit transient -To quit the transient without invoking a suffix command press @code{C-g}. +To quit the transient without invoking a suffix command press @kbd{C-g}. Key bindings in transient keymaps may be longer than a single event. After pressing a valid prefix key, all commands whose bindings do not @@ -314,7 +316,7 @@ prefix key, but not the complete transient). A transient prefix command can be bound as a suffix of another transient. Invoking such a suffix replaces the current transient -state with a new transient state, i.e.@: the available bindings change +state with a new transient state, i.e., the available bindings change and the information displayed in the popup buffer is updated accordingly. Pressing @kbd{C-g} while a nested transient is active only quits the innermost transient, causing a return to the previous @@ -325,13 +327,12 @@ the latter, then you can later resume the stack of transients using @kbd{M-x transient-resume}. @table @asis +@item @kbd{C-g} (@code{transient-quit-seq}) +@itemx @kbd{C-g} (@code{transient-quit-one}) @kindex C-g -@findex transient-quit-seq -@item @kbd{C-g} @tie{}@tie{}@tie{}@tie{}(@code{transient-quit-seq}) @kindex C-g +@findex transient-quit-seq @findex transient-quit-one -@item @kbd{C-g} @tie{}@tie{}@tie{}@tie{}(@code{transient-quit-one}) - This key quits the currently active incomplete key sequence, if any, or else the current transient. When quitting the current transient, it returns to the previous transient, if any. @@ -342,22 +343,20 @@ To learn how to get that binding back see @code{transient-bind-q-to-quit}'s doc string. @table @asis +@item @kbd{C-q} (@code{transient-quit-all}) @kindex C-q @findex transient-quit-all -@item @kbd{C-q} @tie{}@tie{}@tie{}@tie{}(@code{transient-quit-all}) - This command quits the currently active incomplete key sequence, if any, and all transients, including the active transient and all suspended transients, if any. +@item @kbd{C-z} (@code{transient-suspend}) @kindex C-z @findex transient-suspend -@item @kbd{C-z} @tie{}@tie{}@tie{}@tie{}(@code{transient-suspend}) - Like @code{transient-quit-all}, this command quits an incomplete key sequence, if any, and all transients. Additionally, it saves the stack of transients so that it can easily be resumed (which is -particularly useful if you quickly need to do ``something else'', and +particularly useful if you quickly need to do “something else” and the stack is deeper than a single transient, and/or you have already changed the values of some infix arguments). @@ -365,43 +364,39 @@ Note that only a single stack of transients can be saved at a time. If another stack is already saved, then saving a new stack discards the previous stack. -@kindex M-x transient-resume +@item @kbd{M-x transient-resume} @findex transient-resume -@item @kbd{M-x transient-resume} @tie{}@tie{}@tie{}@tie{}(@code{transient-resume}) - This command resumes the previously suspended stack of transients, if any. @end table @node Common Suffix Commands @section Common Suffix Commands + @cindex common suffix commands A few shared suffix commands are available in all transients. These suffix commands are not shown in the popup buffer by default. -This includes the aborting commands mentioned in the previous section, as -well as some other commands that are all bound to @kbd{C-x @var{key}}. After +This includes the aborting commands mentioned in the previous section, +as well as some other commands that are all bound to @kbd{C-x @var{KEY}}. After @kbd{C-x} is pressed, a section featuring all these common commands is temporarily shown in the popup buffer. After invoking one of them, -the section disappears again. Note, however, that one of these commands -is described as ``Show common permanently''; invoke that if you want the -common commands to always be shown for all transients. +the section disappears again. Note, however, that one of these +commands is described as “Show common permanently”; invoke that if you +want the common commands to always be shown for all transients. @table @asis +@item @kbd{C-x t} (@code{transient-toggle-common}) @kindex C-x t @findex transient-toggle-common -@item @kbd{C-x t} @tie{}@tie{}@tie{}@tie{}(@code{transient-toggle-common}) - This command toggles whether the generic commands that are common to all transients are always displayed or only after typing the incomplete prefix key sequence @kbd{C-x}. This only affects the current Emacs session. - @end table @defopt transient-show-common-commands - This option controls whether shared suffix commands are shown alongside the transient-specific infix and suffix commands. By default, the shared commands are not shown to avoid overwhelming @@ -412,14 +407,15 @@ commands. The value of this option can be changed for the current Emacs session by typing @kbd{C-x t} while a transient is active. @end defopt -The other common commands are described in either the previous or -in one of the following sections. +The other common commands are described in either the previous or in +one of the following sections. Some of Transient's key bindings differ from the respective bindings of Magit-Popup; see @ref{FAQ} for more information. @node Saving Values @section Saving Values + @cindex saving values of arguments After setting the infix arguments in a transient, the user can save @@ -429,8 +425,7 @@ Most transients will start out with the saved arguments when they are invoked. There are a few exceptions, though. Some transients are designed so that the value that they use is stored externally as the buffer-local value of some variable. Invoking such a transient again -uses the buffer-local value.@footnote{ -@code{magit-diff} and @code{magit-log} are two prominent examples, and their +uses the buffer-local value. @footnote{@code{magit-diff} and @code{magit-log} are two prominent examples, and their handling of buffer-local values is actually a bit more complicated than outlined above and even customizable.} @@ -440,30 +435,32 @@ history. That value won't be used when the transient is next invoked, but it is easily accessible (@pxref{Using History}). @table @asis +@item @kbd{C-x s} (@code{transient-set}) @kindex C-x s @findex transient-set -@item @kbd{C-x s} @tie{}@tie{}@tie{}@tie{}(@code{transient-set}) - This command saves the value of the active transient for this Emacs session. +@item @kbd{C-x C-s} (@code{transient-save}) @kindex C-x C-s @findex transient-save -@item @kbd{C-x C-s} @tie{}@tie{}@tie{}@tie{}(@code{transient-save}) - Save the value of the active transient persistently across Emacs sessions. +@item @kbd{C-x C-k} (@code{transient-save}) +@kindex C-x C-k +@findex transient-save +Clear the set and saved value of the active transient. @end table @defopt transient-values-file - This option names the file that is used to persist the values of transients between Emacs sessions. @end defopt @node Using History @section Using History + @cindex value history Every time the user invokes a suffix command the transient's current @@ -472,32 +469,28 @@ same way one can cycle through the history of commands that read user-input in the minibuffer. @table @asis +@item @kbd{C-M-p} (@code{transient-history-prev}) +@itemx @kbd{C-x p} @kindex C-M-p -@findex transient-history-prev -@item @kbd{C-M-p} @tie{}@tie{}@tie{}@tie{}(@code{transient-history-prev}) @kindex C-x p @findex transient-history-prev -@item @kbd{C-x p} @tie{}@tie{}@tie{}@tie{}(@code{transient-history-prev}) - This command switches to the previous value used for the active transient. +@item @kbd{C-M-n} (@code{transient-history-next}) +@itemx @kbd{C-x n} @kindex C-M-n -@findex transient-history-next -@item @kbd{C-M-n} @tie{}@tie{}@tie{}@tie{}(@code{transient-history-next}) @kindex C-x n @findex transient-history-next -@item @kbd{C-x n} @tie{}@tie{}@tie{}@tie{}(@code{transient-history-next}) - This command switches to the next value used for the active transient. @end table In addition to the transient-wide history, Transient of course supports per-infix history. When an infix reads user-input using the -minibuffer, the user can use the regular minibuffer history -commands to cycle through previously used values. Usually the same -keys as those mentioned above are bound to those commands. +minibuffer, the user can use the regular minibuffer history commands +to cycle through previously used values. Usually the same keys as +those mentioned above are bound to those commands. Authors of transients should arrange for different infix commands that read the same kind of value to also use the same history key @@ -506,19 +499,18 @@ read the same kind of value to also use the same history key Both kinds of history are saved to a file when Emacs is exited. @defopt transient-history-file - This option names the file that is used to persist the history of transients and their infixes between Emacs sessions. @end defopt @defopt transient-history-limit - This option controls how many history elements are kept at the time the history is saved in @code{transient-history-file}. @end defopt @node Getting Help for Suffix Commands @section Getting Help for Suffix Commands + @cindex getting help Transients can have many suffixes and infixes that the user might not @@ -527,14 +519,13 @@ provides access to the documentation directly from the active transient. @table @asis +@item @kbd{C-h} (@code{transient-help}) @kindex C-h @findex transient-help -@item @kbd{C-h} @tie{}@tie{}@tie{}@tie{}(@code{transient-help}) - -This command enters help mode. When help mode is active, -typing a key shows information about the suffix command that the key -is normally bound to (instead of invoking it). Pressing @kbd{C-h} a -second time shows information about the @emph{prefix} command. +This command enters help mode. When help mode is active, typing a +key shows information about the suffix command that the key normally +is bound to (instead of invoking it). Pressing @kbd{C-h} a second time +shows information about the @emph{prefix} command. After typing a key, the stack of transient states is suspended and information about the suffix command is shown instead. Typing @kbd{q} in @@ -550,6 +541,7 @@ non-infix suffixes this is usually appropriate. @node Enabling and Disabling Suffixes @section Enabling and Disabling Suffixes + @cindex enabling suffixes @cindex disabling suffixes @@ -571,7 +563,7 @@ displayed at any level. The levels of individual transients and/or their individual suffixes can be changed interactively, by invoking the transient and then -pressing @kbd{C-x l} to enter the ``edit'' mode, see below. +pressing @kbd{C-x l} to enter the “edit” mode, see below. The default level for both transients and their suffixes is 4. The @code{transient-default-level} option only controls the default for @@ -582,23 +574,20 @@ very important suffixes on a lower level, so that they remain available even if the user lowers the transient level. @defopt transient-default-level - This option controls which suffix levels are made available by default. It sets the transient-level for transients for which the user has not set that individually. @end defopt @defopt transient-levels-file - This option names the file that is used to persist the levels of transients and their suffixes between Emacs sessions. @end defopt @table @asis +@item @kbd{C-x l} (@code{transient-set-level}) @kindex C-x l @findex transient-set-level -@item @kbd{C-x l} @tie{}@tie{}@tie{}@tie{}(@code{transient-set-level}) - This command enters edit mode. When edit mode is active, then all infixes and suffixes that are currently usable are displayed along with their levels. The colors of the levels indicate whether they @@ -616,9 +605,9 @@ To change the transient level press @kbd{C-x l} again. To exit edit mode press @kbd{C-g}. Note that edit mode does not display any suffixes that are not -currently usable. @code{magit-rebase}, for example, shows different suffixes -depending on whether a rebase is already in progress or not. The -predicates also apply in edit mode. +currently usable. @code{magit-rebase}, for example, shows different +suffixes depending on whether a rebase is already in progress or +not. The predicates also apply in edit mode. Therefore, to control which suffixes are available given a certain state, you have to make sure that that state is currently active. @@ -633,27 +622,29 @@ following commands. These commands are never shown in the transient window, and the key bindings are the same as for @code{scroll-up-command} and @code{scroll-down-command} in other buffers. -@findex transient-scroll-up arg @deffn Command transient-scroll-up arg - -This command scrolls text of transient popup window upward @var{arg} -lines. If @var{arg} is @code{nil}, then it scrolls near full screen. This +This command scrolls text of transient popup window upward @var{ARG} +lines. If @var{ARG} is @code{nil}, then it scrolls near full screen. This is a wrapper around @code{scroll-up-command} (which see). @end deffn -@findex transient-scroll-down arg @deffn Command transient-scroll-down arg - -This command scrolls text of transient popup window down @var{arg} -lines. If @var{arg} is @code{nil}, then it scrolls near full screen. This +This command scrolls text of transient popup window down @var{ARG} +lines. If @var{ARG} is @code{nil}, then it scrolls near full screen. This is a wrapper around @code{scroll-down-command} (which see). @end deffn -@node Other Options -@section Other Options +@node Configuration +@section Configuration -@defopt transient-show-popup +More options are described in @ref{Common Suffix Commands}, in @ref{Saving Values}, in @ref{Using History} and in @ref{Enabling and Disabling Suffixes}. + +@anchor{Essential Options} +@subheading Essential Options + +Also see @ref{Common Suffix Commands}. +@defopt transient-show-popup This option controls whether the current transient's infix and suffix commands are shown in the popup buffer. @@ -662,13 +653,11 @@ suffix commands are shown in the popup buffer. If @code{t} (the default) then the popup buffer is shown as soon as a transient prefix command is invoked. - @item If @code{nil}, then the popup buffer is not shown unless the user explicitly requests it, by pressing an incomplete prefix key sequence. - @item If a number, then the a brief one-line summary is shown instead of the popup buffer. If zero or negative, then not even that summary @@ -676,45 +665,43 @@ is shown; only the pressed key itself is shown. The popup is shown when the user explicitly requests it by pressing an incomplete prefix key sequence. Unless this is zero, -the popup is shown after that many seconds of inactivity -(using the absolute value). +the popup is shown after that many seconds of inactivity (using +the absolute value). @end itemize @end defopt @defopt transient-enable-popup-navigation - This option controls whether navigation commands are enabled in the transient popup buffer. While a transient is active the transient popup buffer is not the current buffer, making it necessary to use dedicated commands to act on that buffer itself. This is disabled by default. If this option -is non-nil, then the following features are available: +is non-@code{nil}, then the following features are available: @itemize @item -@key{UP} moves the cursor to the previous suffix. -@key{DOWN} moves the cursor to the next suffix. -@key{RET} invokes the suffix the cursor is on. - +@kbd{@key{UP}} moves the cursor to the previous suffix. @item -@key{mouse-1} invokes the clicked on suffix. - +@kbd{@key{DOWN}} moves the cursor to the next suffix. +@item +@kbd{@key{RET}} invokes the suffix the cursor is on. +@item +@kbd{mouse-1} invokes the clicked on suffix. @item @kbd{C-s} and @kbd{C-r} start isearch in the popup buffer. @end itemize @end defopt @defopt transient-display-buffer-action - This option specifies the action used to display the transient popup buffer. The transient popup buffer is displayed in a window using -@code{(display-buffer @var{buffer} transient-display-buffer-action)}. +@code{(display-buffer @var{BUFFER} transient-display-buffer-action)}. -The value of this option has the form @code{(@var{function} . @var{alist})}, -where @var{function} is a function or a list of functions. Each such +The value of this option has the form @code{(@var{FUNCTION} . @var{ALIST})}, +where @var{FUNCTION} is a function or a list of functions. Each such function should accept two arguments: a buffer to display and an -alist of the same form as @var{alist}. @xref{Choosing Window,,,elisp,}, +alist of the same form as @var{ALIST}. @xref{Choosing Window,,,elisp,}, for details. The default is: @@ -727,7 +714,7 @@ The default is: @end lisp This displays the window at the bottom of the selected frame. -Another useful @var{function} is @code{display-buffer-below-selected}, which +Another useful @var{FUNCTION} is @code{display-buffer-below-selected}, which is what @code{magit-popup} used by default. For more alternatives see @ref{Buffer Display Action Functions,,,elisp,}, and see @ref{Buffer Display Action Alists,,,elisp,}. @@ -748,8 +735,20 @@ If you change the value of this option, then you might also want to change the value of @code{transient-mode-line-format}. @end defopt -@defopt transient-mode-line-format +@anchor{Accessibility Options} +@subheading Accessibility Options + +@defopt transient-force-single-column +This option controls whether the use of a single column to display +suffixes is enforced. This might be useful for users with low +vision who use large text and might otherwise have to scroll in two +dimensions. +@end defopt + +@anchor{Auxiliary Options} +@subheading Auxiliary Options +@defopt transient-mode-line-format This option controls whether the transient popup buffer has a mode-line, separator line, or neither. @@ -759,23 +758,28 @@ good value. If @code{line} (the default), then the buffer also has no mode-line, but a thin line is drawn instead, using the background color of the face -@code{transient-separator}. Text-mode frames cannot display thin lines, and -therefore fall back to treating @code{line} like @code{nil}. +@code{transient-separator}. Text-mode frames cannot display thin lines, +and therefore fall back to treating @code{line} like @code{nil}. Otherwise this can be any mode-line format. @xref{Mode Line Format,,,elisp,}, for details. @end defopt -@defopt transient-read-with-initial-input +@defopt transient-semantic-coloring +This option controls whether prefixes and suffixes are colored in +a Hydra-like fashion. -This option controls whether the last history element is used as the -initial minibuffer input when reading the value of an infix argument -from the user. If @code{nil}, there is no initial input and the first -element has to be accessed the same way as the older elements. +If non-@code{nil}, then the key binding of each suffix is colorized to +indicate whether it exits the transient state or not. The color of +the prefix is indicated using the line that is drawn when the value +of @code{transient-mode-line-format} is @code{line}. + +For more information about how Hydra uses colors see +@uref{https://github.com/abo-abo/hydra#color} and +@uref{https://oremacs.com/2015/02/19/hydra-colors-reloaded}. @end defopt @defopt transient-highlight-mismatched-keys - This option controls whether key bindings of infix commands that do not match the respective command-line argument should be highlighted. For other infix commands this option has no effect. @@ -795,7 +799,6 @@ The highlighting is done using one of the faces @end defopt @defopt transient-substitute-key-function - This function is used to modify key bindings. If the value of this option is @code{nil} (the default), then no substitution is performed. @@ -819,14 +822,52 @@ optimized for lisp. @end lisp @end defopt -@defopt transient-detect-key-conflicts +@defopt transient-read-with-initial-input +This option controls whether the last history element is used as the +initial minibuffer input when reading the value of an infix argument +from the user. If @code{nil}, there is no initial input and the first +element has to be accessed the same way as the older elements. +@end defopt + +@defopt transient-hide-during-minibuffer-read +This option controls whether the transient buffer is hidden while +user input is being read in the minibuffer. +@end defopt + +@defopt transient-align-variable-pitch +This option controls whether columns are aligned pixel-wise in the +popup buffer. + +If this is non-@code{nil}, then columns are aligned pixel-wise to support +variable-pitch fonts. Keys are not aligned, so you should use a +fixed-pitch font for the @code{transient-key} face. Other key faces +inherit from that face unless a theme is used that breaks that +relationship. + +This option is intended for users who use a variable-pitch font for +the @code{default} face. +@end defopt + +@defopt transient-force-fixed-pitch +This option controls whether to force the use of a monospaced font +in popup buffer. Even if you use a proportional font for the +@code{default} face, you might still want to use a monospaced font in +transient's popup buffer. Setting this option to @code{t} causes @code{default} +to be remapped to @code{fixed-pitch} in that buffer. +@end defopt + +@anchor{Developer Options} +@subheading Developer Options +These options are mainly intended for developers. + +@defopt transient-detect-key-conflicts This option controls whether key binding conflicts should be -detected at the time the transient is invoked. If so, this -results in an error, which prevents the transient from being used. -Because of that, conflicts are ignored by default. +detected at the time the transient is invoked. If so, this results +in an error, which prevents the transient from being used. Because +of that, conflicts are ignored by default. -Conflicts cannot be determined earlier, i.e.@: when the transient is +Conflicts cannot be determined earlier, i.e., when the transient is being defined and when new suffixes are being added, because at that time there can be false-positives. It is actually valid for multiple suffixes to share a common key binding, provided the @@ -834,48 +875,51 @@ predicates of those suffixes prevent that more than one of them is enabled at a time. @end defopt -@defopt transient-force-fixed-pitch +@defopt transient-highlight-higher-levels +This option controls whether suffixes that would not be available by +default are highlighted. -This option controls whether to force the use of a monospaced font -in popup buffer. Even if you use a proportional font for the -@code{default} face, you might still want to use a monospaced font in -transient's popup buffer. Setting this option to @code{t} causes @code{default} -to be remapped to @code{fixed-pitch} in that buffer. +When non-@code{nil} then the descriptions of suffixes are highlighted if +their level is above 4, the default of @code{transient-default-level}. +Assuming you have set that variable to 7, this highlights all +suffixes that won't be available to users without them making the +same customization. @end defopt @node Modifying Existing Transients @chapter Modifying Existing Transients + @cindex modifying existing transients -To an extent, transients can be customized interactively, see @ref{Enabling and Disabling Suffixes}. This section explains how existing transients -can be further modified non-interactively. +To an extent, transients can be customized interactively, see +@ref{Enabling and Disabling Suffixes}. This section explains how existing +transients can be further modified non-interactively. The following functions share a few arguments: @itemize @item -@var{prefix} is a transient prefix command, a symbol. - +@var{PREFIX} is a transient prefix command, a symbol. @item -@var{suffix} is a transient infix or suffix specification in the same form +@var{SUFFIX} is a transient infix or suffix specification in the same form as expected by @code{transient-define-prefix}. Note that an infix is a -special kind of suffix. Depending on context ``suffixes'' means -``suffixes (including infixes)'' or ``non-infix suffixes''. Here it +special kind of suffix. Depending on context “suffixes” means +“suffixes (including infixes)” or “non-infix suffixes”. Here it means the former. @xref{Suffix Specifications}. -@var{suffix} may also be a group in the same form as expected by +@var{SUFFIX} may also be a group in the same form as expected by @code{transient-define-prefix}. @xref{Group Specifications}. @item -@var{loc} is a command, a key vector, a key description (a string as +@var{LOC} is a command, a key vector, a key description (a string as returned by @code{key-description}), or a list specifying coordinates (the last element may also be a command or key). For example @code{(1 0 -1)} identifies the last suffix (@code{-1}) of the first subgroup (@code{0}) of the second group (@code{1}). -If @var{loc} is a list of coordinates, then it can be used to identify a +If @var{LOC} is a list of coordinates, then it can be used to identify a group, not just an individual suffix command. The function @code{transient-get-suffix} can be useful to determine whether @@ -885,55 +929,53 @@ at the definition of the transient prefix command. @end itemize These functions operate on the information stored in the -@code{transient--layout} property of the @var{prefix} symbol. Suffix entries in -that tree are not objects but have the form @code{(@var{level} -@var{class} @var{plist})}, where -@var{plist} should set at least @code{:key}, @code{:description} and -@code{:command}. - -@defun transient-insert-suffix prefix loc suffix +@code{transient--layout} property of the @var{PREFIX} symbol. Suffix entries in +that tree are not objects but have the form @code{(@var{LEVEL} @var{CLASS} @var{PLIST})}, where +@var{PLIST} should set at least @code{:key}, @code{:description} and @code{:command}. -This function inserts suffix or group @var{suffix} into @var{prefix} -before @var{loc}. +@defun transient-insert-suffix prefix loc suffix &optional keep-other @end defun - -@defun transient-append-suffix prefix loc suffix - -This function inserts suffix or group @var{suffix} into @var{prefix} -after @var{loc}. +@defun transient-append-suffix prefix loc suffix &optional keep-other +These functions insert the suffix or group @var{SUFFIX} into @var{PREFIX} before +or after @var{LOC}. + +Conceptually adding a binding to a transient prefix is similar to +adding a binding to a keymap, but this is complicated by the fact +that multiple suffix commands can be bound to the same key, provided +they are never active at the same time, see @ref{Predicate Slots}. + +Unfortunately both false-positives and false-negatives are possible. +To deal with the former use non-nil @var{KEEP-OTHER@.} To deal with the +latter remove the conflicting binding explicitly. @end defun @defun transient-replace-suffix prefix loc suffix - -This function replaces the suffix or group at @var{loc} in @var{prefix} with -suffix or group @var{suffix}. +This function replaces the suffix or group at @var{LOC} in @var{PREFIX} with +suffix or group @var{SUFFIX}. @end defun @defun transient-remove-suffix prefix loc - -This function removes the suffix or group at @var{loc} in @var{prefix}. +This function removes the suffix or group at @var{LOC} in @var{PREFIX}. @end defun @defun transient-get-suffix prefix loc - -This function returns the suffix or group at @var{loc} in @var{prefix}. The +This function returns the suffix or group at @var{LOC} in @var{PREFIX}. The returned value has the form mentioned above. @end defun @defun transient-suffix-put prefix loc prop value - -This function edits the suffix or group at @var{loc} in @var{prefix}, -by setting the @var{prop} of its plist to @var{value}. +This function edits the suffix or group at @var{LOC} in @var{PREFIX}, by setting +the @var{PROP} of its plist to @var{VALUE}. @end defun Most of these functions do not signal an error if they cannot perform the requested modification. The functions that insert new suffixes -show a warning if @var{loc} cannot be found in @var{prefix}, without -signaling an error. The reason for doing it like this is that -establishing a key binding (and that is what we essentially are trying -to do here) should not prevent the rest of the configuration from -loading. Among these functions only @code{transient-get-suffix} and -@code{transient-suffix-put} may signal an error. +show a warning if @var{LOC} cannot be found in @var{PREFIX} without signaling an +error. The reason for doing it like this is that establishing a key +binding (and that is what we essentially are trying to do here) should +not prevent the rest of the configuration from loading. Among these +functions only @code{transient-get-suffix} and @code{transient-suffix-put} may +signal an error. @node Defining New Commands @chapter Defining New Commands @@ -957,12 +999,11 @@ defines the complete transient, not just the transient prefix command that is used to invoke that transient. @defmac transient-define-prefix name arglist [docstring] [keyword value]@dots{} group@dots{} [body@dots{}] - -This macro defines @var{name} as a transient prefix command and binds the +This macro defines @var{NAME} as a transient prefix command and binds the transient's infix and suffix commands. -@var{arglist} are the arguments that the prefix command takes. -@var{docstring} is the documentation string and is optional. +@var{ARGLIST} are the arguments that the prefix command takes. +@var{DOCSTRING} is the documentation string and is optional. These arguments can optionally be followed by keyword-value pairs. Each key has to be a keyword symbol, either @code{:class} or a keyword @@ -970,11 +1011,11 @@ argument supported by the constructor of that class. The @code{transient-prefix} class is used if the class is not specified explicitly. -@var{group}s add key bindings for infix and suffix commands and specify +@var{GROUP}s add key bindings for infix and suffix commands and specify how these bindings are presented in the popup buffer. At least one -@var{group} has to be specified. @xref{Binding Suffix and Infix Commands}. +@var{GROUP} has to be specified. @xref{Binding Suffix and Infix Commands}. -The @var{body} is optional. If it is omitted, then @var{arglist} is ignored and +The @var{BODY} is optional. If it is omitted, then @var{ARGLIST} is ignored and the function definition becomes: @lisp @@ -983,15 +1024,15 @@ the function definition becomes: (transient-setup 'NAME)) @end lisp -If @var{body} is specified, then it must begin with an @code{interactive} form -that matches @var{arglist}, and it must call @code{transient-setup}. It may, +If @var{BODY} is specified, then it must begin with an @code{interactive} form +that matches @var{ARGLIST}, and it must call @code{transient-setup}. It may, however, call that function only when some condition is satisfied. @cindex scope of a transient All transients have a (possibly @code{nil}) value, which is exported when suffix commands are called, so that they can consume that value. For some transients it might be necessary to have a sort of -secondary value, called a ``scope''. Such a scope would usually be +secondary value, called a “scope”. Such a scope would usually be set in the command's @code{interactive} form and has to be passed to the setup function: @@ -1013,8 +1054,8 @@ described below. Users and third-party packages can add additional bindings using functions such as @code{transient-insert-suffix} (@pxref{Modifying -Existing Transients}). These functions take a ``suffix -specification'' as one of their arguments, which has the same form as +Existing Transients}). These functions take a “suffix +specification” as one of their arguments, which has the same form as the specifications used in @code{transient-define-prefix}. @menu @@ -1024,6 +1065,7 @@ the specifications used in @code{transient-define-prefix}. @node Group Specifications @subsection Group Specifications + @cindex group specifications The suffix and infix commands of a transient are organized in groups. @@ -1043,39 +1085,39 @@ brackets to do the latter. Group specifications then have this form: @lisp -[@{@var{level}@} @{@var{description}@} - @{@var{keyword} @var{value}@}... - @var{element}...] +[@{@var{LEVEL}@} @{@var{DESCRIPTION}@} + @{@var{KEYWORD} @var{VALUE}@}... + @var{ELEMENT}...] @end lisp -The @var{level} is optional and defaults to 4. @xref{Enabling and +The @var{LEVEL} is optional and defaults to 4. @xref{Enabling and Disabling Suffixes}. -The @var{description} is optional. If present, it is used as the heading of +The @var{DESCRIPTION} is optional. If present, it is used as the heading of the group. -The @var{keyword}-@var{value} pairs are optional. Each keyword has to be a +The @var{KEYWORD}-@var{VALUE} pairs are optional. Each keyword has to be a keyword symbol, either @code{:class} or a keyword argument supported by the constructor of that class. @itemize @item One of these keywords, @code{:description}, is equivalent to specifying -@var{description} at the very beginning of the vector. The recommendation +@var{DESCRIPTION} at the very beginning of the vector. The recommendation is to use @code{:description} if some other keyword is also used, for -consistency, or @var{description} otherwise, because it looks better. +consistency, or @var{DESCRIPTION} otherwise, because it looks better. @item -Likewise @code{:level} is equivalent to @var{level}. +Likewise @code{:level} is equivalent to @var{LEVEL}. @item Other important keywords include the @code{:if...} keywords. These keywords control whether the group is available in a certain situation. -For example, one group of the @code{magit-rebase} transient uses -@code{:if magit-rebase-in-progress-p}, which contains the suffixes -that are useful while rebase is already in progress; and another that uses +For example, one group of the @code{magit-rebase} transient uses @code{:if + magit-rebase-in-progress-p}, which contains the suffixes that are +useful while rebase is already in progress; and another that uses @code{:if-not magit-rebase-in-progress-p}, which contains the suffixes that initiate a rebase. @@ -1096,9 +1138,9 @@ suffixes, which assumes that a predicate like this is used: @end lisp @item -The value of @code{:setup-children}, if non-@code{nil}, is a function -that takes two arguments the group object itself and a list of children. -The children are given as a, potentially empty, list consisting +The value of @code{:setup-children}, if non-@code{nil}, is a function that takes +two arguments the group object itself and a list of children. +The children are given as a (potentially empty) list consisting of either group or suffix specifications. It can make arbitrary changes to the children including constructing new children from scratch. Also see @code{transient-setup-children}. @@ -1109,21 +1151,21 @@ contained in a group are right padded, effectively aligning the descriptions. @end itemize -The @var{element}s are either all subgroups (vectors), or all suffixes +The @var{ELEMENT}s are either all subgroups (vectors), or all suffixes (lists) and strings. (At least currently no group type exists that would allow mixing subgroups with commands at the same level, though in principle there is nothing that prevents that.) -If the @var{element}s are not subgroups, then they can be a mixture of lists +If the @var{ELEMENT}s are not subgroups, then they can be a mixture of lists that specify commands and strings. Strings are inserted verbatim. The empty string can be used to insert gaps between suffixes, which is particularly useful if the suffixes are outlined as a table. Variables are supported inside group specifications. For example in place of a direct subgroup specification, a variable can be used whose -value is a vector that qualifies as a group specification. Likewise, a -variable can be used where a suffix specification is expected. Lists -of group or suffix specifications are also supported. Indirect +value is a vector that qualifies as a group specification. Likewise, +a variable can be used where a suffix specification is expected. +Lists of group or suffix specifications are also supported. Indirect specifications are resolved when the transient prefix is being defined. @@ -1131,6 +1173,7 @@ The form of suffix specifications is documented in the next node. @node Suffix Specifications @subsection Suffix Specifications + @cindex suffix specifications A transient's suffix and infix commands are bound when the transient @@ -1140,37 +1183,36 @@ prefix command is defined using @code{transient-define-prefix}, see individual suffix command. The same form is also used when later binding additional commands -using functions such as @code{transient-insert-suffix}, -see @ref{Modifying Existing Transients}. +using functions such as @code{transient-insert-suffix}, see @ref{Modifying Existing Transients}. -Note that an infix is a special kind of suffix. Depending on context -``suffixes'' means ``suffixes (including infixes)'' or ``non-infix -suffixes''. Here it means the former. +Note that an infix is a special kind of suffix. Depending on context +“suffixes” means “suffixes (including infixes)” or “non-infix +suffixes”. Here it means the former. Suffix specifications have this form: @lisp -([@var{level}] - [@var{key}] [@var{description}] - @var{command}|@var{argument} [@var{keyword} @var{value}]...) +([@var{LEVEL}] + [@var{KEY}] [@var{DESCRIPTION}] + @var{COMMAND}|@var{ARGUMENT} [@var{KEYWORD} @var{VALUE}]...) @end lisp -@var{level}, @var{key} and @var{description} can also be specified using the @var{keyword}s +@var{LEVEL}, @var{KEY} and @var{DESCRIPTION} can also be specified using the @var{KEYWORD}s @code{:level}, @code{:key} and @code{:description}. If the object that is associated with -@var{command} sets these properties, then they do not have to be specified +@var{COMMAND} sets these properties, then they do not have to be specified here. You can however specify them here anyway, possibly overriding the object's values just for the binding inside this transient. @itemize @item -@var{level} is the suffix level, an integer between 1 and 7. +@var{LEVEL} is the suffix level, an integer between 1 and 7. @xref{Enabling and Disabling Suffixes}. @item -@var{key} is the key binding, either a vector or key description string. +@var{KEY} is the key binding, either a vector or key description string. @item -@var{description} is the description, either a string or a function that +@var{DESCRIPTION} is the description, either a string or a function that returns a string. The function should be a lambda expression to avoid ambiguity. In some cases a symbol that is bound as a function would also work but to be safe you should use @code{:description} in that @@ -1182,7 +1224,7 @@ argument that is mandatory in all cases. @itemize @item -Usually @var{command} is a symbol that is bound as a function, which has +@var{COMMAND} should be a symbol that is bound as a function, which has to be defined or at least autoloaded as a command by the time the containing prefix command is invoked. @@ -1190,15 +1232,13 @@ Any command will do; it does not need to have an object associated with it (as would be the case if @code{transient-define-suffix} or @code{transient-define-infix} were used to define it). -The command can also be a closure or lambda expression, but that -should only be used for dynamic transients whose suffixes are -defined when the prefix command is invoked. See information about -the @code{:setup-children} function in @ref{Group Specifications}. +Anonymous, dynamically defined suffix commands are also support. +See information about the @code{:setup-children} function in @ref{Group Specifications}. As mentioned above, the object that is associated with a command can be used to set the default for certain values that otherwise have to be set in the suffix specification. Therefore if there is no object, -then you have to make sure to specify the @var{key} and the @var{description}. +then you have to make sure to specify the @var{KEY} and the @var{DESCRIPTION}. As a special case, if you want to add a command that might be neither defined nor autoloaded, you can use a workaround like: @@ -1209,8 +1249,8 @@ defined nor autoloaded, you can use a workaround like: :if (lambda () (featurep 'no-library)))) @end lisp -Instead of @code{featurep} you could also use @code{require} with a -non-nil value for @var{noerror}. +Instead of @code{featurep} you could also use @code{require} with a non-@code{nil} value +for @var{NOERROR}. @item The mandatory argument can also be a command-line argument, a @@ -1227,30 +1267,29 @@ used. Unless the class is specified explicitly, the appropriate class is guessed based on the long argument. If the argument ends with @samp{=} -(e.g. @samp{--format=}) then @code{transient-option} is used, otherwise +(e.g., @samp{--format=}) then @code{transient-option} is used, otherwise @code{transient-switch}. @end itemize -Finally, details can be specified using optional -@var{keyword}-@var{value} pairs. +Finally, details can be specified using optional @var{KEYWORD}-@var{VALUE} pairs. Each keyword has to be a keyword symbol, either @code{:class} or a keyword argument supported by the constructor of that class. See @ref{Suffix Slots}. @node Defining Suffix and Infix Commands @section Defining Suffix and Infix Commands + @cindex defining suffix commands @cindex defining infix commands -Note that an infix is a special kind of suffix. Depending on context -``suffixes'' means ``suffixes (including infixes)'' or ``non-infix -suffixes''. +Note that an infix is a special kind of suffix. Depending on context +“suffixes” means “suffixes (including infixes)” or “non-infix +suffixes”. @defmac transient-define-suffix name arglist [docstring] [keyword value]@dots{} body@dots{} +This macro defines @var{NAME} as a transient suffix command. -This macro defines @var{name} as a transient suffix command. - -@var{arglist} are the arguments that the command takes. -@var{docstring} is the documentation string and is optional. +@var{ARGLIST} are the arguments that the command takes. +@var{DOCSTRING} is the documentation string and is optional. These arguments can optionally be followed by keyword-value pairs. Each keyword has to be a keyword symbol, either @code{:class} or a keyword @@ -1258,17 +1297,16 @@ argument supported by the constructor of that class. The @code{transient-suffix} class is used if the class is not specified explicitly. -The @var{body} must begin with an @code{interactive} form that matches @var{arglist}. +The @var{BODY} must begin with an @code{interactive} form that matches @var{ARGLIST}. The infix arguments are usually accessed by using @code{transient-args} inside @code{interactive}. @end defmac @defmac transient-define-infix name arglist [docstring] [keyword value]@dots{} +This macro defines @var{NAME} as a transient infix command. -This macro defines @var{name} as a transient infix command. - -@var{arglist} is always ignored (but mandatory never-the-less) and -reserved for future use. @var{docstring} is the documentation string and +@var{ARGLIST} is always ignored (but mandatory never-the-less) and +reserved for future use. @var{DOCSTRING} is the documentation string and is optional. The keyword-value pairs are mandatory. All transient infix commands @@ -1297,13 +1335,12 @@ Different infix commands behave differently because the concrete methods are different for different infix command classes. In rare cases the above command function might not be suitable, even if you define your own infix command class. In that case you have to use -@code{transient-suffix-command} to define the infix command and use @code{t} as -the value of the @code{:transient} keyword. +@code{transient-define-suffix} to define the infix command and use @code{t} as the +value of the @code{:transient} keyword. @end defmac @defmac transient-define-argument name arglist [docstring] [keyword value]@dots{} - -This macro defines @var{name} as a transient infix command. +This macro defines @var{NAME} as a transient infix command. This is an alias for @code{transient-define-infix}. Only use this alias to define an infix command that actually sets an infix argument. @@ -1313,7 +1350,6 @@ To define an infix command that, for example, sets a variable, use @node Using Infix Arguments @section Using Infix Arguments -@cindex using infix arguments The functions and the variables described below allow suffix commands to access the value of the transient from which they were invoked; @@ -1332,61 +1368,56 @@ function, which for infix arguments serves about the same purpose as @code{prefix-arg} serves for prefix arguments. @defun transient-args prefix - This function returns the value of the transient prefix command -@var{prefix}. +@var{PREFIX}. If the current command was invoked from the transient prefix command -@var{prefix}, then it returns the active infix arguments. If the current -command was not invoked from @var{prefix}, then it returns the set, saved -or default value for @var{prefix}. +@var{PREFIX}, then it returns the active infix arguments. If the current +command was not invoked from @var{PREFIX}, then it returns the set, saved +or default value for @var{PREFIX}. @end defun @defun transient-arg-value arg args - -This function return the value of @var{arg} as it appears in @var{args}. +This function return the value of @var{ARG} as it appears in @var{ARGS}. For a switch a boolean is returned. For an option the value is returned as a string, using the empty string for the empty value, -or @code{nil} if the option does not appear in @var{args}. +or @code{nil} if the option does not appear in @var{ARGS}. @end defun @defun transient-suffixes prefix - This function returns the suffixes of the transient prefix command -@var{prefix}. This is a list of objects. This function should only be +@var{PREFIX}. This is a list of objects. This function should only be used if you need the objects (as opposed to just their values) and -if the current command is not being invoked from @var{prefix}. +if the current command is not being invoked from @var{PREFIX}. @end defun @defvar transient-current-suffixes - The suffixes of the transient from which this suffix command was invoked. This is a list of objects. Usually it is sufficient to instead use the function @code{transient-args}, which returns a list of values. In complex cases it might be necessary to use this variable -instead, i.e.@: if you need access to information beside the value. +instead, i.e., if you need access to information beside the value. @end defvar @defvar transient-current-prefix - The transient from which this suffix command was invoked. The returned value is a @code{transient-prefix} object, which holds information associated with the transient prefix command. @end defvar @defvar transient-current-command - The transient from which this suffix command was invoked. The returned value is a symbol, the transient prefix command. @end defvar @node Transient State @section Transient State + @cindex transient state -Invoking a transient prefix command ``activates'' the respective -transient, i.e.@: it puts a transient keymap into effect, which binds +Invoking a transient prefix command “activates” the respective +transient, i.e., it puts a transient keymap into effect, which binds the transient's infix and suffix commands. The default behavior while a transient is active is as follows: @@ -1397,20 +1428,20 @@ Invoking an infix command does not affect the transient state; the transient remains active. @item -Invoking a (non-infix) suffix command ``deactivates'' the transient +Invoking a (non-infix) suffix command “deactivates” the transient state by removing the transient keymap and performing some additional cleanup. @item Invoking a command that is bound in a keymap other than the transient keymap is disallowed and trying to do so results in a -warning. This does not ``deactivate'' the transient. +warning. This does not “deactivate” the transient. @end itemize But these are just the defaults. Whether a certain command -deactivates or ``exits'' the transient is configurable. There is more -than one way in which a command can be ``transient'' or ``non-transient''; -the exact behavior is implemented by calling a so-called ``pre-command'' +deactivates or “exits” the transient is configurable. There is more +than one way in which a command can be “transient” or “non-transient”; +the exact behavior is implemented by calling a so-called “pre-command” function. Whether non-suffix commands are allowed to be called is configurable per transient. @@ -1426,10 +1457,8 @@ Valid values are booleans and the pre-commands described below. @itemize @item @code{t} is equivalent to @code{transient--do-stay}. - @item @code{nil} is equivalent to @code{transient--do-exit}. - @item If @code{transient} is unbound (and that is actually the default for non-infix suffixes) then the value of the prefix's @@ -1439,18 +1468,18 @@ essentially equivalent to it being @code{nil}. @end itemize @item -A suffix command can be a prefix command itself, i.e. a -``sub-prefix''. While a sub-prefix is active we nearly always want -@kbd{C-g} to take the user back to the ``super-prefix''. However in rare +A suffix command can be a prefix command itself, i.e., a +“sub-prefix”. While a sub-prefix is active we nearly always want +@kbd{C-g} to take the user back to the “super-prefix”. However in rare cases this may not be desirable, and that makes the following complication necessary: For @code{transient-suffix} objects the @code{transient} slot is unbound. We can ignore that for the most part because, as stated above, @code{nil} and the -slot being unbound are equivalent, and mean ``do exit''. That isn't +slot being unbound are equivalent, and mean “do exit”. That isn't actually true for suffixes that are sub-prefixes though. For such -suffixes unbound means ``do exit but allow going back'', which is the -default, while @code{nil} means ``do exit permanently'', which requires that +suffixes unbound means “do exit but allow going back”, which is the +default, while @code{nil} means “do exit permanently”, which requires that slot to be explicitly set to that value. @item @@ -1465,7 +1494,7 @@ called by @code{transient--pre-command}, a function on @code{pre-command-hook} a the value that they return determines whether the transient is exited. To do so the value of one of the constants @code{transient--exit} or @code{transient--stay} is used (that way we don't have to remember if @code{t} means -``exit'' or ``stay''). +“exit” or “stay”). Additionally, these functions may change the value of @code{this-command} (which explains why they have to be called using @code{pre-command-hook}), @@ -1480,7 +1509,6 @@ The default for infixes is @code{transient--do-stay}. This is also the only function that makes sense for infixes. @defun transient--do-stay - Call the command without exporting variables and stay transient. @end defun @@ -1490,27 +1518,55 @@ Call the command without exporting variables and stay transient. The default for suffixes is @code{transient--do-exit}. @defun transient--do-exit - Call the command after exporting variables and exit the transient. @end defun -@defun transient--do-call +@defun transient--do-return +Call the command after exporting variables and return to parent +prefix. If there is no parent prefix, then call @code{transient--do-exit}. +@end defun +@defun transient--do-call Call the command after exporting variables and stay transient. @end defun -@defun transient--do-replace +The following pre-commands are suitable for sub-prefixes. Only the +first should ever explicitly be set as the value of the @code{transient} +slot. + +@defun transient--do-recurse +Call the transient prefix command, preparing for return to active +transient. + +Whether we actually return to the parent transient is ultimately +under the control of each invoked suffix. The difference between +this pre-command and @code{transient--do-replace} is that it changes the +value of the @code{transient-suffix} slot to @code{transient--do-return}. + +If there is no parent transient, then only call this command and +skip the second step. +@end defun +@defun transient--do-replace Call the transient prefix command, replacing the active transient. -This is used for suffixes that are prefixes themselves, i.e.@: for -sub-prefixes. +Unless @code{transient--do-recurse} is explicitly used, this pre-command +is automatically used for suffixes that are prefixes themselves, +i.e., for sub-prefixes. +@end defun + +@defun transient--do-suspend +Suspend the active transient, saving the transient stack. + +This is used by the command @code{transient-suspend} and optionally also by +“external events” such as @code{handle-switch-frame}. Such bindings should +be added to @code{transient-predicate-map}. @end defun @anchor{Pre-commands for Non-Suffixes} @subheading Pre-commands for Non-Suffixes -The default for non-suffixes, i.e@: commands that are bound in other +The default for non-suffixes, i.e., commands that are bound in other keymaps beside the transient keymap, is @code{transient--do-warn}. Silently ignoring the user-error is also an option, though probably not a good one. @@ -1520,12 +1576,10 @@ If you want to let the user invoke non-suffix commands, then use slot. @defun transient--do-warn - Call @code{transient-undefined} and stay transient. @end defun @defun transient--do-noop - Call @code{transient-noop} and stay transient. @end defun @@ -1533,21 +1587,18 @@ Call @code{transient-noop} and stay transient. @subheading Special Pre-Commands @defun transient--do-quit-one - If active, quit help or edit mode, else exit the active transient. This is used when the user pressed @kbd{C-g}. @end defun @defun transient--do-quit-all - Exit all transients without saving the transient stack. This is used when the user pressed @kbd{C-q}. @end defun @defun transient--do-suspend - Suspend the active transient, saving the transient stack. This is used when the user pressed @kbd{C-z}. @@ -1555,6 +1606,7 @@ This is used when the user pressed @kbd{C-z}. @node Classes and Methods @chapter Classes and Methods + @cindex classes and methods Transient uses classes and generic functions to make it possible to @@ -1591,7 +1643,7 @@ holds a function that is used to read a new value for an infix command. The values of such slots are regular functions. Generic functions are used when a function should do something -different based on the type of the command, i.e. when all commands +different based on the type of the command, i.e., when all commands of a certain type should behave the same way but different from the behavior for other types. Object slots that hold a regular function as value are used when the task that they perform is likely to @@ -1613,7 +1665,7 @@ differ even between different commands of the same type. @section Group Classes The type of a group can be specified using the @code{:class} property at the -beginning of the class specification, e.g. @code{[:class transient-columns +beginning of the class specification, e.g., @code{[:class transient-columns ...]} in a call to @code{transient-define-prefix}. @itemize @@ -1622,7 +1674,7 @@ The abstract @code{transient-child} class is the base class of both @code{transient-group} (and therefore all groups) as well as of @code{transient-suffix} (and therefore all suffix and infix commands). -This class exists because the elements (a.k.a.@: ``children'') of certain +This class exists because the elements (or “children”) of certain groups can be other groups instead of suffix and infix commands. @item @@ -1632,8 +1684,8 @@ group classes. @item The @code{transient-column} class is the simplest group. -This is the default ``flat'' group. If the class is not specified -explicitly and the first element is not a vector (i.e. not a group), +This is the default “flat” group. If the class is not specified +explicitly and the first element is not a vector (i.e., not a group), then this class is used. This class displays each element on a separate line. @@ -1648,8 +1700,8 @@ Direct elements have to be groups whose elements have to be commands or strings. Each subgroup represents a column. This class takes care of inserting the subgroups' elements. -This is the default ``nested'' group. If the class is not specified -explicitly and the first element is a vector (i.e.@: a group), then +This is the default “nested” group. If the class is not specified +explicitly and the first element is a vector (i.e., a group), then this class is used. @item @@ -1665,12 +1717,11 @@ elements. @section Group Methods @defun transient-setup-children group children - This generic function can be used to setup the children or a group. The default implementation usually just returns the children -unchanged, but if the @code{setup-children} slot of @var{group} is non-nil, then -it calls that function with @var{children} as the only argument and +unchanged, but if the @code{setup-children} slot of @var{GROUP} is non-@code{nil}, then +it calls that function with @var{CHILDREN} as the only argument and returns the value. The children are given as a (potentially empty) list consisting of @@ -1680,7 +1731,6 @@ children from scratch. @end defun @defun transient--insert-group group - This generic function formats the group and its elements and inserts the result into the current buffer, which is a temporary buffer. The contents of that buffer are later inserted into the popup buffer. @@ -1698,7 +1748,6 @@ commands and there is only a single generic function that can be specialized based on the class of a prefix command. @defun transient--history-init obj - This generic function is called while setting up the transient and is responsible for initializing the @code{history} slot. This is the transient-wide history; many individual infixes also have a history @@ -1784,8 +1833,7 @@ functions use @code{describe-function}. @subsection Suffix Value Methods @defun transient-init-value obj - -This generic function sets the initial value of the object @var{obj}. +This generic function sets the initial value of the object @var{OBJ}. This function is called for all suffix commands, but unless a concrete method is implemented this falls through to the default @@ -1797,9 +1845,8 @@ a method. @end defun @defun transient-infix-read obj - This generic function determines the new value of the infix object -@var{obj}. +@var{OBJ}. This function merely determines the value; @code{transient-infix-set} is used to actually store the new value in the object. @@ -1809,40 +1856,36 @@ user using the reader specified by the @code{reader} slot (using the @code{transient-infix-value} method described below). For some infix classes the value is changed without reading -anything in the minibuffer, i.e.@: the mere act of invoking the +anything in the minibuffer, i.e., the mere act of invoking the infix command determines what the new value should be, based on the previous value. @end defun @defun transient-prompt obj - This generic function returns the prompt to be used to read infix -object @var{obj}'s value. +object @var{OBJ}'s value. @end defun @defun transient-infix-set obj value - -This generic function sets the value of infix object @var{obj} to @var{value}. +This generic function sets the value of infix object @var{OBJ} to @var{VALUE}. @end defun @defun transient-infix-value obj - -This generic function returns the value of the suffix object @var{obj}. +This generic function returns the value of the suffix object @var{OBJ}. This function is called by @code{transient-args} (which see), meaning this function is how the value of a transient is determined so that the invoked suffix command can use it. Currently most values are strings, but that is not set in stone. -@code{nil} is not a value, it means ``no value''. +@code{nil} is not a value, it means “no value”. Usually only infixes have a value, but see the method for @code{transient-suffix}. @end defun @defun transient-init-scope obj - -This generic function sets the scope of the suffix object @var{obj}. +This generic function sets the scope of the suffix object @var{OBJ}. The scope is actually a property of the transient prefix, not of individual suffixes. However it is possible to invoke a suffix @@ -1859,8 +1902,7 @@ implementation, which is a noop. @subsection Suffix Format Methods @defun transient-format obj - -This generic function formats and returns @var{obj} for display. +This generic function formats and returns @var{OBJ} for display. When this function is called, then the current buffer is some temporary buffer. If you need the buffer from which the prefix @@ -1869,27 +1911,23 @@ making @code{transient--source-buffer} current. @end defun @defun transient-format-key obj - -This generic function formats @var{obj}'s @code{key} for display and returns the +This generic function formats @var{OBJ}'s @code{key} for display and returns the result. @end defun @defun transient-format-description obj - -This generic function formats @var{obj}'s @code{description} for display and +This generic function formats @var{OBJ}'s @code{description} for display and returns the result. @end defun @defun transient-format-value obj - -This generic function formats @var{obj}'s value for display and returns +This generic function formats @var{OBJ}'s value for display and returns the result. @end defun @defun transient-show-help obj - Show help for the prefix, infix or suffix command represented by -@var{obj}. +@var{OBJ}. For prefixes, show the info manual, if that is specified using the @code{info-manual} slot. Otherwise, show the manpage if that is specified @@ -1906,10 +1944,10 @@ the command's doc string. @itemize @item -@code{man-page} or @code{info-manual} can be used to specify the documentation for -the prefix and its suffixes. The command @code{transient-help} uses the -method @code{transient-show-help} (which see) to lookup and use these -values. +@code{show-help}, @code{man-page} or @code{info-manual} can be used to specify the +documentation for the prefix and its suffixes. The command +@code{transient-help} uses the method @code{transient-show-help} (which see) to +lookup and use these values. @item @code{history-key} If multiple prefix commands should share a single value, @@ -1930,7 +1968,7 @@ multiple sub-lists. @item @code{scope} For some transients it might be necessary to have a sort of -secondary value, called a ``scope''. See @code{transient-define-prefix}. +secondary value, called a “scope”. See @code{transient-define-prefix}. @end itemize @anchor{Internal Prefix Slots} @@ -1995,10 +2033,8 @@ It must contain the following %-placeholders: @itemize @item @code{%k} For the key. - @item @code{%d} For the description. - @item @code{%v} For the infix value. Non-infix suffixes don't have a value. @end itemize @@ -2006,6 +2042,11 @@ It must contain the following %-placeholders: @item @code{description} The description, either a string or a function that is called with no argument and returns a string. + +@item +@code{show-help} A function used to display help for the suffix. If +unspecified, the prefix controls how hlep is displayed for its +suffixes. @end itemize @anchor{Slots of @code{transient-infix}} @@ -2016,10 +2057,10 @@ They are defined here anyway to allow sharing certain methods. @itemize @item -@code{argument} The long argument, e.g. @code{--verbose}. +@code{argument} The long argument, e.g., @code{--verbose}. @item -@code{shortarg} The short argument, e.g. @code{-v}. +@code{shortarg} The short argument, e.g., @code{-v}. @item @code{value} The value. Should not be accessed directly. @@ -2036,7 +2077,34 @@ the prefixes. @item @code{multi-value} For options, whether the option can have multiple -values. If non-nil, then default to use @code{completing-read-multiple}. +values. If this is non-@code{nil}, then the values are read using +@code{completing-read-multiple} by default and if you specify your own +reader, then it should read the values using that function or +similar. + +Supported non-@code{nil} values are: + +@itemize +@item +Use @code{rest} for an option that can have multiple values. This is +useful e.g., for an @code{--} argument that indicates that all remaining +arguments are files (such as @code{git log -- file1 file2}). + +In the list returned by @code{transient-args} such an option and its +values are represented by a single list of the form @code{(ARGUMENT + . VALUES)}. + +@item +Use @code{repeat} for an option that can be specified multiple times. + +In the list returned by @code{transient-args} each instance of the option +and its value appears separately in the usual from, for example: +@code{("--another-argument" "--option=first" "--option=second")}. +@end itemize + +In both cases the option's values have to be specified in the +default value of a prefix using the same format as returned by +@code{transient-args}, e.g., @code{("--other" "--o=1" "--o=2" ("--" "f1" "f2"))}. @item @code{always-read} For options, whether to read a value on every invocation. @@ -2053,8 +2121,8 @@ same history because their values are of the same kind. @item @code{reader} The function used to read the value of an infix. Not used -for switches. The function takes three arguments, @var{prompt}, -@var{initial-input} and @var{history}, and must return a string. +for switches. The function takes three arguments, @var{PROMPT}, +@var{INITIAL-INPUT} and @var{HISTORY}, and must return a string. @item @code{prompt} The prompt used when reading the value, either a string or a @@ -2098,25 +2166,18 @@ what happens if you use more than one. @itemize @item @code{if} Enable if predicate returns non-@code{nil}. - @item @code{if-not} Enable if predicate returns @code{nil}. - @item @code{if-non-nil} Enable if variable's value is non-@code{nil}. - @item @code{if-nil} Enable if variable's value is @code{nil}. - @item @code{if-mode} Enable if major-mode matches value. - @item @code{if-not-mode} Enable if major-mode does not match value. - @item @code{if-derived} Enable if major-mode derives from value. - @item @code{if-not-derived} Enable if major-mode does not derive from value. @end itemize @@ -2146,16 +2207,13 @@ The following diagrams illustrate some of the differences. @itemize @item -@code{(c)} represents a return to the command loop. - +@samp{(c)} represents a return to the command loop. @item -@code{(+)} represents the user's choice to press one key or another. - +@samp{(+)} represents the user's choice to press one key or another. @item -@code{@{@var{word}@}} are possible behaviors. - +@samp{@{WORD@}} are possible behaviors. @item -@code{@{@var{number}@}} is a footnote. +@samp{@{NUMBER@}} is a footnote. @end itemize @anchor{Regular Prefix Commands} @@ -2331,7 +2389,7 @@ and also takes external state into account. @itemize @item -@code{@{1@}} Transients can be configured to be exited when a suffix command +@samp{@{1@}} Transients can be configured to be exited when a suffix command is invoked. The default is to do so for all suffixes except for those that are common to all transients and which are used to perform tasks such as providing help and saving the value of the @@ -2340,7 +2398,7 @@ specified for individual suffix commands and may even depend on state. @item -@code{@{2@}} Transients can be configured to allow the user to invoke +@samp{@{2@}} Transients can be configured to allow the user to invoke non-suffix commands. The default is to not allow that and instead warn the user. @end itemize @@ -2386,9 +2444,9 @@ Both packages use transient keymaps to make a set of commands temporarily available and show the available commands in a popup buffer. -A Hydra ``body'' is equivalent to a Transient ``prefix'' and a Hydra -``head'' is equivalent to a Transient ``suffix''. Hydra has no equivalent -of a Transient ``infix''. +A Hydra “body” is equivalent to a Transient “prefix” and a Hydra +“head” is equivalent to a Transient “suffix”. Hydra has no equivalent +of a Transient “infix”. Both hydras and transients can be used as simple command dispatchers. Used like this they are similar to regular prefix commands and prefix @@ -2406,7 +2464,7 @@ command dispatchers: @item Invoking a command from a hydra does not necessarily exit the hydra. That makes it possible to invoke the same command again, but using a -shorter key sequence (i.e. the key that was used to enter the hydra +shorter key sequence (i.e., the key that was used to enter the hydra does not have to be pressed again). Transient supports that too, but for now this feature is not a focus @@ -2421,7 +2479,6 @@ using the current interface: ("n" "next visible heading" outline-next-visible-heading)]) @end lisp - @item Transient supports infix arguments; values that are set by infix commands and then consumed by the invoked suffix command(s). @@ -2465,13 +2522,13 @@ currently exist. @anchor{Can I control how the popup buffer is displayed?} @appendixsec Can I control how the popup buffer is displayed? -Yes, see @code{transient-display-buffer-action} in @ref{Other Options}. +Yes, see @code{transient-display-buffer-action} in @ref{Configuration}. @anchor{Why did some of the key bindings change?} @appendixsec Why did some of the key bindings change? You may have noticed that the bindings for some of the common commands -do @strong{not} have the prefix @code{C-x} and that furthermore some of these commands +do @strong{not} have the prefix @kbd{C-x} and that furthermore some of these commands are grayed out while others are not. That unfortunately is a bit confusing if the section of common commands is not shown permanently, making the following explanation necessary. @@ -2486,42 +2543,41 @@ bindings. The bindings that do use a prefix do so to avoid wasting too many non-prefix bindings, keeping them available for use in individual transients. The bindings that do not use a prefix and that are @strong{not} grayed out are very important bindings that are @strong{always} -available, even when invoking the ``common command key prefix'' or @strong{any +available, even when invoking the “common command key prefix” or @strong{any other} transient-specific prefix. The non-prefix keys that @strong{are} grayed out however, are not available when any incomplete prefix key sequence -is active. They do not use the ``common command key prefix'' because it +is active. They do not use the “common command key prefix” because it is likely that users want to invoke them several times in a row and -e.g. @kbd{M-p M-p M-p} is much more convenient than -@kbd{C-x M-p C-x M-p C-x M-p}. +e.g., @kbd{M-p M-p M-p} is much more convenient than @kbd{C-x M-p C-x M-p C-x M-p}. -You may also have noticed that the "Set" command is bound to @kbd{C-x s}, +You may also have noticed that the “Set” command is bound to @kbd{C-x s}, while Magit-Popup used to bind @kbd{C-c C-c} instead. I have seen several users praise the latter binding (sic), so I did not change it willy-nilly. The reason that I changed it is that using different prefix keys for different common commands, would have made the -temporary display of the common commands even more confusing, -i.e. after pressing @kbd{C-c} all the @kbd{C-x ...} bindings would be grayed out. +temporary display of the common commands even more confusing, i.e., +after pressing @kbd{C-c} all the bindings that begin with the @kbd{C-x} prefix +would be grayed out. Using a single prefix for common commands key means that all other potential prefix keys can be used for transient-specific commands -@strong{without} the section of common commands also popping up. @code{C-c} in +@strong{without} the section of common commands also popping up. @kbd{C-c} in particular is a prefix that I want to (and already do) use for Magit, and also using that for a common command would prevent me from doing so. (Also see the next question.) -@anchor{Why does @code{q} not quit popups anymore?} -@appendixsec Why does @code{q} not quit popups anymore? +@anchor{Why does @kbd{q} not quit popups anymore?} +@appendixsec Why does @kbd{q} not quit popups anymore? I agree that @kbd{q} is a good binding for commands that quit something. This includes quitting whatever transient is currently active, but it also includes quitting whatever it is that some specific transient is -controlling. The transient @code{magit-blame} for example binds @code{q} to the +controlling. The transient @code{magit-blame} for example binds @kbd{q} to the command that turns @code{magit-blame-mode} off. So I had to decide if @kbd{q} should quit the active transient (like -Magit-Popup used to) or whether @kbd{C-g} should do that instead, so -that @kbd{q} +Magit-Popup used to) or whether @kbd{C-g} should do that instead, so that @kbd{q} could be bound in individual transient to whatever commands make sense for them. Because all other letters are already reserved for use by individual transients, I have decided to no longer make an exception @@ -2548,7 +2604,7 @@ necessary changes. See its doc string for more information. @printindex vr @node Concept Index -@appendix Concept and Feature Index +@appendix Concept Index @printindex cp commit 5aaad0445dc5a353f2da11fa7f2390d082884abe Author: Eli Zaretskii Date: Sat Aug 6 16:55:51 2022 +0300 Speed up display of Arabic * lisp/language/misc-lang.el (composition-function-table): Move some of the Arabic composition rules to ZWJ and ZWNJ cells. This speeds up display of Arabic by a factor of 2. (Bug#56682) diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index 1e915c2f83..3d5b68f84b 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -137,10 +137,13 @@ thin (i.e. 1-dot width) space." (set-char-table-range composition-function-table '(#x600 . #x74F) - (list (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" - 1 #'arabic-shape-gstring) - (vector "[\u0600-\u074F\u200C\u200D]+" + (list (vector "[\u0600-\u074F\u200C\u200D]+" 0 #'arabic-shape-gstring))) +(set-char-table-range + composition-function-table + '(#x200C . #x200D) + (list (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" + 0 #'arabic-shape-gstring))) ;; The Egyptian Hieroglyph Format Controls were introduced in Unicode ;; Standard v12.0. Apparently, they are not yet well supported in commit 55c25e73d46685e4b4423b13b0d3287fee170386 Author: Eli Zaretskii Date: Sat Aug 6 16:24:34 2022 +0300 Fix C-n/C-p inside bidirectional text * src/xdisp.c (move_it_by_lines, try_cursor_movement): Handle glyph rows whose direction of increasing buffer positions is reverse of the normal: going down in the window makes buffer positions higher. * src/indent.c (Fvertical_motion): When looking for the last glyph row occupied by point, take into account the bidi iteration direction. diff --git a/src/indent.c b/src/indent.c index fd2e763665..d2dfaee254 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2345,7 +2345,15 @@ whether or not it is currently displayed in some window. */) last line that it occupies. */ if (it_start < ZV) { - while (IT_CHARPOS (it) <= it_start) + if ((it.bidi_it.scan_dir > 0) + ? IT_CHARPOS (it) < it_start + : IT_CHARPOS (it) > it_start) + { + it.vpos = 0; + it.current_y = 0; + move_it_by_lines (&it, 1); + } + while (IT_CHARPOS (it) == it_start) { it.vpos = 0; it.current_y = 0; diff --git a/src/xdisp.c b/src/xdisp.c index 3ca0022a6d..c756e7f04f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10956,15 +10956,21 @@ move_it_by_lines (struct it *it, ptrdiff_t dvpos) int nchars_per_row = (it->last_visible_x - it->first_visible_x) / FRAME_COLUMN_WIDTH (it->f); bool hit_pos_limit = false; + bool reverse_rows = false; ptrdiff_t pos_limit; /* Start at the beginning of the screen line containing IT's position. This may actually move vertically backwards, in case of overlays, so adjust dvpos accordingly. */ dvpos += it->vpos; + start_charpos = IT_CHARPOS (*it); move_it_vertically_backward (it, 0); dvpos -= it->vpos; + /* Do we have glyph rows whose positions _increase_ as we go up? */ + if (IT_CHARPOS (*it) > start_charpos) + reverse_rows = true; + /* Go back -DVPOS buffer lines, but no farther than -DVPOS full screen lines, and reseat the iterator there. */ start_charpos = IT_CHARPOS (*it); @@ -11015,7 +11021,8 @@ move_it_by_lines (struct it *it, ptrdiff_t dvpos) SAVE_IT (it2, *it, it2data); move_it_to (it, -1, -1, -1, it->vpos + delta, MOVE_TO_VPOS); /* Move back again if we got too far ahead. */ - if (IT_CHARPOS (*it) >= start_charpos) + if ((IT_CHARPOS (*it) >= start_charpos && !reverse_rows) + || (IT_CHARPOS (*it) <= start_charpos && reverse_rows)) RESTORE_IT (it, &it2, it2data); else bidi_unshelve_cache (it2data, true); @@ -18837,6 +18844,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, { /* Cursor has to be moved backward. Note that PT >= CHARPOS (startp) because of the outer if-statement. */ + struct glyph_row *row0 = row; + while (!row->mode_line_p && (MATRIX_ROW_START_CHARPOS (row) > PT || (MATRIX_ROW_START_CHARPOS (row) == PT @@ -18851,6 +18860,23 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, --row; } + /* With bidi-reordered rows we can have buffer positions + _decrease_ when going down by rows. If we haven't + found our row in the loop above, give it another try + now going in the other direction from the original row. */ + if (!(MATRIX_ROW_START_CHARPOS (row) <= PT + && PT <= MATRIX_ROW_END_CHARPOS (row)) + && row0->continued_p) + { + row = row0; + while (MATRIX_ROW_START_CHARPOS (row) > PT + && MATRIX_ROW_BOTTOM_Y (row) < last_y) + { + eassert (row->enabled_p); + ++row; + } + } + /* Consider the following case: Window starts at BEGV, there is invisible, intangible text at BEGV, so that display starts at some point START > BEGV. It can @@ -18874,9 +18900,16 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, && !cursor_row_p (row)) ++row; - /* If within the scroll margin, scroll. */ - if (row->y < top_scroll_margin - && CHARPOS (startp) != BEGV) + /* If within the scroll margin, either the top one or + the bottom one, scroll. */ + if ((row->y < top_scroll_margin + && CHARPOS (startp) != BEGV) + || MATRIX_ROW_BOTTOM_Y (row) > last_y + || PT > MATRIX_ROW_END_CHARPOS (row) + || (MATRIX_ROW_BOTTOM_Y (row) == last_y + && PT == MATRIX_ROW_END_CHARPOS (row) + && !row->ends_at_zv_p + && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))) scroll_p = true; } else commit d8abff398bc45a791783c5c463838ba6fa3f030e Author: lWarne Date: Sat Aug 6 15:01:38 2022 +0200 Fontify python escape sequences in literals * lisp/progmodes/python.el (python-rx): Add regular expressions matching escape codes in string and byte literals (python--string-bytes-literal-matcher): new function (python--not-raw-bytes-literal-start-regexp): new constant (python--not-raw-string-literal-start-regexp): new constant * test/lisp/progmodes/python-tests.el: Add tests for new fontification (bug#57004). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b8fc7d4c54..27bdbae311 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -427,7 +427,19 @@ This variant of `rx' supports common Python named REGEXPS." (: "vim:" (* space) "set" (+ space) "fileencoding" (* space) ?= (* space) (group-n 1 (+ (or word ?-))) - (* space) ":"))))) + (* space) ":")))) + (bytes-escape-sequence + (seq (not "\\") + (group (or "\\\\" "\\'" "\\a" "\\b" "\\f" + "\\n" "\\r" "\\t" "\\v" + (seq "\\" (= 3 (in "0-7"))) + (seq "\\x" hex hex))))) + (string-escape-sequence + (or bytes-escape-sequence + (seq (not "\\") + (or (group-n 1 "\\u" (= 4 hex)) + (group-n 1 "\\U" (= 8 hex)) + (group-n 1 "\\N{" (*? anychar) "}")))))) (rx ,@regexps))) @@ -539,6 +551,29 @@ the {...} holes that appear within f-strings." (goto-char (min limit (1+ send))) (setq ppss (syntax-ppss)))))) +(defconst python--not-raw-bytes-literal-start-regexp + (rx (or bos (not alnum)) (or "b" "B") (or "\"" "\"\"\"" "'" "'''") eos) + "A regular expression matching the start of a not-raw bytes literal.") + +(defconst python--not-raw-string-literal-start-regexp + (rx (or bos (not alnum)) (? (or "u" "U" "F" "f")) (or "\"" "\"\"\"" "'" "'''") eos) + "A regular expression matching the start of a not-raw string literal.") + +(defun python--string-bytes-literal-matcher (regexp start-regexp) + "Match REGEXP within a string or bytes literal whose start matches START-REGEXP." + (lambda (limit) + (cl-loop for result = (re-search-forward regexp limit t) + for result-valid = (and + result + (let* ((pos (nth 8 (syntax-ppss))) + (before-quote + (buffer-substring-no-properties + (max (- pos 5) (point-min)) + (min (+ pos 1) (point-max))))) + (string-match-p start-regexp before-quote))) + until (or (not result) result-valid) + finally return (and result-valid result)))) + (defvar python-font-lock-keywords-level-1 `((,(python-rx symbol-start "def" (1+ space) (group symbol-name)) (1 font-lock-function-name-face)) @@ -716,7 +751,24 @@ sign in chained assignment." grouped-assignment-target (* space) (or ")" "]") (* space) assignment-operator)) - (1 font-lock-variable-name-face))) + (1 font-lock-variable-name-face)) + ;; escape sequences within bytes literals + ;; "\\" "\'" "\a" "\b" "\f" "\n" "\r" "\t" "\v" + ;; "\ooo" character with octal value ooo + ;; "\xhh" character with hex value hh + (,(python--string-bytes-literal-matcher + (python-rx bytes-escape-sequence) + python--not-raw-bytes-literal-start-regexp) + (1 font-lock-constant-face t)) + ;; escape sequences within string literals, the same as appear in bytes + ;; literals in addition to: + ;; "\uxxxx" Character with 16-bit hex value xxxx + ;; "\Uxxxxxxxx" Character with 32-bit hex value xxxxxxxx + ;; "\N{name}" Character named name in the Unicode database + (,(python--string-bytes-literal-matcher + (python-rx string-escape-sequence) + python--not-raw-string-literal-start-regexp) + (1 'font-lock-constant-face t))) "Font lock keywords to use in `python-mode' for maximum decoration. This decoration level includes everything in diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 6f2ad87f81..07f2c4f09a 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -380,6 +380,83 @@ def f(x: CustomInt) -> CustomInt: (128 . font-lock-builtin-face) (131) (144 . font-lock-keyword-face) (150)))) +(ert-deftest python-font-lock-escape-sequence-string-newline () + (python-tests-assert-faces + "'\\n' +\"\\n\" +f'\\n' +f\"\\n\" +u'\\n' +u\"\\n\"" + '((1 . font-lock-doc-face) + (2 . font-lock-constant-face) + (4 . font-lock-doc-face) (5) + (6 . font-lock-doc-face) + (7 . font-lock-constant-face) + (9 . font-lock-doc-face) (10) + (12 . font-lock-string-face) + (13 . font-lock-constant-face) + (15 . font-lock-string-face) (16) + (18 . font-lock-string-face) + (19 . font-lock-constant-face) + (21 . font-lock-string-face) (22) + (24 . font-lock-string-face) + (25 . font-lock-constant-face) + (27 . font-lock-string-face) (28) + (30 . font-lock-string-face) + (31 . font-lock-constant-face) + (33 . font-lock-string-face)))) + +(ert-deftest python-font-lock-escape-sequence-bytes-newline () + (python-tests-assert-faces + "b'\\n' +b\"\\n\"" + '((1) + (2 . font-lock-doc-face) + (3 . font-lock-constant-face) + (5 . font-lock-doc-face) (6) + (8 . font-lock-doc-face) + (9 . font-lock-constant-face) + (11 . font-lock-doc-face)))) + +(ert-deftest python-font-lock-escape-sequence-hex-octal () + (python-tests-assert-faces + "b'\\x12 \\777' +'\\x12 \\777'" + '((1) + (2 . font-lock-doc-face) + (3 . font-lock-constant-face) + (7 . font-lock-doc-face) + (8 . font-lock-constant-face) + (12 . font-lock-doc-face) (13) + (14 . font-lock-doc-face) + (15 . font-lock-constant-face) + (19 . font-lock-doc-face) + (20 . font-lock-constant-face) + (24 . font-lock-doc-face)))) + +(ert-deftest python-font-lock-escape-sequence-unicode () + (python-tests-assert-faces + "b'\\u1234 \\U00010348 \\N{Plus-Minus Sign}' +'\\u1234 \\U00010348 \\N{Plus-Minus Sign}'" + '((1) + (2 . font-lock-doc-face) (41) + (42 . font-lock-doc-face) + (43 . font-lock-constant-face) + (49 . font-lock-doc-face) + (50 . font-lock-constant-face) + (60 . font-lock-doc-face) + (61 . font-lock-constant-face) + (80 . font-lock-doc-face)))) + +(ert-deftest python-font-lock-raw-escape-sequence () + (python-tests-assert-faces + "rb'\\x12 \123 \\n' +r'\\x12 \123 \\n \\u1234 \\U00010348 \\N{Plus-Minus Sign}'" + '((1) + (3 . font-lock-doc-face) (14) + (16 . font-lock-doc-face)))) + ;;; Indentation commit 83496888aaed10de35b3cbce695600300a30af84 Author: Lars Ingebrigtsen Date: Sat Aug 6 14:50:50 2022 +0200 Fix mh-e.texi syntax (from previous change) * doc/misc/mh-e.texi (Viewing): Add closing brace to @footnote. diff --git a/doc/misc/mh-e.texi b/doc/misc/mh-e.texi index 69e457db36..12841860d9 100644 --- a/doc/misc/mh-e.texi +++ b/doc/misc/mh-e.texi @@ -2098,7 +2098,7 @@ The first header field used, if present, is the Gnus-specific Next is the traditional @samp{X-Face:} header field@footnote{The display of this field requires the @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z, -@command{uncompface} program}. MH-E renders the foreground and +@command{uncompface} program}.} MH-E renders the foreground and background of the image using the associated attributes of the face @code{mh-show-xface}. commit da965ec4748a329a1c5e891100700a793028b6d5 Author: Stefan Kangas Date: Sat Aug 6 14:32:23 2022 +0200 * etc/PROBLEMS: Delete entry on 20+ years old version of X-Symbol. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 98ddd192b4..781a54c06b 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -770,14 +770,6 @@ cause files to be downloaded to the local computer when they are accessed (which could take some time, and Emacs functions accessing the file will wait for that), avoiding the errors. -*** ps-print commands fail to find prologue files ps-prin*.ps. - -This can happen if you use an old version of X-Symbol package: it -defines compatibility functions which trick ps-print into thinking it -runs in XEmacs, and look for the prologue files in a wrong directory. - -The solution is to upgrade X-Symbol to a later version. - *** On systems with shared libraries you might encounter run-time errors from the dynamic linker telling you that it is unable to find some shared libraries, for instance those for Xaw3d or image support. commit a1e07057c416132b3125436010adb876886c6677 Author: Stefan Kangas Date: Sat Aug 6 14:30:09 2022 +0200 * admin/check-doc-strings: Remove XEmacs support. diff --git a/admin/check-doc-strings b/admin/check-doc-strings index 135090b34c..b119b50885 100755 --- a/admin/check-doc-strings +++ b/admin/check-doc-strings @@ -290,13 +290,7 @@ while (my $file = ) { } } -my @pkgs; -if (-d "../xemacs-packages") { - @pkgs = qw (libs/edebug libs/xemacs-base comm/eudc oa/edit-utils); -} else { - @pkgs = (); -} -for (@pkgs) { s@^@../xemacs-packages/@; } +my @pkgs = (); open (FIND, "find lisp @pkgs -name '*.el' -print |") or die; while (my $file = ) { my $contents = FileContents $file; commit db5bc208fb36a09b46582dcf7a4428cb01dca67f Author: Stefan Kangas Date: Sat Aug 6 14:20:39 2022 +0200 Don't mention removed XEmacs support in mh-e manual * doc/misc/mh-e.texi (Preface, Incorporating Mail, Viewing) (Tool Bar, Tool Bar): Remove any reference to XEmacs. diff --git a/doc/misc/mh-e.texi b/doc/misc/mh-e.texi index c1cf44a027..69e457db36 100644 --- a/doc/misc/mh-e.texi +++ b/doc/misc/mh-e.texi @@ -214,9 +214,7 @@ them. The MH-E package is distributed with Emacs@footnote{Version @value{VERSION} of MH-E appeared in Emacs 24.4. It is supported in GNU -Emacs 23 and higher, as well as XEmacs 21.4.22 and 21.5.31. MH-E is -known not to work with GNU Emacs versions 20 and below, and XEmacs -version 21.5.9--21.5.16. It is compatible with MH versions 6.8.4 and +Emacs 23 and higher. It is compatible with MH versions 6.8.4 and higher, all versions of nmh, and GNU mailutils 1.0 and higher}, so you shouldn't have to do anything special to use it. Gnus is also required; version 5.10 or higher is recommended. This manual covers @@ -1501,9 +1499,6 @@ box ~/mail/mh-e command emacsclient --eval '(mh-inc-spool-mh-e)' @end smallexample -In XEmacs, the command @command{gnuclient} is used in a similar -fashion. - @findex mh-inc-folder @kindex i @vindex mh-inc-folder-hook @@ -2090,8 +2085,7 @@ and @samp{X-Image-URL:} will be used. The option This feature will be turned on by default if your system supports it. The first header field used, if present, is the Gnus-specific -@samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU -Emacs 21 and XEmacs. For more information, see +@samp{Face:} field@footnote{For more information, see @uref{https://quimby.gnus.org/circus/face/}.}. @cindex @command{uncompface} @@ -2104,12 +2098,9 @@ Emacs 21 and XEmacs. For more information, see Next is the traditional @samp{X-Face:} header field@footnote{The display of this field requires the @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z, -@command{uncompface} program}. Recent versions of XEmacs have internal -support for @samp{X-Face:} images. If your version of XEmacs does not, -then you'll need both @command{uncompface} and the -@uref{http://www.jpl.org/ftp/pub/elisp/, @samp{x-face} package}.}. MH-E -renders the foreground and background of the image using the -associated attributes of the face @code{mh-show-xface}. +@command{uncompface} program}. MH-E renders the foreground and +background of the image using the associated attributes of the face +@code{mh-show-xface}. @cindex @command{convert} @cindex @command{wget} @@ -6448,17 +6439,9 @@ too long to list here). @item mh-tool-bar-search-function Function called by the tool bar search button (default: @code{mh-search}). -@c ------------------------- -@item mh-xemacs-tool-bar-position -Tool bar location (default: @samp{Same As Default Tool Bar}). -@c ------------------------- -@item mh-xemacs-use-tool-bar-flag -If @samp{on}, use tool bar (default: @samp{on}, if supported). @end vtable -In GNU Emacs, icons for some of MH-E's functions are added to the tool -bar. In XEmacs, you have the opportunity to create a separate tool bar for -the MH-E icons. +Icons for some of MH-E's functions are added to the tool bar. @vindex mh-tool-bar-folder-buttons @vindex mh-tool-bar-letter-buttons @@ -6480,24 +6463,6 @@ option @code{mh-tool-bar-search-function}. By default, this is set to Function} from the @samp{Value Menu} and enter a function of your own choosing. -@vindex mh-xemacs-use-tool-bar-flag - -XEmacs provides a couple of extra options. The first, -@code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E -icons at all. By default, this option is turned on if the window -system supports tool bars. If your system doesn't support tool bars, -then you won't be able to turn on this option. - -@vindex mh-xemacs-tool-bar-position - -The second extra option is @code{mh-xemacs-tool-bar-position} which -controls the placement of the tool bar along the four edges of the -frame. You can choose from one of @samp{Same As Default Tool Bar}, -@samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this -variable is set to anything other than @samp{Same As Default Tool Bar} -and the default tool bar is in a different location, then two tool -bars will be displayed: the MH-E tool bar and the default tool bar. - @node Searching @chapter Searching Through Messages commit fc450db22617ac4d964a64c992a6f4b7581b9cd7 Author: Stefan Kangas Date: Sat Aug 6 14:14:18 2022 +0200 Make alias widget-visibility-value-create obsolete * lisp/wid-edit.el (widget-visibility-value-create): Make compat alias obsolete. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 5362618247..ec2eb146e9 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -3043,12 +3043,10 @@ The following properties have special meanings for this widget: :on "Hide" :off-glyph "right" :off "Show" - :value-create 'widget-visibility-value-create + :value-create 'widget-toggle-value-create :action 'widget-toggle-action :match (lambda (_widget _value) t)) -(defalias 'widget-visibility-value-create 'widget-toggle-value-create) - ;;; The `documentation-link' Widget. ;; ;; This is a helper widget for `documentation-string'. @@ -4143,9 +4141,9 @@ is inline." (setq help-echo (funcall help-echo widget))) (if help-echo (message "%s" (eval help-echo))))) -;;; Obsolete. - (define-obsolete-function-alias 'widget-sublist #'seq-subseq "28.1") +(define-obsolete-function-alias 'widget-visibility-value-create + #'widget-toggle-value-create "29.1") (provide 'wid-edit) commit 5ab557be62c241e51b064702f2fe358d87972b21 Author: Stefan Kangas Date: Sat Aug 6 13:03:38 2022 +0200 ; Adjust time-convert call to recent change * test/lisp/eshell/em-pred-tests.el (eshell-parse-file-name-attributes): Adjust test to recent change. diff --git a/test/lisp/eshell/em-pred-tests.el b/test/lisp/eshell/em-pred-tests.el index c8c1a6a931..ef31a5d147 100644 --- a/test/lisp/eshell/em-pred-tests.el +++ b/test/lisp/eshell/em-pred-tests.el @@ -75,7 +75,7 @@ The following attributes are recognized: (`(,(and (or "links" "uid" "gid" "size") key) ,value) (cons (intern key) (string-to-number value))) (`(,(and (or "atime" "mtime" "ctime") key) ,value) - (cons (intern key) (time-convert (string-to-number value)))) + (cons (intern key) (time-convert (string-to-number value) nil))) (`(,key ,value) (cons (intern key) value)) (_ (error "invalid format %S" i)))) commit 3c4526028c691dd8510b9bcd7d3c629ab12ce39f Author: Stefan Kangas Date: Sat Aug 6 12:59:04 2022 +0200 ; Maintain admin/update_autogen diff --git a/admin/MAINTAINERS b/admin/MAINTAINERS index f0239db008..6e080d1f5b 100644 --- a/admin/MAINTAINERS +++ b/admin/MAINTAINERS @@ -137,6 +137,7 @@ Andrea Corallo Stefan Kangas admin/automerge + admin/update_autogen Po Lu The Haiku port: diff --git a/admin/update_autogen b/admin/update_autogen index 6d844b22f4..d02da74af9 100755 --- a/admin/update_autogen +++ b/admin/update_autogen @@ -4,7 +4,7 @@ ## Copyright (C) 2011-2022 Free Software Foundation, Inc. ## Author: Glenn Morris -## Maintainer: emacs-devel@gnu.org +## Maintainer: Stefan Kangas ## This file is part of GNU Emacs. commit b5145fc66d1a53646b88537eb3438a524b899dcd Author: Stefan Kangas Date: Sat Aug 6 10:34:47 2022 +0200 Make an rmail compat alias obsolete * lisp/mail/rmailsum.el (rmail-summary-output-to-rmail-file): Make compat alias obsolete. diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index cc76df718c..b959f45250 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -1727,8 +1727,6 @@ even if the header display is currently pruned." (if (< i n) (rmail-summary-next-msg 1)))))) -(defalias 'rmail-summary-output-to-rmail-file 'rmail-summary-output) - (declare-function rmail-output-as-seen "rmailout" (file-name &optional count noattribute from-gnus)) @@ -1874,6 +1872,9 @@ the summary is only showing a subset of messages." (funcall sortfun reverse)) (select-window selwin)))) +(define-obsolete-function-alias 'rmail-summary-output-to-rmail-file + #'rmail-summary-output "29.1") + (provide 'rmailsum) ;;; rmailsum.el ends here commit e8613adb0dc290bde41fd15dabbef255f5e00d8f Author: Stefan Kangas Date: Sat Aug 6 10:32:24 2022 +0200 Make compat alias ede-toplevel-project-or-nil obsolete * lisp/cedet/ede/files.el (ede-toplevel-project-or-nil): Make compat alias obsolete. diff --git a/lisp/cedet/ede/files.el b/lisp/cedet/ede/files.el index b8acb192c1..e44ddea32f 100644 --- a/lisp/cedet/ede/files.el +++ b/lisp/cedet/ede/files.el @@ -340,7 +340,7 @@ Optional FORCE means to ignore the hash of known directories." ;; ;; These utilities will identify the "toplevel" of a project. ;; -;; NOTE: These two -toplevel- functions return a directory even though +;; NOTE: This -toplevel- function returns a directory even though ;; the function name implies a project. (defun ede-toplevel-project (dir) @@ -365,8 +365,6 @@ If DIR is not part of a project, return nil." (t nil)))) -(defalias 'ede-toplevel-project-or-nil #'ede-toplevel-project) - ;;; DIRECTORY CONVERSION STUFF ;; (cl-defmethod ede-convert-path ((this ede-project) path) @@ -535,6 +533,7 @@ Argument DIR is the directory to trim upwards." nil fnd))) +(define-obsolete-function-alias 'ede-toplevel-project-or-nil #'ede-toplevel-project "29.1") (provide 'ede/files) diff --git a/lisp/cedet/ede/system.el b/lisp/cedet/ede/system.el index 2da16b37d7..b4fc95c607 100644 --- a/lisp/cedet/ede/system.el +++ b/lisp/cedet/ede/system.el @@ -133,7 +133,7 @@ Download tramp, and use /r:machine: for names on remote sites w/out FTP access." (defun ede-vc-project-directory () "Run `vc-dir' on the current project." (interactive) - (let ((top (ede-toplevel-project-or-nil default-directory))) + (let ((top (ede-toplevel-project default-directory))) (vc-dir top nil))) (provide 'ede/system) commit 2ac3e3eda5ff92b2a2c3a87755fceabf6aa1abed Author: Stefan Kangas Date: Sat Aug 6 10:21:24 2022 +0200 Drop support for XEmacs package func-menu from idlwave * lisp/progmodes/idlwave.el (idlwave-function-menu): Make into obsolete alias for imenu. Update callers. * doc/misc/idlwave.texi (Introduction, Motion Commands): Remove any mention of func-menu. diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 26a6e6c7a3..a1e6535bd8 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -217,7 +217,7 @@ Integrity checks and auto-termination of logical blocks. @item Routine name space conflict search with likelihood-of-use ranking. @item -Support for @file{imenu} (Emacs) and @file{func-menu} (XEmacs). +Support for @file{imenu}. @item Documentation support. @item @@ -2298,12 +2298,11 @@ Regexp matching the start of a document library header. @cindex Motion commands @cindex Program structure, moving through @cindex Code structure, moving through -@cindex @file{Func-menu}, XEmacs package -@cindex @file{Imenu}, Emacs package +@cindex @file{Imenu} @cindex Function definitions, jumping to @cindex Procedure definitions, jumping to -IDLWAVE supports both @file{Imenu} and @file{Func-menu}, two packages +IDLWAVE supports @file{Imenu}, a package which make it easy to jump to the definitions of functions and procedures in the current file with a pop-up selection. To bind @file{Imenu} to a mouse-press, use in your @file{.emacs}: diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index b3dc3cac76..b290854e1b 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -8811,7 +8811,7 @@ to reset the variable `idlwave-true-path-alist' to nil." ;; ---------------------------------------------------------------------------- ;; -;; Additions for use with imenu.el and func-menu.el +;; Additions for use with imenu.el ;; (pop-up a list of IDL units in the current file). ;; @@ -8835,16 +8835,7 @@ Assumes that point is at the beginning of the unit as found by "[a-zA-Z_][a-zA-Z0-9$_]+\\(::[a-zA-Z_][a-zA-Z0-9$_]+\\)?") (buffer-substring-no-properties begin (point)))) -(defalias 'idlwave-function-menu - (condition-case nil - (progn - (require 'func-menu) - 'function-menu) - (error (condition-case nil - (progn - (require 'imenu) - 'imenu) - (error nil))))) +(define-obsolete-function-alias 'idlwave-function-menu #'imenu "29.1") (defun idlwave-edit-in-idlde () "Edit the current file in IDL Development environment." @@ -8864,7 +8855,7 @@ Assumes that point is at the beginning of the unit as found by ;; Menus - using easymenu.el (defvar idlwave-mode-menu-def '("IDLWAVE" - ["PRO/FUNC menu" idlwave-function-menu t] + ["PRO/FUNC menu" imenu t] ("Motion" ["Subprogram Start" idlwave-beginning-of-subprogram t] ["Subprogram End" idlwave-end-of-subprogram t] commit 543b5248db5f11ffee71523bdd6a41b8d03c03ab Author: Stefan Kangas Date: Sat Aug 6 10:13:19 2022 +0200 Make face-doc-string aliases obsolete * lisp/faces.el (face-doc-string, set-face-doc-string): Make aliases obsolete. diff --git a/lisp/faces.el b/lisp/faces.el index 0418cd4c05..d75c66f881 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -657,8 +657,8 @@ If FACE is a face-alias, get the documentation for the target face." (put face 'face-documentation (purecopy string))) -(defalias 'face-doc-string 'face-documentation) -(defalias 'set-face-doc-string 'set-face-documentation) +(define-obsolete-function-alias 'face-doc-string #'face-documentation "29.1") +(define-obsolete-function-alias 'set-face-doc-string #'set-face-documentation "29.1") commit faf231edcc91c67559b7c19f99a0b5265d2e5341 Author: Stefan Kangas Date: Sat Aug 6 10:12:18 2022 +0200 ; * lisp/gnus/mm-util.el: Remove duplicate defalias. diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 727e3abfff..48cca45cb9 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -673,7 +673,6 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'." inhibit-file-name-handlers))) (write-region start end filename append visit lockname))) -(defalias 'mm-make-temp-file 'make-temp-file) (define-obsolete-function-alias 'mm-make-temp-file 'make-temp-file "26.1") (defvar mm-image-load-path-cache nil) commit 4be147b67762b7728c4ff27309b0f95ad14b6468 Author: Stefan Kangas Date: Sat Aug 6 12:21:40 2022 +0200 * admin/update_autogen: Fix generating ldefs-boot.el. diff --git a/admin/update_autogen b/admin/update_autogen index c047481f60..6d844b22f4 100755 --- a/admin/update_autogen +++ b/admin/update_autogen @@ -81,7 +81,6 @@ ldefs_flag=1 lboot_flag= ## Parameters. -ldefs_in=lisp/loaddefs.el ldefs_out=lisp/ldefs-boot.el sources="configure.ac lib/Makefile.am" ## Files to copy into autogendir. @@ -177,8 +176,6 @@ modified=$(status ${autogendir:+$sources} ${ldefs_flag:+lisp}) || die echo "Running 'make maintainer-clean'..." make maintainer-clean #|| die "Cleaning error" - - rm -f $ldefs_in } @@ -289,13 +286,8 @@ make -C src "$@" bootstrap-emacs || die "make src error" echo "Running lisp/ make..." -make -C lisp "$@" autoloads EMACS=../src/bootstrap-emacs || die "make src error" - +make -C lisp "$@" ldefs-boot.el EMACS=../src/bootstrap-emacs || die "make src error" -## Ignore comment differences. -[ ! "$lboot_flag" ] || \ - diff -q -I '^;' $ldefs_in $ldefs_out || \ - cp $ldefs_in $ldefs_out || die "cp ldefs_boot error" # Refresh the prebuilt grammar-wy.el grammar_in=lisp/cedet/semantic/grammar-wy.el commit 907ad6522a823b45f52f2b54f9cfb11099664782 Author: Stefan Kangas Date: Sat Aug 6 11:46:43 2022 +0200 * admin/update_autogen: Fix refreshing grammar-wy.el. diff --git a/admin/update_autogen b/admin/update_autogen index bfbf9d15c2..c047481f60 100755 --- a/admin/update_autogen +++ b/admin/update_autogen @@ -300,7 +300,7 @@ make -C lisp "$@" autoloads EMACS=../src/bootstrap-emacs || die "make src error" # Refresh the prebuilt grammar-wy.el grammar_in=lisp/cedet/semantic/grammar-wy.el grammar_out=lisp/cedet/semantic/grm-wy-boot.el -make -C admin/grammars/ ../../$grammar_in +make -C admin/grammars/ ../../$grammar_in EMACS=../../src/bootstrap-emacs cp $grammar_in $grammar_out || die "cp grm_wy_boot error" commit 870be1e106dc4af90d95860aa60953aea2fbff30 Author: Lars Ingebrigtsen Date: Sat Aug 6 11:41:40 2022 +0200 Put no-byte-compile cookie back in ldefs-boot.el diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 353ac443e3..429d7ab532 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -35815,6 +35815,7 @@ Zone out, completely." t nil) (provide 'loaddefs) ;; Local Variables: +;; no-byte-compile: t ;; version-control: never ;; no-update-autoloads: t ;; coding: utf-8-emacs-unix commit e89532c7c7c5098a77f3ec6fb5def98b1f9034a2 Author: Stefan Kangas Date: Sat Aug 6 11:32:32 2022 +0200 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 4d9e7bb997..353ac443e3 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -5014,6 +5014,8 @@ evaluate `compilation-shell-minor-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. +\\{compilation-shell-minor-mode-map} + (fn &optional ARG)" t nil) (autoload 'compilation-minor-mode "compile" "\ Toggle Compilation minor mode. @@ -5037,6 +5039,8 @@ evaluate `compilation-minor-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. +\\{compilation-minor-mode-map} + (fn &optional ARG)" t nil) (autoload 'compilation-next-error-function "compile" "\ Advance to the next error message and visit the file where the error was. @@ -8388,7 +8392,7 @@ A second call of this function without changing point inserts the next match. A call with prefix PREFIX reads the symbol to insert from the minibuffer with completion. -(fn PREFIX)" '("P") nil) +(fn PREFIX)" t nil) (autoload 'ebrowse-tags-loop-continue "ebrowse" "\ Repeat last operation on files in tree. FIRST-TIME non-nil means this is not a repetition, but the first time. @@ -9925,7 +9929,7 @@ When present, ID should be an opaque object used to identify the connection unequivocally. This is rarely needed and not available interactively. -(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) ID)" '((erc-select-read-args)) nil) +(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) ID)" t nil) (defalias 'erc-select #'erc) (autoload 'erc-tls "erc" "\ ERC is a powerful, modular, and extensible IRC client. @@ -9972,7 +9976,7 @@ symbol composed of letters from the Latin alphabet.) This option is generally unneeded, however. See info node `(erc) Connecting' for use cases. Not available interactively. -(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) CLIENT-CERTIFICATE ID)" '((let ((erc-default-port erc-default-port-tls)) (erc-select-read-args))) nil) +(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) CLIENT-CERTIFICATE ID)" t nil) (autoload 'erc-handle-irc-url "erc" "\ Use ERC to IRC on HOST:PORT in CHANNEL as USER with PASSWORD. If ERC is already connected to HOST:PORT, simply /join CHANNEL. @@ -10188,7 +10192,9 @@ it has to be wrapped in `(eval (quote ...))'. If NAME is already defined as a test and Emacs is running in batch mode, an error is signalled. -(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil 'macro) +(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil t) +(function-put 'ert-deftest 'doc-string-elt 3) +(function-put 'ert-deftest 'lisp-indent-function 2) (autoload 'ert-run-tests-batch "ert" "\ Run the tests specified by SELECTOR, printing results to the terminal. @@ -12269,6 +12275,8 @@ evaluate `flymake-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. +\\{flymake-mode-map} + (fn &optional ARG)" t nil) (autoload 'flymake-mode-on "flymake" "\ Turn Flymake mode on." nil nil) @@ -15869,7 +15877,8 @@ inlined into the compiled format versions. This means that if you change its definition, you should explicitly call `ibuffer-recompile-formats'. -(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" nil 'macro) +(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" nil t) +(function-put 'define-ibuffer-column 'lisp-indent-function 'defun) (autoload 'define-ibuffer-sorter "ibuf-macs" "\ Define a method of sorting named NAME. DOCUMENTATION is the documentation of the function, which will be called @@ -15880,7 +15889,9 @@ For sorting, the forms in BODY will be evaluated with `a' bound to one buffer object, and `b' bound to another. BODY should return a non-nil value if and only if `a' is \"less than\" `b'. -(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" nil 'macro) +(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" nil t) +(function-put 'define-ibuffer-sorter 'lisp-indent-function 1) +(function-put 'define-ibuffer-sorter 'doc-string-elt 2) (autoload 'define-ibuffer-op "ibuf-macs" "\ Generate a function which operates on a buffer. OP becomes the name of the function; if it doesn't begin with @@ -15919,7 +15930,9 @@ BODY define the operation; they are forms to evaluate per each marked buffer. BODY is evaluated with `buf' bound to the buffer object. -(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING BEFORE AFTER COMPLEX) &rest BODY)" nil 'macro) +(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING BEFORE AFTER COMPLEX) &rest BODY)" nil t) +(function-put 'define-ibuffer-op 'lisp-indent-function 2) +(function-put 'define-ibuffer-op 'doc-string-elt 3) (autoload 'define-ibuffer-filter "ibuf-macs" "\ Define a filter named NAME. DOCUMENTATION is the documentation of the function. @@ -15934,7 +15947,9 @@ not a particular buffer should be displayed or not. The forms in BODY will be evaluated with BUF bound to the buffer object, and QUALIFIER bound to the current value of the filter. -(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" nil 'macro) +(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" nil t) +(function-put 'define-ibuffer-filter 'lisp-indent-function 2) +(function-put 'define-ibuffer-filter 'doc-string-elt 2) (register-definition-prefixes "ibuf-macs" '("ibuffer-")) @@ -25317,6 +25332,8 @@ evaluate `rectangle-mark-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. +\\{rectangle-mark-mode-map} + (fn &optional ARG)" t nil) (register-definition-prefixes "rect" '("apply-on-rectangle" "clear-rectangle-line" "delete-" "extract-rectangle-" "killed-rectangle" "ope" "rectangle-" "spaces-string" "string-rectangle-")) @@ -35798,7 +35815,6 @@ Zone out, completely." t nil) (provide 'loaddefs) ;; Local Variables: -;; no-byte-compile: t ;; version-control: never ;; no-update-autoloads: t ;; coding: utf-8-emacs-unix