commit e606434be65f55af371eb612b0bfe5f30d1cc859 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Mon Jan 24 15:35:48 2022 +0800 Scale coordinates when checking if a touch event falls inside menu bar * src/xterm.c (handle_one_xevent): Apply scale to touch event coordinates before intersecting them with the menu bar. diff --git a/src/xterm.c b/src/xterm.c index e5bcff1067..6ca270ec06 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11412,8 +11412,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, && xg_event_is_for_menubar (f, event)); if (f && FRAME_X_OUTPUT (f)->toolbar_widget) { - test_rect.x = xev->event_x; - test_rect.y = xev->event_y; + int scale = xg_get_scale (f); + + test_rect.x = xev->event_x / scale; + test_rect.y = xev->event_y / scale; test_rect.width = 1; test_rect.height = 1; commit 8d6fbc4b480f8623a67e9779c490e9df7c941447 Author: Paul Eggert Date: Sun Jan 23 23:22:04 2022 -0800 Avoid glitches in ELC lines in build output * src/verbose.mk.in (AM_V_ELC, AM_V_ELN): Use ifneq not ifdef, as we want have_working_info’s value expanded (Bug#53358). diff --git a/src/verbose.mk.in b/src/verbose.mk.in index eb99e42695..4ec7788442 100644 --- a/src/verbose.mk.in +++ b/src/verbose.mk.in @@ -56,7 +56,7 @@ AM_V_CCLD = @$(info $ CCLD $@) AM_V_CXXLD = @$(info $ CXXLD $@) ifeq ($(HAVE_NATIVE_COMP)-$(NATIVE_DISABLED)-$(ANCIENT),yes--) -ifdef have_working_info +ifneq (,$(have_working_info)) AM_V_ELC = @$(info $ ELC+ELN $@) AM_V_ELN = @$(info $ ELN $@) else @@ -64,7 +64,7 @@ AM_V_ELC = @echo " ELC+ELN " $@; AM_V_ELN = @echo " ELN " $@; endif else -ifdef have_working_info +ifneq (,$(have_working_info)) AM_V_ELC = @$(info $ ELC $@) else AM_V_ELC = @echo " ELC " $@; commit eac4b924cb86ea023d660f2b155ba1f36b4a5843 Author: Po Lu Date: Mon Jan 24 12:54:26 2022 +0800 * src/xterm.c (handle_one_xevent): Drop frame picture on configure. diff --git a/src/xterm.c b/src/xterm.c index 436238c4a1..e5bcff1067 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9892,6 +9892,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, block_input (); if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) font_drop_xrender_surfaces (f); +#ifdef HAVE_XRENDER + if (f && FRAME_X_DOUBLE_BUFFERED_P (f) + && FRAME_X_PICTURE (f) != None) + { + XRenderFreePicture (FRAME_X_DISPLAY (f), + FRAME_X_PICTURE (f)); + FRAME_X_PICTURE (f) = None; + } +#endif unblock_input (); #if defined USE_CAIRO && !defined USE_GTK if (f) commit 45208755d13f23f92edcab4d6959e0fd9423843b Author: Po Lu Date: Mon Jan 24 12:44:55 2022 +0800 Add some code for transparent frame backgrounds without Cairo * src/image.c (svg_load_image): Fix build without native image transforms. * src/xfns.c (set_up_x_back_buffer): (tear_down_x_back_buffer): Free XR picture if present. * src/xftfont.c (xftfont_get_xft_draw): Fix formatting issue. * src/xterm.c (x_xr_ensure_picture): New function. (FRAME_CR_CONTEXT, FRAME_CR_CONTEXT): (FRAME_CR_SURFACE_DESIRED_WIDTH) (FRAME_CR_SURFACE_DESIRED_HEIGHT): Move to separate USE_CAIRO block so the ext data code can be used on builds with XRender as well. (x_xr_apply_ext_clip): (x_xr_reset_ext_clip): New functions. (x_set_clip_rectangles): (x_reset_clip_rectangles): Set ext data on XRender as well. (x_term_init): Look for a picture format appropriate for our purposes. (x_clear_area): Use XRenderFillRectangle to draw backgrounds if available. (x_xrender_color_from_gc_foreground): (x_xrender_color_from_gc_background): New functions. * src/xterm.h (FRAME_X_PICTURE): (FRAME_X_PICTURE_FORMAT) (FRAME_CHECK_XR_VERSION): New macros. (struct x_gc_ext_data): Define on XRender as well. (struct x_display_info): Define ext_codes when using XRender and add new field `pict_format'. (struct x_output): New field `picture'. diff --git a/src/image.c b/src/image.c index 7ee595297f..951531505e 100644 --- a/src/image.c +++ b/src/image.c @@ -10672,11 +10672,16 @@ svg_load_image (struct frame *f, struct image *img, char *contents, viewbox_height = dimension_data.height; #endif +#ifdef HAVE_NATIVE_TRANSFORMS compute_image_size (viewbox_width, viewbox_height, img, &width, &height); width = scale_image_size (width, 1, FRAME_SCALE_FACTOR (f)); height = scale_image_size (height, 1, FRAME_SCALE_FACTOR (f)); +#else + width = viewbox_width; + height = viewbox_height; +#endif if (! check_image_size (f, width, height)) { diff --git a/src/xfns.c b/src/xfns.c index 7123198724..92aed2d46a 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3267,6 +3267,17 @@ x_mark_frame_dirty (struct frame *f) static void set_up_x_back_buffer (struct frame *f) { +#ifdef HAVE_XRENDER + block_input (); + if (FRAME_X_PICTURE (f) != None) + { + XRenderFreePicture (FRAME_X_DISPLAY (f), + FRAME_X_PICTURE (f)); + FRAME_X_PICTURE (f) = None; + } + unblock_input (); +#endif + #ifdef HAVE_XDBE block_input (); if (FRAME_X_WINDOW (f) && !FRAME_X_DOUBLE_BUFFERED_P (f)) @@ -3281,10 +3292,10 @@ set_up_x_back_buffer (struct frame *f) server ran out of memory or we don't have the right kind of visual, just use single-buffered rendering. */ x_catch_errors (FRAME_X_DISPLAY (f)); - FRAME_X_RAW_DRAWABLE (f) = XdbeAllocateBackBufferName ( - FRAME_X_DISPLAY (f), - FRAME_X_WINDOW (f), - XdbeCopied); + FRAME_X_RAW_DRAWABLE (f) + = XdbeAllocateBackBufferName (FRAME_X_DISPLAY (f), + FRAME_X_WINDOW (f), + XdbeCopied); if (x_had_errors_p (FRAME_X_DISPLAY (f))) FRAME_X_RAW_DRAWABLE (f) = FRAME_X_WINDOW (f); x_uncatch_errors_after_check (); @@ -3297,6 +3308,17 @@ set_up_x_back_buffer (struct frame *f) void tear_down_x_back_buffer (struct frame *f) { +#ifdef HAVE_XRENDER + block_input (); + if (FRAME_X_PICTURE (f) != None) + { + XRenderFreePicture (FRAME_X_DISPLAY (f), + FRAME_X_PICTURE (f)); + FRAME_X_PICTURE (f) = None; + } + unblock_input (); +#endif + #ifdef HAVE_XDBE block_input (); if (FRAME_X_WINDOW (f) && FRAME_X_DOUBLE_BUFFERED_P (f)) diff --git a/src/xftfont.c b/src/xftfont.c index f305738410..c2175d9614 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -441,10 +441,10 @@ xftfont_get_xft_draw (struct frame *f) if (! xft_draw) { block_input (); - xft_draw= XftDrawCreate (FRAME_X_DISPLAY (f), - FRAME_X_DRAWABLE (f), - FRAME_X_VISUAL (f), - FRAME_X_COLORMAP (f)); + xft_draw = XftDrawCreate (FRAME_X_DISPLAY (f), + FRAME_X_DRAWABLE (f), + FRAME_X_VISUAL (f), + FRAME_X_COLORMAP (f)); unblock_input (); eassert (xft_draw != NULL); font_put_frame_data (f, Qxft, xft_draw); diff --git a/src/xterm.c b/src/xterm.c index cc0e1a4485..436238c4a1 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -358,6 +358,22 @@ x_flush (struct frame *f) unblock_input (); } +#ifdef HAVE_XRENDER +MAYBE_UNUSED static void +x_xr_ensure_picture (struct frame *f) +{ + if (FRAME_X_PICTURE (f) == None && FRAME_X_PICTURE_FORMAT (f)) + { + XRenderPictureAttributes attrs; + attrs.clip_mask = None; + + FRAME_X_PICTURE (f) = XRenderCreatePicture (FRAME_X_DISPLAY (f), + FRAME_X_RAW_DRAWABLE (f), + FRAME_X_PICTURE_FORMAT (f), + CPClipMask, &attrs); + } +} +#endif /* Remove calls to XFlush by defining XFlush to an empty replacement. Calls to XFlush should be unnecessary because the X output buffer @@ -401,14 +417,7 @@ record_event (char *locus, int type) #endif -#ifdef USE_CAIRO - -#define FRAME_CR_CONTEXT(f) ((f)->output_data.x->cr_context) -#define FRAME_CR_SURFACE_DESIRED_WIDTH(f) \ - ((f)->output_data.x->cr_surface_desired_width) -#define FRAME_CR_SURFACE_DESIRED_HEIGHT(f) \ - ((f)->output_data.x->cr_surface_desired_height) - +#if defined USE_CAIRO || defined HAVE_XRENDER static struct x_gc_ext_data * x_gc_get_ext_data (struct frame *f, GC gc, int create_if_not_found_p) { @@ -441,6 +450,15 @@ x_extension_initialize (struct x_display_info *dpyinfo) dpyinfo->ext_codes = ext_codes; } +#endif + +#ifdef USE_CAIRO + +#define FRAME_CR_CONTEXT(f) ((f)->output_data.x->cr_context) +#define FRAME_CR_SURFACE_DESIRED_WIDTH(f) \ + ((f)->output_data.x->cr_surface_desired_width) +#define FRAME_CR_SURFACE_DESIRED_HEIGHT(f) \ + ((f)->output_data.x->cr_surface_desired_height) #endif /* HAVE_CAIRO */ @@ -1184,11 +1202,37 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type) #endif /* USE_CAIRO */ +#if defined HAVE_XRENDER && !defined USE_CAIRO +MAYBE_UNUSED static void +x_xr_apply_ext_clip (struct frame *f, GC gc) +{ + eassert (FRAME_X_PICTURE (f) != None); + + struct x_gc_ext_data *data = x_gc_get_ext_data (f, gc, 1); + + if (data->n_clip_rects) + XRenderSetPictureClipRectangles (FRAME_X_DISPLAY (f), + FRAME_X_PICTURE (f), + 0, 0, data->clip_rects, + data->n_clip_rects); +} + +MAYBE_UNUSED static void +x_xr_reset_ext_clip (struct frame *f) +{ + XRenderPictureAttributes attrs = { .clip_mask = None }; + + XRenderChangePicture (FRAME_X_DISPLAY (f), + FRAME_X_PICTURE (f), + CPClipMask, &attrs); +} +#endif + static void x_set_clip_rectangles (struct frame *f, GC gc, XRectangle *rectangles, int n) { XSetClipRectangles (FRAME_X_DISPLAY (f), gc, 0, 0, rectangles, n, Unsorted); -#ifdef USE_CAIRO +#if defined USE_CAIRO || defined HAVE_XRENDER eassert (n >= 0 && n <= MAX_CLIP_RECTS); { @@ -1204,7 +1248,7 @@ static void x_reset_clip_rectangles (struct frame *f, GC gc) { XSetClipMask (FRAME_X_DISPLAY (f), gc, None); -#ifdef USE_CAIRO +#if defined USE_CAIRO || defined HAVE_XRENDER { struct x_gc_ext_data *gc_ext = x_gc_get_ext_data (f, gc, 0); @@ -4510,10 +4554,31 @@ x_clear_area (struct frame *f, int x, int y, int width, int height) #ifndef USE_GTK if (FRAME_X_DOUBLE_BUFFERED_P (f)) #endif - XFillRectangle (FRAME_X_DISPLAY (f), - FRAME_X_DRAWABLE (f), - f->output_data.x->reverse_gc, - x, y, width, height); + { +#if defined HAVE_XRENDER && \ + (RENDER_MAJOR > 0 || (RENDER_MINOR >= 2)) + x_xr_ensure_picture (f); + if (FRAME_X_PICTURE (f) != None + && FRAME_CHECK_XR_VERSION (f, 0, 2)) + { + XRenderColor xc; + GC gc = f->output_data.x->reverse_gc; + + x_xr_apply_ext_clip (f, gc); + x_xrender_color_from_gc_foreground (f, gc, &xc); + XRenderFillRectangle (FRAME_X_DISPLAY (f), + PictOpSrc, FRAME_X_PICTURE (f), + &xc, x, y, width, height); + x_xr_reset_ext_clip (f); + x_mark_frame_dirty (f); + } + else +#endif + XFillRectangle (FRAME_X_DISPLAY (f), + FRAME_X_DRAWABLE (f), + f->output_data.x->reverse_gc, + x, y, width, height); + } #ifndef USE_GTK else x_clear_area1 (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), @@ -15431,6 +15496,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) if (!XRenderQueryVersion (dpyinfo->display, &dpyinfo->xrender_major, &dpyinfo->xrender_minor)) dpyinfo->xrender_supported_p = false; + else + dpyinfo->pict_format = XRenderFindVisualFormat (dpyinfo->display, + dpyinfo->visual); } #endif @@ -15714,7 +15782,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) x_session_initialize (dpyinfo); #endif -#ifdef USE_CAIRO +#if defined USE_CAIRO || defined HAVE_XRENDER x_extension_initialize (dpyinfo); #endif @@ -16090,6 +16158,40 @@ init_xterm (void) } #endif +#ifdef HAVE_XRENDER +void +x_xrender_color_from_gc_foreground (struct frame *f, GC gc, XRenderColor *color) +{ + XGCValues xgcv; + XColor xc; + + XGetGCValues (FRAME_X_DISPLAY (f), gc, GCForeground, &xgcv); + xc.pixel = xgcv.foreground; + x_query_colors (f, &xc, 1); + + color->alpha = 65535; + color->red = xc.red; + color->blue = xc.blue; + color->green = xc.green; +} + +void +x_xrender_color_from_gc_background (struct frame *f, GC gc, XRenderColor *color) +{ + XGCValues xgcv; + XColor xc; + + XGetGCValues (FRAME_X_DISPLAY (f), gc, GCBackground, &xgcv); + xc.pixel = xgcv.foreground; + x_query_colors (f, &xc, 1); + + color->alpha = 65535; + color->red = xc.red; + color->blue = xc.blue; + color->green = xc.green; +} +#endif + void syms_of_xterm (void) { diff --git a/src/xterm.h b/src/xterm.h index a4ad57edda..33887be52b 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -54,6 +54,10 @@ typedef Widget xt_or_gtk_widget; #define GTK_CHECK_VERSION(i, j, k) false #endif +#ifdef HAVE_XRENDER +#include +#endif + #ifdef USE_GTK /* Some definitions to reduce conditionals. */ typedef GtkWidget *xt_or_gtk_widget; @@ -148,7 +152,7 @@ struct x_bitmap_record int height, width, depth; }; -#ifdef USE_CAIRO +#if defined USE_CAIRO || defined HAVE_XRENDER struct x_gc_ext_data { #define MAX_CLIP_RECTS 2 @@ -158,7 +162,9 @@ struct x_gc_ext_data /* Clipping rectangles. */ XRectangle clip_rects[MAX_CLIP_RECTS]; }; +#endif +#ifdef USE_CAIRO extern cairo_pattern_t *x_bitmap_stipple (struct frame *, Pixmap); #endif @@ -239,6 +245,11 @@ struct x_display_info /* The Visual being used for this display. */ Visual *visual; +#ifdef HAVE_XRENDER + /* The picture format for this display. */ + XRenderPictFormat *pict_format; +#endif + /* The colormap being used. */ Colormap cmap; @@ -509,7 +520,7 @@ struct x_display_info int xrandr_minor_version; #endif -#ifdef USE_CAIRO +#if defined USE_CAIRO || defined HAVE_XRENDER XExtCodes *ext_codes; #endif @@ -616,6 +627,13 @@ struct x_output window's back buffer. */ Drawable draw_desc; +#ifdef HAVE_XRENDER + /* The Xrender picture that corresponds to this drawable. None + means no picture format was found, or the Xrender extension is + not present. */ + Picture picture; +#endif + /* Flag that indicates whether we've modified the back buffer and need to publish our modifications to the front buffer at a convenient time. */ @@ -933,6 +951,17 @@ extern void x_mark_frame_dirty (struct frame *f); /* This is the Visual which frame F is on. */ #define FRAME_X_VISUAL(f) FRAME_DISPLAY_INFO (f)->visual +#ifdef HAVE_XRENDER +#define FRAME_X_PICTURE_FORMAT(f) FRAME_DISPLAY_INFO (f)->pict_format +#define FRAME_X_PICTURE(f) ((f)->output_data.x->picture) +#define FRAME_CHECK_XR_VERSION(f, major, minor) \ + (FRAME_DISPLAY_INFO (f)->xrender_supported_p \ + && ((FRAME_DISPLAY_INFO (f)->xrender_major == (major) \ + && FRAME_DISPLAY_INFO (f)->xrender_minor >= (minor)) \ + || (FRAME_DISPLAY_INFO (f)->xrender_major > (major)))) +#endif + + /* This is the Colormap which frame F uses. */ #define FRAME_X_COLORMAP(f) FRAME_DISPLAY_INFO (f)->cmap @@ -1212,6 +1241,11 @@ extern void x_cr_draw_frame (cairo_t *, struct frame *); extern Lisp_Object x_cr_export_frames (Lisp_Object, cairo_surface_type_t); #endif +#ifdef HAVE_XRENDER +extern void x_xrender_color_from_gc_foreground (struct frame *, GC, XRenderColor *); +extern void x_xrender_color_from_gc_background (struct frame *, GC, XRenderColor *); +#endif + INLINE int x_display_pixel_height (struct x_display_info *dpyinfo) { commit 3a7b158ffd8d468eb92de1de6418b3831f10142b Author: Po Lu Date: Mon Jan 24 10:21:24 2022 +0800 Get rid of compose status on XI2 * src/xterm.c (handle_one_xevent): Stop assuming compose processing will occur on XI2. diff --git a/src/xterm.c b/src/xterm.c index bf606b1aa4..cc0e1a4485 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10759,7 +10759,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, bv.state = xev->mods.effective; bv.time = xev->time; - memset (&compose_status, 0, sizeof (compose_status)); dpyinfo->last_mouse_glyph_frame = NULL; x_display_set_last_user_time (dpyinfo, xev->time); @@ -11030,12 +11029,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, (see above). */ *finish = X_EVENT_DROP; #endif - /* If not using XIM/XIC, and a compose sequence is in progress, - we break here. Otherwise, chars_matched is always 0. */ - if (compose_status.chars_matched > 0 && nbytes == 0) - goto XI_OTHER; - - memset (&compose_status, 0, sizeof (compose_status)); XSETFRAME (inev.ie.frame_or_window, f); inev.ie.modifiers @@ -11102,7 +11095,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, { nbytes = XLookupString (&xkey, copy_bufptr, copy_bufsiz, &keysym, - &compose_status); + NULL); } } commit dfae76c9915454f9ef0885e1bac160a2c480e1d1 Author: Alan Mackenzie Date: Mon Jan 24 01:08:03 2022 +0000 Expunge read-with-symbol-position and read-symbol-positions-list These are remnants of the old way of determining byte compiler warning positions. * src/lread.c (read_internal_start, read1): Remove initializations amd manipulations of these variables. (syms_of_lread): Remove the declarations of the variables. * lisp/emacs-list/bytecomp.el (compile-defun, byte-compile-from-buffer): Remove bindings of the variables. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index b4604d0735..a34ba37c04 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2215,9 +2215,7 @@ With argument ARG, insert value in current buffer after the form." (start-read-position (point)) (byte-compile-last-warned-form 'nothing) (value (eval - (let ((read-with-symbol-positions (current-buffer)) - (read-symbol-positions-list nil) - (symbols-with-pos-enabled t)) + (let ((symbols-with-pos-enabled t)) (displaying-byte-compile-warnings (byte-compile-sexp (let ((form (read-positioning-symbols (current-buffer)))) @@ -2252,9 +2250,6 @@ With argument ARG, insert value in current buffer after the form." (byte-compile-depth 0) (byte-compile-maxdepth 0) (byte-compile-output nil) - ;; This allows us to get the positions of symbols read. - (read-with-symbol-positions inbuffer) - (read-symbol-positions-list nil) ;; #### This is bound in b-c-close-variables. ;; (byte-compile-warnings byte-compile-warnings) (symbols-with-pos-enabled t)) diff --git a/src/lread.c b/src/lread.c index d868801f42..4ec1df672c 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2537,9 +2537,6 @@ read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end, read_objects_completed = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD, Qnil, false); - if (EQ (Vread_with_symbol_positions, Qt) - || EQ (Vread_with_symbol_positions, stream)) - Vread_symbol_positions_list = Qnil; if (STRINGP (stream) || ((CONSP (stream) && STRINGP (XCAR (stream))))) @@ -2561,10 +2558,6 @@ read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end, } retval = read0 (stream, locate_syms); - if (EQ (Vread_with_symbol_positions, Qt) - || EQ (Vread_with_symbol_positions, stream)) - Vread_symbol_positions_list = Fnreverse (Vread_symbol_positions_list); - /* Empty hashes can be reused; otherwise, reset on next call. */ if (HASH_TABLE_P (read_objects_map) && XHASH_TABLE (read_objects_map)->count > 0) read_objects_map = Qnil; @@ -3873,11 +3866,6 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list, bool locate_syms) result = build_symbol_with_pos (result, make_fixnum (start_position)); - if (EQ (Vread_with_symbol_positions, Qt) - || EQ (Vread_with_symbol_positions, readcharfun)) - Vread_symbol_positions_list - = Fcons (Fcons (result, make_fixnum (start_position)), - Vread_symbol_positions_list); return unbind_to (count, result); } } @@ -5166,35 +5154,6 @@ This variable is obsolete as of Emacs 28.1 and should not be used. */); See documentation of `read' for possible values. */); Vstandard_input = Qt; - DEFVAR_LISP ("read-with-symbol-positions", Vread_with_symbol_positions, - doc: /* If non-nil, add position of read symbols to `read-symbol-positions-list'. - -If this variable is a buffer, then only forms read from that buffer -will be added to `read-symbol-positions-list'. -If this variable is t, then all read forms will be added. -The effect of all other values other than nil are not currently -defined, although they may be in the future. - -The positions are relative to the last call to `read' or -`read-from-string'. It is probably a bad idea to set this variable at -the toplevel; bind it instead. */); - Vread_with_symbol_positions = Qnil; - - DEFVAR_LISP ("read-symbol-positions-list", Vread_symbol_positions_list, - doc: /* A list mapping read symbols to their positions. -This variable is modified during calls to `read' or -`read-from-string', but only when `read-with-symbol-positions' is -non-nil. - -Each element of the list looks like (SYMBOL . CHAR-POSITION), where -CHAR-POSITION is an integer giving the offset of that occurrence of the -symbol from the position where `read' or `read-from-string' started. - -Note that a symbol will appear multiple times in this list, if it was -read multiple times. The list is in the same order as the symbols -were read in. */); - Vread_symbol_positions_list = Qnil; - DEFVAR_LISP ("read-circle", Vread_circle, doc: /* Non-nil means read recursive structures using #N= and #N# syntax. */); Vread_circle = Qt; commit 6cea4d1fdbdcfd6810bfea70ba58d7a45f2d2384 Author: Po Lu Date: Mon Jan 24 08:46:39 2022 +0800 Set IC preedit area on ConfigureNotify * src/xterm.c (handle_one_xevent): Set the preedit spot when a ConfigureNotify event is received. diff --git a/src/xterm.c b/src/xterm.c index 2a4ea883bc..bf606b1aa4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9964,6 +9964,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, #ifdef HAVE_X_I18N if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea)) xic_set_statusarea (f); + + if (f) + { + struct window *w = XWINDOW (f->selected_window); + xic_set_preeditarea (w, w->cursor.x, w->cursor.y); + } #endif } commit f4af1137e663f2644a30778a5466909cac26b4b3 Author: Alan Mackenzie Date: Sun Jan 23 16:41:23 2022 +0000 Bind print-symbols-bare to t in byte-compile-from-buffer * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Bind print-symbols-bare to t here for the benefit of non-defining forms in buffers. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 794dc531ea..b4604d0735 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -468,7 +468,7 @@ Return the compile-time value of FORM." ;; 3.2.3.1, "Processing of Top Level Forms". The semantics are very ;; subtle: see test/lisp/emacs-lisp/bytecomp-tests.el for interesting ;; cases. - (let ((print-symbols-bare t)) + (let ((print-symbols-bare t)) ; Possibly redundant binding. (setf form (macroexp-macroexpand form byte-compile-macro-environment))) (if (eq (car-safe form) 'progn) (cons 'progn @@ -510,7 +510,7 @@ Return the compile-time value of FORM." ;; Don't compile here, since we don't know ;; whether to compile as byte-compile-form ;; or byte-compile-file-form. - (let* ((print-symbols-bare t) + (let* ((print-symbols-bare t) ; Possibly redundant binding. (expanded (macroexpand--all-toplevel form @@ -2239,6 +2239,7 @@ With argument ARG, insert value in current buffer after the form." (case-fold-search nil) (print-length nil) (print-level nil) + (print-symbols-bare t) ;; Prevent edebug from interfering when we compile ;; and put the output into a file. ;; (edebug-all-defs nil) @@ -2370,7 +2371,7 @@ Call from the source buffer." ;; Spill output for the native compiler here (push (make-byte-to-native-top-level :form form :lexical lexical-binding) byte-to-native-top-level-forms)) - (let ((print-symbols-bare t) + (let ((print-symbols-bare t) ; Possibly redundant binding. (print-escape-newlines t) (print-length nil) (print-level nil) @@ -2407,7 +2408,7 @@ list that represents a doc string reference. (let ((dynamic-docstrings byte-compile-dynamic-docstrings)) (with-current-buffer byte-compile--outbuffer (let (position - (print-symbols-bare t)) + (print-symbols-bare t)) ; Possibly redundant binding. ;; Insert the doc string, and make it a comment with #@LENGTH. (and (>= (nth 1 info) 0) dynamic-docstrings @@ -2517,7 +2518,7 @@ list that represents a doc string reference. byte-compile-jump-tables nil)))) (defun byte-compile-preprocess (form &optional _for-effect) - (let ((print-symbols-bare t)) + (let ((print-symbols-bare t)) ; Possibly redundant binding. (setq form (macroexpand-all form byte-compile-macro-environment))) ;; FIXME: We should run byte-optimize-form here, but it currently does not ;; recurse through all the code, so we'd have to fix this first. @@ -3329,7 +3330,7 @@ lambda-expression." (setq byte-compile-noruntime-functions (delq fn byte-compile-noruntime-functions)) ;; Delegate the rest to the normal macro definition. - (let ((print-symbols-bare t)) + (let ((print-symbols-bare t)) ; Possibly redundant binding. (macroexpand `(declare-function ,fn ,file ,@args)))) commit 21a3bd9f36257c77c4206381305b1d768144d446 Author: Lars Ingebrigtsen Date: Sun Jan 23 17:09:55 2022 +0100 Make message in hack-local-variables-confirm clearer * lisp/files.el (hack-local-variables-confirm): Mention the .dir-locals.el file in the message to be slightly less confusing (bug#27066). diff --git a/lisp/files.el b/lisp/files.el index 51c6968cff..e021545cf1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3641,7 +3641,7 @@ DIR-NAME is the name of the associated directory. Otherwise it is nil." (cond (unsafe-vars (insert "The local variables list in " name - "\ncontains values that may not be safe (*)" + "\nor .dir-locals.el contains values that may not be safe (*)" (if risky-vars ", and variables that are risky (**)." "."))) commit a82c3557fc49a5c4f0f71f769daf778770597b95 Author: Lars Ingebrigtsen Date: Sun Jan 23 16:48:42 2022 +0100 Make `C-x M-x insert-kbd-macro RET RET' work better * lisp/macros.el (insert-kbd-macro): Don't give bogus output on names that have no function definition (bug#30309). diff --git a/lisp/macros.el b/lisp/macros.el index 4cb4e98d3f..35d34d2e33 100644 --- a/lisp/macros.el +++ b/lisp/macros.el @@ -134,8 +134,9 @@ use this command, and then save the file." (_ (prin1 definition (current-buffer)))))) (insert ")\n") (if keys - (let ((keys (or (where-is-internal (symbol-function macroname) - '(keymap)) + (let ((keys (or (and (symbol-function macroname) + (where-is-internal (symbol-function macroname) + '(keymap))) (where-is-internal macroname '(keymap))))) (while keys (insert "(global-set-key ") commit 80098a2830cafe0a09f18c5186bf670a91828fef Author: Thuna Date: Sun Jan 23 15:55:48 2022 +0100 Fix tabulated-list-widen-current-column widening wrong column * tabulated-list.el (tabulated-list-widen-current-column): Use correct comparison operation when checking if point is within the column bounds (bug#53375). Copyright-paperwork-exempt: yes diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 32a046e0fb..a242ac1899 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -739,17 +739,17 @@ Interactively, N is the prefix numeric argument, and defaults to col-width) (while (and (not found) (< col-nb nb-cols)) - (if (> start - (setq total-width - (+ total-width - (max (setq col-width - (cadr (aref tabulated-list-format - col-nb))) - (string-width (aref entry col-nb))) - (or (plist-get (nthcdr 3 (aref tabulated-list-format - col-nb)) - :pad-right) - 1)))) + (if (>= start + (setq total-width + (+ total-width + (max (setq col-width + (cadr (aref tabulated-list-format + col-nb))) + (string-width (aref entry col-nb))) + (or (plist-get (nthcdr 3 (aref tabulated-list-format + col-nb)) + :pad-right) + 1)))) (setq col-nb (1+ col-nb)) (setq found t) (setf (cadr (aref tabulated-list-format col-nb)) commit d0f3de72b678608677e1021f3e3c4dd42935b537 Author: Lars Ingebrigtsen Date: Sun Jan 23 15:43:19 2022 +0100 Allow using outline minor mode in `M-x apropos-value' * lisp/apropos.el (apropos-mode): Set up outline minor mode (bug#31094). (apropos-value): Don't add "---" separators, because it doesn't really seem to add anything much. (apropos-value-internal): Escape newlines so that no values can be confused for headings. diff --git a/lisp/apropos.el b/lisp/apropos.el index f47e70ce5c..a98f2328ac 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -493,7 +493,12 @@ Intended as a value for `revert-buffer-function'." \\{apropos-mode-map}" (make-local-variable 'apropos--current) - (setq-local revert-buffer-function #'apropos--revert-buffer)) + (setq-local revert-buffer-function #'apropos--revert-buffer) + (setq-local outline-regexp "^[^ \n]+" + outline-level (lambda () 1) + outline-minor-mode-cycle t + outline-minor-mode-highlight t + outline-minor-mode-use-buttons t)) (defvar apropos-multi-type t "If non-nil, this apropos query concerns multiple types. @@ -846,7 +851,7 @@ Returns list of symbols and values found." f v p) apropos-accumulator)))))) (let ((apropos-multi-type do-all)) - (apropos-print nil "\n----------------\n"))) + (apropos-print nil "\n"))) ;;;###autoload (defun apropos-local-value (pattern &optional buffer) @@ -940,13 +945,14 @@ Returns list of symbols and documentation found." (defun apropos-value-internal (predicate symbol function) (when (funcall predicate symbol) - (setq symbol (prin1-to-string - (if (memq symbol '(command-history minibuffer-history)) - ;; The value we're looking for will always be in - ;; the first element of these two lists, so skip - ;; that value. - (cdr (funcall function symbol)) - (funcall function symbol)))) + (let ((print-escape-newlines t)) + (setq symbol (prin1-to-string + (if (memq symbol '(command-history minibuffer-history)) + ;; The value we're looking for will always be in + ;; the first element of these two lists, so skip + ;; that value. + (cdr (funcall function symbol)) + (funcall function symbol))))) (when (string-match apropos-regexp symbol) (if apropos-match-face (put-text-property (match-beginning 0) (match-end 0) @@ -1156,13 +1162,15 @@ as a heading." (old-buffer (current-buffer)) (inhibit-read-only t) (button-end 0) + (first t) symbol item) (set-buffer standard-output) (apropos-mode) (apropos--preamble text) (dolist (apropos-item p) - (when (and spacing (not (bobp))) - (princ spacing)) + (if (and spacing (not first)) + (princ spacing) + (setq first nil)) (setq symbol (car apropos-item)) ;; Insert dummy score element for backwards compatibility with 21.x ;; apropos-item format. commit a37da91a092c460384bce2ab16341d4e6ec06a9b Author: Lars Ingebrigtsen Date: Sun Jan 23 15:08:34 2022 +0100 Make apropos-print-doc more resilient * lisp/apropos.el (apropos-print-doc): Don't bug out on doc strings that have invalid command key syntaxes. diff --git a/lisp/apropos.el b/lisp/apropos.el index 6ff444f868..f47e70ce5c 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -1276,7 +1276,9 @@ as a heading." (cond ((equal doc "") (setq doc "(not documented)")) (do-keys - (setq doc (substitute-command-keys doc)))) + (setq doc (or (ignore-errors + (substitute-command-keys doc)) + doc)))) (insert doc) (if (equal doc "(not documented)") (put-text-property opoint (point) 'font-lock-face 'shadow)) commit 3b0d848b5471a9bb1602d95cdbb6fde5416b0a96 Author: Alan Mackenzie Date: Sun Jan 23 13:47:38 2022 +0000 Fix position argument to macroexp--warn-wrap in cconv--convert-funcbody * lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): Change the position argument to macroexp--warn-wrap from BODY to ARG, to give correct positions in warning messages. diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index 7b22121db0..c16619bc45 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -286,7 +286,7 @@ of converted forms." (let (and (pred stringp) msg) (cconv--warn-unused-msg arg "argument"))) (if (assq arg env) (push `(,arg . nil) env)) ;FIXME: Is it needed? - (push (lambda (body) (macroexp--warn-wrap body msg body 'lexical)) wrappers)) + (push (lambda (body) (macroexp--warn-wrap arg msg body 'lexical)) wrappers)) (_ (if (assq arg env) (push `(,arg . nil) env))))) (setq funcbody (mapcar (lambda (form) commit 9f5048456af11b533c8762d8e1f7d63cda896535 Author: Lars Ingebrigtsen Date: Sun Jan 23 14:46:55 2022 +0100 Improve `M-x speedbar' under emacs -nw very slightly * lisp/speedbar.el (speedbar-frame-mode): `M-x speedbar' doesn't seem to do anything visible under -nw, so issue a message in that case to tell the user how to proceed (bug#32597). diff --git a/lisp/speedbar.el b/lisp/speedbar.el index e63a2642fe..b2e7be1505 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -938,7 +938,9 @@ supported at a time. ;; hscroll (setq-local auto-hscroll-mode nil) ;; reset the selection variable - (setq speedbar-last-selected-file nil)) + (setq speedbar-last-selected-file nil) + (unless (display-graphic-p) + (message "Use `M-x speedbar-get-focus' to see the speedbar window"))) (defun speedbar-frame-reposition-smartly () "Reposition the speedbar frame to be next to the attached frame." commit db454c98f1eaf91eff5394e9a0eef1370bd84652 Author: Lars Ingebrigtsen Date: Sun Jan 23 14:37:25 2022 +0100 Regenerate ldefs-boot.el diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 05d461e41e..6ddce2eba3 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -7867,7 +7867,7 @@ any buffer where (dictionary-tooltip-mode 1) has been called. \(fn &optional ARG)" t nil) -(autoload 'context-menu-dictionary "dictionary" "\ +(autoload 'dictionary-context-menu "dictionary" "\ Populate MENU with dictionary commands at CLICK. When you add this function to `context-menu-functions', the context menu will contain an item that searches @@ -9580,7 +9580,10 @@ This applies to `eval-defun', `eval-region', `eval-buffer', and You can use the command `edebug-all-defs' to toggle the value of this variable. You may wish to make it local to each buffer with \(make-local-variable \\='edebug-all-defs) in your -`emacs-lisp-mode-hook'.") +`emacs-lisp-mode-hook'. + +Note that this user option has no effect unless the edebug +package has been loaded.") (custom-autoload 'edebug-all-defs "edebug" t) @@ -10535,8 +10538,9 @@ Choose and insert one of the recently-used emoji glyphs." t nil) (autoload 'emoji-search "emoji" "\ Choose and insert an emoji glyph by typing its Unicode name. -This command prompts for an emoji name, with completion, and inserts it. -It recognizes the Unicode Standard names of emoji." t nil) +This command prompts for an emoji name, with completion, and +inserts it. It recognizes the Unicode Standard names of emoji, +and also consults the `emoji-alternate-names' alist." t nil) (autoload 'emoji-list "emoji" "\ List emojis and insert the one that's selected. @@ -15190,12 +15194,6 @@ LIST1 and LIST2 have to be sorted over <. \(fn LIST1 LIST2)" nil nil) -(autoload 'gnus-sorted-range-intersection "gnus-range" "\ -Return intersection of RANGE1 and RANGE2. -RANGE1 and RANGE2 have to be sorted over <. - -\(fn RANGE1 RANGE2)" nil nil) - (defalias 'gnus-set-sorted-intersection 'gnus-sorted-nintersection) (autoload 'gnus-sorted-nintersection "gnus-range" "\ @@ -16802,7 +16800,7 @@ Populate MENU with a menu item to highlight symbol at CLICK. \(fn MENU CLICK)" nil nil) -(register-definition-prefixes "hi-lock" '("hi-lock-" "turn-on-hi-lock-if-enabled")) +(register-definition-prefixes "hi-lock" '("hi-lock-" "highlight-symbol-at-mouse" "turn-on-hi-lock-if-enabled")) ;;;*** @@ -19551,7 +19549,7 @@ Valid forms include: (KEY REGEXP) - skip to end of REGEXP. REGEXP must be a string. (KEY FUNCTION ARGS) - FUNCTION called with ARGS returns end of region.") -(defvar ispell-tex-skip-alists (purecopy '((("\\\\addcontentsline" ispell-tex-arg-end 2) ("\\\\add\\(tocontents\\|vspace\\)" ispell-tex-arg-end) ("\\\\\\([aA]lph\\|arabic\\)" ispell-tex-arg-end) ("\\\\cref" ispell-tex-arg-end) ("\\\\bibliographystyle" ispell-tex-arg-end) ("\\\\makebox" ispell-tex-arg-end 0) ("\\\\e?psfig" ispell-tex-arg-end) ("\\\\document\\(class\\|style\\)" . "\\\\begin[ \11\n]*{[ \11\n]*document[ \11\n]*}")) (("\\(figure\\|table\\)\\*?" ispell-tex-arg-end 0) ("list" ispell-tex-arg-end 2) ("program" . "\\\\end[ \11\n]*{[ \11\n]*program[ \11\n]*}") ("verbatim\\*?" . "\\\\end[ \11\n]*{[ \11\n]*verbatim\\*?[ \11\n]*}")))) "\ +(defvar ispell-tex-skip-alists (purecopy '((("\\\\addcontentsline" ispell-tex-arg-end 2) ("\\\\add\\(tocontents\\|vspace\\)" ispell-tex-arg-end) ("\\\\\\([aA]lph\\|arabic\\)" ispell-tex-arg-end) ("\\\\cref" ispell-tex-arg-end) ("\\\\bibliographystyle" ispell-tex-arg-end) ("\\\\makebox" ispell-tex-arg-end 0) ("\\\\e?psfig" ispell-tex-arg-end) ("\\\\document\\(class\\|style\\)" . "\\\\begin[ \11\n]*{document}")) (("\\(figure\\|table\\)\\*?" ispell-tex-arg-end 0) ("list" ispell-tex-arg-end 2) ("program" . "\\\\end[ \11]*{program}") ("verbatim\\*?" . "\\\\end[ \11]*{verbatim\\*?}")))) "\ Lists of regions to be skipped in TeX mode. First list is used raw. Second list has key placed inside \\begin{}. @@ -27798,6 +27796,13 @@ Display `quickurl-list' as a formatted list using `quickurl-list-mode'." t nil) (register-definition-prefixes "radix-tree" '("radix-tree-")) +;;;*** + +;;;### (autoloads nil "range" "emacs-lisp/range.el" (0 0 0 0)) +;;; Generated autoloads from emacs-lisp/range.el + +(register-definition-prefixes "range" '("range-")) + ;;;*** ;;;### (autoloads nil "rcirc" "net/rcirc.el" (0 0 0 0)) @@ -32917,6 +32922,11 @@ this defaults to the current buffer. \(fn START END PROP VALUE &optional OBJECT)" nil nil) +(autoload 'read-process-name "subr-x" "\ +Query the user for a process and return the process object. + +\(fn PROMPT)" nil nil) + (register-definition-prefixes "subr-x" '("and-let*" "hash-table-" "if-let*" "internal--" "named-let" "replace-region-contents" "string-" "thread-" "when-let*" "with-memoization")) ;;;*** @@ -34463,6 +34473,51 @@ value of `texinfo-mode-hook'. (register-definition-prefixes "text-property-search" '("text-property-")) +;;;*** + +;;;### (autoloads nil "textsec" "international/textsec.el" (0 0 0 +;;;;;; 0)) +;;; Generated autoloads from international/textsec.el + +(register-definition-prefixes "textsec" '("textsec-")) + +;;;*** + +;;;### (autoloads nil "textsec-check" "international/textsec-check.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from international/textsec-check.el + +(autoload 'textsec-suspicious-p "textsec-check" "\ +Say whether OBJECT is suspicious for use as TYPE. +If OBJECT is suspicious, return a string explaining the reason +for considering it suspicious, otherwise return nil. + +Available values of TYPE and corresponding OBJECTs are: + + `url' -- a URL; OBJECT should be a URL string. + + `link' -- an HTML link; OBJECT should be a cons cell + of the form (URL . LINK-TEXT). + + `domain' -- a Web domain; OBJECT should be a string. + + `local-address' -- the local part of an email address; OBJECT + should be a string. + `name' -- the \"display name\" part of an email address; + OBJECT should be a string. + +`email-address' -- a full email address; OBJECT should be a string. + + `email-address-header' -- a raw email address header in RFC 2822 format; + OBJECT should be a string. + +If the user option `textsec-check' is nil, these checks are +disabled, and this function always returns nil. + +\(fn OBJECT TYPE)" nil nil) + +(register-definition-prefixes "textsec-check" '("textsec-check")) + ;;;*** ;;;### (autoloads nil "thai-util" "language/thai-util.el" (0 0 0 @@ -40116,62 +40171,64 @@ Zone out, completely." t nil) ;;;;;; "international/charprop.el" "international/charscript.el" ;;;;;; "international/cp51932.el" "international/emoji-labels.el" ;;;;;; "international/emoji-zwj.el" "international/eucjp-ms.el" -;;;;;; "international/iso-transl.el" "international/mule-cmds.el" -;;;;;; "international/mule-conf.el" "international/mule.el" "international/uni-bidi.el" -;;;;;; "international/uni-brackets.el" "international/uni-category.el" -;;;;;; "international/uni-combining.el" "international/uni-comment.el" +;;;;;; "international/idna-mapping.el" "international/iso-transl.el" +;;;;;; "international/mule-cmds.el" "international/mule-conf.el" +;;;;;; "international/mule.el" "international/uni-bidi.el" "international/uni-brackets.el" +;;;;;; "international/uni-category.el" "international/uni-combining.el" +;;;;;; "international/uni-comment.el" "international/uni-confusable.el" ;;;;;; "international/uni-decimal.el" "international/uni-decomposition.el" ;;;;;; "international/uni-digit.el" "international/uni-lowercase.el" ;;;;;; "international/uni-mirrored.el" "international/uni-name.el" ;;;;;; "international/uni-numeric.el" "international/uni-old-name.el" -;;;;;; "international/uni-special-lowercase.el" "international/uni-special-titlecase.el" -;;;;;; "international/uni-special-uppercase.el" "international/uni-titlecase.el" -;;;;;; "international/uni-uppercase.el" "isearch.el" "jit-lock.el" -;;;;;; "jka-cmpr-hook.el" "keymap.el" "language/burmese.el" "language/cham.el" -;;;;;; "language/chinese.el" "language/cyrillic.el" "language/czech.el" -;;;;;; "language/english.el" "language/ethiopic.el" "language/european.el" -;;;;;; "language/georgian.el" "language/greek.el" "language/hebrew.el" -;;;;;; "language/indian.el" "language/japanese.el" "language/khmer.el" -;;;;;; "language/korean.el" "language/lao.el" "language/misc-lang.el" -;;;;;; "language/romanian.el" "language/sinhala.el" "language/slovak.el" -;;;;;; "language/tai-viet.el" "language/thai.el" "language/tibetan.el" -;;;;;; "language/utf-8-lang.el" "language/vietnamese.el" "ldefs-boot.el" -;;;;;; "leim/ja-dic/ja-dic.el" "leim/leim-list.el" "leim/quail/4Corner.el" -;;;;;; "leim/quail/ARRAY30.el" "leim/quail/CCDOSPY.el" "leim/quail/CTLau-b5.el" -;;;;;; "leim/quail/CTLau.el" "leim/quail/ECDICT.el" "leim/quail/ETZY.el" -;;;;;; "leim/quail/PY-b5.el" "leim/quail/PY.el" "leim/quail/Punct-b5.el" -;;;;;; "leim/quail/Punct.el" "leim/quail/QJ-b5.el" "leim/quail/QJ.el" -;;;;;; "leim/quail/SW.el" "leim/quail/TONEPY.el" "leim/quail/ZIRANMA.el" -;;;;;; "leim/quail/ZOZY.el" "leim/quail/arabic.el" "leim/quail/cham.el" -;;;;;; "leim/quail/compose.el" "leim/quail/croatian.el" "leim/quail/cyril-jis.el" -;;;;;; "leim/quail/cyrillic.el" "leim/quail/czech.el" "leim/quail/emoji.el" -;;;;;; "leim/quail/georgian.el" "leim/quail/greek.el" "leim/quail/hanja-jis.el" -;;;;;; "leim/quail/hanja.el" "leim/quail/hanja3.el" "leim/quail/hebrew.el" -;;;;;; "leim/quail/ipa-praat.el" "leim/quail/latin-alt.el" "leim/quail/latin-ltx.el" -;;;;;; "leim/quail/latin-post.el" "leim/quail/latin-pre.el" "leim/quail/persian.el" -;;;;;; "leim/quail/programmer-dvorak.el" "leim/quail/py-punct.el" -;;;;;; "leim/quail/pypunct-b5.el" "leim/quail/quick-b5.el" "leim/quail/quick-cns.el" -;;;;;; "leim/quail/rfc1345.el" "leim/quail/sami.el" "leim/quail/sgml-input.el" -;;;;;; "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" "leim/quail/tamil-dvorak.el" -;;;;;; "leim/quail/tsang-b5.el" "leim/quail/tsang-cns.el" "leim/quail/vntelex.el" -;;;;;; "leim/quail/vnvni.el" "leim/quail/welsh.el" "loadup.el" "mail/blessmail.el" -;;;;;; "mail/undigest.el" "menu-bar.el" "mh-e/mh-gnus.el" "minibuffer.el" -;;;;;; "mouse.el" "newcomment.el" "obarray.el" "org/ob-core.el" -;;;;;; "org/ob-lob.el" "org/ob-matlab.el" "org/ob-tangle.el" "org/ob.el" -;;;;;; "org/ol-bbdb.el" "org/ol-irc.el" "org/ol.el" "org/org-archive.el" -;;;;;; "org/org-attach.el" "org/org-clock.el" "org/org-colview.el" -;;;;;; "org/org-compat.el" "org/org-datetree.el" "org/org-duration.el" -;;;;;; "org/org-element.el" "org/org-feed.el" "org/org-footnote.el" -;;;;;; "org/org-goto.el" "org/org-id.el" "org/org-indent.el" "org/org-install.el" -;;;;;; "org/org-keys.el" "org/org-lint.el" "org/org-list.el" "org/org-macs.el" -;;;;;; "org/org-mobile.el" "org/org-num.el" "org/org-plot.el" "org/org-refile.el" -;;;;;; "org/org-table.el" "org/org-timer.el" "org/ox-ascii.el" "org/ox-beamer.el" -;;;;;; "org/ox-html.el" "org/ox-icalendar.el" "org/ox-latex.el" -;;;;;; "org/ox-md.el" "org/ox-odt.el" "org/ox-org.el" "org/ox-publish.el" -;;;;;; "org/ox-texinfo.el" "org/ox.el" "paren.el" "progmodes/elisp-mode.el" -;;;;;; "progmodes/prog-mode.el" "ps-mule.el" "register.el" "replace.el" -;;;;;; "rfn-eshadow.el" "select.el" "simple.el" "startup.el" "subdirs.el" -;;;;;; "subr.el" "tab-bar.el" "textmodes/fill.el" "textmodes/makeinfo.el" +;;;;;; "international/uni-scripts.el" "international/uni-special-lowercase.el" +;;;;;; "international/uni-special-titlecase.el" "international/uni-special-uppercase.el" +;;;;;; "international/uni-titlecase.el" "international/uni-uppercase.el" +;;;;;; "isearch.el" "jit-lock.el" "jka-cmpr-hook.el" "keymap.el" +;;;;;; "language/burmese.el" "language/cham.el" "language/chinese.el" +;;;;;; "language/cyrillic.el" "language/czech.el" "language/english.el" +;;;;;; "language/ethiopic.el" "language/european.el" "language/georgian.el" +;;;;;; "language/greek.el" "language/hebrew.el" "language/indian.el" +;;;;;; "language/japanese.el" "language/khmer.el" "language/korean.el" +;;;;;; "language/lao.el" "language/misc-lang.el" "language/romanian.el" +;;;;;; "language/sinhala.el" "language/slovak.el" "language/tai-viet.el" +;;;;;; "language/thai.el" "language/tibetan.el" "language/utf-8-lang.el" +;;;;;; "language/vietnamese.el" "ldefs-boot.el" "leim/ja-dic/ja-dic.el" +;;;;;; "leim/leim-list.el" "leim/quail/4Corner.el" "leim/quail/ARRAY30.el" +;;;;;; "leim/quail/CCDOSPY.el" "leim/quail/CTLau-b5.el" "leim/quail/CTLau.el" +;;;;;; "leim/quail/ECDICT.el" "leim/quail/ETZY.el" "leim/quail/PY-b5.el" +;;;;;; "leim/quail/PY.el" "leim/quail/Punct-b5.el" "leim/quail/Punct.el" +;;;;;; "leim/quail/QJ-b5.el" "leim/quail/QJ.el" "leim/quail/SW.el" +;;;;;; "leim/quail/TONEPY.el" "leim/quail/ZIRANMA.el" "leim/quail/ZOZY.el" +;;;;;; "leim/quail/arabic.el" "leim/quail/cham.el" "leim/quail/compose.el" +;;;;;; "leim/quail/croatian.el" "leim/quail/cyril-jis.el" "leim/quail/cyrillic.el" +;;;;;; "leim/quail/czech.el" "leim/quail/emoji.el" "leim/quail/georgian.el" +;;;;;; "leim/quail/greek.el" "leim/quail/hanja-jis.el" "leim/quail/hanja.el" +;;;;;; "leim/quail/hanja3.el" "leim/quail/hebrew.el" "leim/quail/ipa-praat.el" +;;;;;; "leim/quail/latin-alt.el" "leim/quail/latin-ltx.el" "leim/quail/latin-post.el" +;;;;;; "leim/quail/latin-pre.el" "leim/quail/persian.el" "leim/quail/programmer-dvorak.el" +;;;;;; "leim/quail/py-punct.el" "leim/quail/pypunct-b5.el" "leim/quail/quick-b5.el" +;;;;;; "leim/quail/quick-cns.el" "leim/quail/rfc1345.el" "leim/quail/sami.el" +;;;;;; "leim/quail/sgml-input.el" "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" +;;;;;; "leim/quail/tamil-dvorak.el" "leim/quail/tsang-b5.el" "leim/quail/tsang-cns.el" +;;;;;; "leim/quail/vntelex.el" "leim/quail/vnvni.el" "leim/quail/welsh.el" +;;;;;; "loadup.el" "mail/blessmail.el" "mail/undigest.el" "menu-bar.el" +;;;;;; "mh-e/mh-gnus.el" "minibuffer.el" "mouse.el" "newcomment.el" +;;;;;; "obarray.el" "org/ob-core.el" "org/ob-lob.el" "org/ob-matlab.el" +;;;;;; "org/ob-tangle.el" "org/ob.el" "org/ol-bbdb.el" "org/ol-irc.el" +;;;;;; "org/ol.el" "org/org-archive.el" "org/org-attach.el" "org/org-clock.el" +;;;;;; "org/org-colview.el" "org/org-compat.el" "org/org-datetree.el" +;;;;;; "org/org-duration.el" "org/org-element.el" "org/org-feed.el" +;;;;;; "org/org-footnote.el" "org/org-goto.el" "org/org-id.el" "org/org-indent.el" +;;;;;; "org/org-install.el" "org/org-keys.el" "org/org-lint.el" +;;;;;; "org/org-list.el" "org/org-macs.el" "org/org-mobile.el" "org/org-num.el" +;;;;;; "org/org-plot.el" "org/org-refile.el" "org/org-table.el" +;;;;;; "org/org-timer.el" "org/ox-ascii.el" "org/ox-beamer.el" "org/ox-html.el" +;;;;;; "org/ox-icalendar.el" "org/ox-latex.el" "org/ox-md.el" "org/ox-odt.el" +;;;;;; "org/ox-org.el" "org/ox-publish.el" "org/ox-texinfo.el" "org/ox.el" +;;;;;; "paren.el" "progmodes/elisp-mode.el" "progmodes/prog-mode.el" +;;;;;; "ps-mule.el" "register.el" "replace.el" "rfn-eshadow.el" +;;;;;; "select.el" "simple.el" "startup.el" "subdirs.el" "subr.el" +;;;;;; "tab-bar.el" "textmodes/fill.el" "textmodes/makeinfo.el" ;;;;;; "textmodes/page.el" "textmodes/paragraphs.el" "textmodes/reftex-auc.el" ;;;;;; "textmodes/reftex-cite.el" "textmodes/reftex-dcr.el" "textmodes/reftex-global.el" ;;;;;; "textmodes/reftex-index.el" "textmodes/reftex-parse.el" "textmodes/reftex-ref.el" @@ -40187,6 +40244,6 @@ Zone out, completely." t nil) ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; coding: utf-8-emacs-unix ;; End: ;;; loaddefs.el ends here commit 838ad7037be9ce8e07b269426d17198d295fe20e Author: Lars Ingebrigtsen Date: Sun Jan 23 14:36:54 2022 +0100 Make kill-process into a command * doc/lispref/processes.texi (Signals to Processes): Document it. * src/process.c (Fkill_process): Make into a command (bug#32640). diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index a38a84e22b..d338d59a81 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -1422,11 +1422,13 @@ non-@code{nil}, you can think of this function as typing @kbd{C-c} on the terminal by which Emacs talks to the subprocess. @end defun -@defun kill-process &optional process current-group -This function kills the process @var{process} by sending the +@deffn Command kill-process &optional process current-group +This command kills the process @var{process} by sending the signal @code{SIGKILL}. This signal kills the subprocess immediately, -and cannot be handled by the subprocess. -@end defun +and cannot be handled by the subprocess. Interactively, it'll prompt +the user for a process name, defaulting to the process (if any) in the +current buffer. +@end deffn @defun quit-process &optional process current-group This function sends the signal @code{SIGQUIT} to the process diff --git a/src/process.c b/src/process.c index 9664180cfd..79e5896a20 100644 --- a/src/process.c +++ b/src/process.c @@ -6934,7 +6934,8 @@ the order of the list, until one of them returns non-nil. */) process, current_group); } -DEFUN ("kill-process", Fkill_process, Skill_process, 0, 2, 0, +DEFUN ("kill-process", Fkill_process, Skill_process, 0, 2, + "(list (read-process-name \"Kill process\"))", doc: /* Kill process PROCESS. May be process or name of one. See function `interrupt-process' for more details on usage. */) (Lisp_Object process, Lisp_Object current_group) commit 1c1d5eee4c8efb6f2271bb30b32d0cb8ef2afa7d Author: Phil Sainty Date: Sun Jan 23 14:35:52 2022 +0100 Add new function to prompt a user for a process name * lisp/emacs-lisp/subr-x.el (read-process-name): New function (bug#32640). diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 43e0fc4c9d..1f69850958 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -511,6 +511,48 @@ this defaults to the current buffer." (put-text-property sub-start sub-end 'display disp))) (setq sub-start sub-end)))) +;;;###autoload +(defun read-process-name (prompt) + "Query the user for a process and return the process object." + ;; Currently supports only the PROCESS argument. + ;; Must either return a list containing a process, or signal an error. + ;; (Returning `nil' would mean the current buffer's process.) + (unless (fboundp 'process-list) + (error "Asynchronous subprocesses are not supported on this system")) + ;; Local function to return cons of a complete-able name, and the + ;; associated process object, for use with `completing-read'. + (cl-flet ((procitem + (p) (when (process-live-p p) + (let ((pid (process-id p)) + (procname (process-name p)) + (procbuf (process-buffer p))) + (and (eq (process-type p) 'real) + (cons (if procbuf + (format "%s (%s) in buffer %s" + procname pid + (buffer-name procbuf)) + (format "%s (%s)" procname pid)) + p)))))) + ;; Perform `completing-read' for a process. + (let* ((currproc (get-buffer-process (current-buffer))) + (proclist (or (process-list) + (error "No processes found"))) + (collection (delq nil (mapcar #'procitem proclist))) + (selection (completing-read + (format-prompt prompt + (and currproc + (eq (process-type currproc) 'real) + (procitem currproc))) + collection nil :require-match nil nil + (car (seq-find (lambda (proc) + (eq currproc (cdr proc))) + collection)))) + (process (and selection + (cdr (assoc selection collection))))) + (unless process + (error "No process selected")) + process))) + (provide 'subr-x) ;;; subr-x.el ends here commit 80b66d80ef1850aadccde1b6fe48d3210362aaa2 Author: Po Lu Date: Sun Jan 23 13:34:03 2022 +0000 Make sure cursors are drawn correctly after haiku_clear_frame * src/haikuterm.c (haiku_clear_frame): Mark all cursors as off. diff --git a/src/haikuterm.c b/src/haikuterm.c index 93ba088f5b..7ab41805ea 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -238,6 +238,9 @@ static void haiku_clear_frame (struct frame *f) { void *view = FRAME_HAIKU_VIEW (f); + + mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f))); + block_input (); BView_draw_lock (view); BView_StartClip (view); commit 0e833a1d5f93d3028ef1ea133174636b46bc64f1 Author: Alex Kost Date: Sun Jan 23 14:12:34 2022 +0100 Improve scheme-imenu-generic-expression * lisp/progmodes/scheme.el (scheme-imenu-generic-expression): Improve so that we match `define-public' etc (bug#33117). diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 6f47f645e0..592e2d5057 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -115,12 +115,53 @@ (define-abbrev-table 'scheme-mode-abbrev-table ()) (defvar scheme-imenu-generic-expression - '((nil - "^(define\\(?:-\\(?:generic\\(?:-procedure\\)?\\|method\\)\\)?\\s-+(?\\(\\sw+\\)" 1) - ("Types" - "^(define-class\\s-+(?\\(\\sw+\\)" 1) - ("Macros" - "^(\\(defmacro\\|define-macro\\|define-syntax\\)\\s-+(?\\(\\sw+\\)" 2)) + `((nil + ,(rx bol "(define" + (zero-or-one "*") + (zero-or-one "-public") + (one-or-more space) + (zero-or-one "(") + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Methods" + ,(rx bol "(define-" + (or "generic" "method" "accessor") + (one-or-more space) + (zero-or-one "(") + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Classes" + ,(rx bol "(define-class" + (one-or-more space) + (zero-or-one "(") + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Records" + ,(rx bol "(define-record-type" + (zero-or-one "*") + (one-or-more space) + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Conditions" + ,(rx bol "(define-condition-type" + (one-or-more space) + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Modules" + ,(rx bol "(define-module" + (one-or-more space) + (group "(" (one-or-more any) ")")) + 1) + ("Macros" + ,(rx bol "(" + (or (and "defmacro" + (zero-or-one "*") + (zero-or-one "-public")) + "define-macro" "define-syntax" "define-syntax-rule") + (one-or-more space) + (zero-or-one "(") + (group (one-or-more (or word (syntax symbol))))) + 1)) "Imenu generic expression for Scheme mode. See `imenu-generic-expression'.") (defun scheme-mode-variables () commit 1bcbca3750d9e8c47bee7ac893b885ade584d783 Author: Lars Ingebrigtsen Date: Sun Jan 23 13:54:16 2022 +0100 Make occur edit mode more resilient * lisp/replace.el (occur-engine): Make the prefix read-only so that it's preserved in edit mode (bug#53419). diff --git a/lisp/replace.el b/lisp/replace.el index 60e507c642..dd6e5a4225 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2086,6 +2086,7 @@ See also `multi-occur'." ;; (for Occur Edit mode). front-sticky t rear-nonsticky t + read-only t occur-target ,markers follow-link t help-echo "mouse-2: go to this occurrence")))) commit ab73a8785834782ef3a05677dada0c466b926cb0 Author: Lars Ingebrigtsen Date: Sun Jan 23 13:43:53 2022 +0100 Revert the other bits related to `load-read-file' * src/lread.c (syms_of_lread): Revert the other bits related to reverting `byte-compile-from-buffer'/`load-read-file'. diff --git a/etc/NEWS b/etc/NEWS index 5297db3e2d..e641eeaa50 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -878,10 +878,6 @@ Emacs buffers, like indentation and the like. The new ert function * Incompatible Lisp Changes in Emacs 29.1 ---- -** 'byte-compile-from-buffer' now uses 'load-read-function'. -It previously called 'read' directly. - ** User option 'mail-source-ignore-errors' is now obsolete. The whole mechanism for prompting users to continue in case of mail-source errors has been removed, so this option is no longer diff --git a/src/lread.c b/src/lread.c index 77b5b65e10..d868801f42 100644 --- a/src/lread.c +++ b/src/lread.c @@ -5316,7 +5316,7 @@ of the file, regardless of whether or not it has the `.elc' extension. */); DEFVAR_LISP ("load-read-function", Vload_read_function, doc: /* Function used for reading expressions. -It is used by `load', `eval-region' and `byte-compile-from-buffer'. +It is used by `load' and `eval-region'. Called with a single argument (the stream from which to read). The default is to use the function `read'. */); commit 32e1894943ee9bf9e17afa92b1520d3c4765e37a Author: Po Lu Date: Sun Jan 23 19:34:39 2022 +0800 Fix menus on the no-toolkit build when using XI2 * src/xmenu.c (x_activate_menubar): (create_and_show_popup_menu): Only ungrab the device if it is actually grabbed. (x_menu_show): Release XI2 passive grab. diff --git a/src/xmenu.c b/src/xmenu.c index b755f75da0..9e4e6b62fc 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -457,8 +457,11 @@ x_activate_menubar (struct frame *f) if (dpyinfo->num_devices) { for (int i = 0; i < dpyinfo->num_devices; ++i) - XIUngrabDevice (dpyinfo->display, dpyinfo->devices[i].device_id, - CurrentTime); + { + if (dpyinfo->devices[i].grab) + XIUngrabDevice (dpyinfo->display, dpyinfo->devices[i].device_id, + CurrentTime); + } } #endif XtDispatchEvent (f->output_data.x->saved_menu_event); @@ -1469,8 +1472,11 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv, if (dpyinfo->num_devices) { for (int i = 0; i < dpyinfo->num_devices; ++i) - XIUngrabDevice (dpyinfo->display, dpyinfo->devices[i].device_id, - CurrentTime); + { + if (dpyinfo->devices[i].grab) + XIUngrabDevice (dpyinfo->display, dpyinfo->devices[i].device_id, + CurrentTime); + } } #endif /* Display the menu. */ @@ -2367,6 +2373,22 @@ x_menu_show (struct frame *f, int x, int y, int menuflags, /* Help display under X won't work because XMenuActivate contains a loop that doesn't give Emacs a chance to process it. */ menu_help_frame = f; + +#ifdef HAVE_XINPUT2 + struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); + /* Clear the XI2 grab so a core grab can be set. */ + + if (dpyinfo->num_devices) + { + for (int i = 0; i < dpyinfo->num_devices; ++i) + { + if (dpyinfo->devices[i].grab) + XIUngrabDevice (dpyinfo->display, dpyinfo->devices[i].device_id, + CurrentTime); + } + } +#endif + status = XMenuActivate (FRAME_X_DISPLAY (f), menu, &pane, &selidx, x, y, ButtonReleaseMask, &datap, menu_help_callback);