commit a39e03d7cdf7c52ecd74fde9adb408108ff7d044 (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Mon Sep 19 09:06:31 2022 +0200 make gen-clean remove some newly-added generated files * admin/unidata/Makefile.in (gen-clean): Remove some newly-added generated files. diff --git a/admin/unidata/Makefile.in b/admin/unidata/Makefile.in index 4b3e72f013..f3e653879c 100644 --- a/admin/unidata/Makefile.in +++ b/admin/unidata/Makefile.in @@ -138,7 +138,8 @@ gen-clean: rm -f ${unidir}/charscript.el* rm -f ${unidir}/emoji-zwj.el* rm -f ${unifiles} ${unidir}/charprop.el - rm -f ${unidir}/emoji-labels.el* + rm -f ${unidir}/emoji-labels.el ${unidir}/idna-mapping.el \ + ${unidir}/uni-confusable.el ${unidir}/uni-scripts.el ## ref: https://lists.gnu.org/r/emacs-devel/2013-11/msg01029.html maintainer-clean: gen-clean distclean commit e54da280ff4bf458c437f87dd64e848cdc75479c Author: Gregory Heytings Date: Mon Sep 19 06:39:08 2022 +0000 ; * Makefile.in: Partly revert 5b3c4004a9. diff --git a/Makefile.in b/Makefile.in index 9c9923a1f6..de263c6858 100644 --- a/Makefile.in +++ b/Makefile.in @@ -380,26 +380,26 @@ bootstrap-all: actual-all: ${SUBDIR} info $(gsettings_SCHEMAS:.xml=.valid) src-depending-on-lisp # ADVICE-ON-FAILURE-BEGIN:all -# It can help to run "make bootstrap", which can resolve many build -# failures caused by incrementally building from a previously built -# checkout. - -# Failing that, running "make V=1" will cause Make to display the full -# commands it invokes to build Emacs, which helps to investigate the -# problem. +# You might try to: +# - run "make bootstrap", which might fix the problem +# - run "make V=1", which displays the full commands invoked by make, +#   to further investigate the problem # ADVICE-ON-FAILURE-END:all # ADVICE-ON-FAILURE-BEGIN:bootstrap -# If "make bootstrap" failed, try running "make extraclean" and then -# "make bootstrap" again. If that still fails and you are building -# Emacs from a repository checkout, run "git clean -fdx" and retry -# "make bootstrap". Otherwise, please report a bug by sending email -# to bug-gnu-emacs@gnu.org. +# You might try to: +# - run "git clean -fdx" and run "make bootstrap" again, which might +#   fix the problem +#   !BEWARE! "git clean -fdx" deletes all files that are not under +#   !BEWARE! version control, which means that all changes to such +#   !BEWARE! files will be lost and cannot be restored later +# - run "make V=1", which displays the full commands invoked by make, +#   to further investigate the problem # ADVICE-ON-FAILURE-END:bootstrap advice-on-failure: @echo - @echo "make ${make-target}\" failed with exit status ${exit-status}." + @echo " \"make ${make-target}\" failed with exit status ${exit-status}." @cat Makefile | \ sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,$${p;/^# ADVICE-ON-FAILURE-END:${make-target}/q};' | \ sed 's/^# //' | grep -v '^ADVICE-ON-FAILURE-' commit 731c453b035c1c61af9a76d44680a7e4c660eaaf Merge: 5b3c4004a9 a2f9788cbc Author: Stefan Kangas Date: Mon Sep 19 06:31:49 2022 +0200 Merge from origin/emacs-28 a2f9788cbc ; Minor copyedits of *-frame-alist doc strings c200098dde ; * src/intervals.c (get_local_map): Fix commentary. 69cc3d38bc Fix Tramp error with eshell integration commit 5b3c4004a9647aa2068e54c358e202f57d0ece3c Author: Po Lu Date: Mon Sep 19 10:01:52 2022 +0800 Remove calls to intern with a static string from code that runs on X * Makefile.in (actual-all): Reword build failure advice. * src/bytecode.c (exec_byte_code, syms_of_bytecode): * src/font.c (syms_of_font): * src/hbfont.c (uni_combining): * src/xfns.c (Fx_display_backing_store, Fx_display_visual_class) (x_create_tip_frame, Fx_show_tip, syms_of_xfns): * src/xfont.c (xfont_supported_scripts, xfont_driver) (syms_of_xfont): * src/xsmfns.c (Fhandle_save_session, syms_of_xsmfns): Remove calls to intern with a static string. diff --git a/Makefile.in b/Makefile.in index de263c6858..9c9923a1f6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -380,26 +380,26 @@ bootstrap-all: actual-all: ${SUBDIR} info $(gsettings_SCHEMAS:.xml=.valid) src-depending-on-lisp # ADVICE-ON-FAILURE-BEGIN:all -# You might try to: -# - run "make bootstrap", which might fix the problem -# - run "make V=1", which displays the full commands invoked by make, -#   to further investigate the problem +# It can help to run "make bootstrap", which can resolve many build +# failures caused by incrementally building from a previously built +# checkout. + +# Failing that, running "make V=1" will cause Make to display the full +# commands it invokes to build Emacs, which helps to investigate the +# problem. # ADVICE-ON-FAILURE-END:all # ADVICE-ON-FAILURE-BEGIN:bootstrap -# You might try to: -# - run "git clean -fdx" and run "make bootstrap" again, which might -#   fix the problem -#   !BEWARE! "git clean -fdx" deletes all files that are not under -#   !BEWARE! version control, which means that all changes to such -#   !BEWARE! files will be lost and cannot be restored later -# - run "make V=1", which displays the full commands invoked by make, -#   to further investigate the problem +# If "make bootstrap" failed, try running "make extraclean" and then +# "make bootstrap" again. If that still fails and you are building +# Emacs from a repository checkout, run "git clean -fdx" and retry +# "make bootstrap". Otherwise, please report a bug by sending email +# to bug-gnu-emacs@gnu.org. # ADVICE-ON-FAILURE-END:bootstrap advice-on-failure: @echo - @echo " \"make ${make-target}\" failed with exit status ${exit-status}." + @echo "make ${make-target}\" failed with exit status ${exit-status}." @cat Makefile | \ sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,$${p;/^# ADVICE-ON-FAILURE-END:${make-target}/q};' | \ sed 's/^# //' | grep -v '^ADVICE-ON-FAILURE-' diff --git a/src/bytecode.c b/src/bytecode.c index d75767bb0c..c765e1be2b 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1431,7 +1431,7 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, NEXT; CASE (Binteractive_p): /* Obsolete since 24.1. */ - PUSH (call0 (intern ("interactive-p"))); + PUSH (call0 (Qinteractive_p)); NEXT; CASE (Bforward_char): @@ -1749,6 +1749,8 @@ get_byte_code_arity (Lisp_Object args_template) void syms_of_bytecode (void) { + DEFSYM (Qinteractive_p, "interactive-p"); + defsubr (&Sbyte_code); defsubr (&Sinternal_stack_stats); diff --git a/src/font.c b/src/font.c index 2a8f00630c..413cb381ee 100644 --- a/src/font.c +++ b/src/font.c @@ -5555,6 +5555,10 @@ syms_of_font (void) DEFSYM (Qopentype, "opentype"); + /* Currently used by hbfont.c, which has no syms_of_hbfont function + of its own. */ + DEFSYM (Qcanonical_combining_class, "canonical-combining-class"); + /* Important character set symbols. */ DEFSYM (Qascii_0, "ascii-0"); DEFSYM (Qiso8859_1, "iso8859-1"); diff --git a/src/hbfont.c b/src/hbfont.c index 2721a66120..476e08020e 100644 --- a/src/hbfont.c +++ b/src/hbfont.c @@ -249,7 +249,7 @@ uni_combining (hb_unicode_funcs_t *funcs, hb_codepoint_t ch, void *user_data) if (!combining_class_loaded) { canonical_combining_class_table = - uniprop_table (intern ("canonical-combining-class")); + uniprop_table (Qcanonical_combining_class); if (NILP (canonical_combining_class_table)) emacs_abort (); staticpro (&canonical_combining_class_table); diff --git a/src/xfns.c b/src/xfns.c index ecb869bf36..4df5ad890e 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5540,15 +5540,15 @@ On MS Windows, this returns nothing useful. */) switch (DoesBackingStore (dpyinfo->screen)) { case Always: - result = intern ("always"); + result = Qalways; break; case WhenMapped: - result = intern ("when-mapped"); + result = Qwhen_mapped; break; case NotUseful: - result = intern ("not-useful"); + result = Qnot_useful; break; default: @@ -5577,22 +5577,22 @@ If omitted or nil, that stands for the selected frame's display. switch (dpyinfo->visual_info.class) { case StaticGray: - result = intern ("static-gray"); + result = Qstatic_gray; break; case GrayScale: - result = intern ("gray-scale"); + result = Qgray_scale; break; case StaticColor: - result = intern ("static-color"); + result = Qstatic_color; break; case PseudoColor: - result = intern ("pseudo-color"); + result = Qpseudo_color; break; case TrueColor: - result = intern ("true-color"); + result = Qtrue_color; break; case DirectColor: - result = intern ("direct-color"); + result = Qdirect_color; break; default: error ("Display has an unknown visual class"); @@ -8309,9 +8309,9 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms) disptype = Qmono; else if (FRAME_X_VISUAL_INFO (f)->class == GrayScale || FRAME_X_VISUAL_INFO (f)->class == StaticGray) - disptype = intern ("grayscale"); + disptype = Qgrayscale; else - disptype = intern ("color"); + disptype = Qcolor; if (NILP (Fframe_parameter (frame, Qdisplay_type))) { @@ -8973,8 +8973,8 @@ Text larger than the specified size is clipped. */) start_timer: /* Let the tip disappear after timeout seconds. */ - tip_timer = call3 (intern ("run-at-time"), timeout, Qnil, - intern ("x-hide-tip")); + tip_timer = call3 (Qrun_at_time, timeout, Qnil, + Qx_hide_tip); return unbind_to (count, Qnil); } @@ -10072,6 +10072,23 @@ eliminated in future versions of Emacs. */); /* Tell Emacs about this window system. */ Fprovide (Qx, Qnil); + /* Used by Fx_show_tip. */ + DEFSYM (Qrun_at_time, "run-at-time"); + DEFSYM (Qx_hide_tip, "x-hide-tip"); + + /* Used by display class and backing store reporting functions. */ + DEFSYM (Qalways, "always"); + DEFSYM (Qwhen_mapped, "when-mapped"); + DEFSYM (Qnot_useful, "not-useful"); + DEFSYM (Qstatic_gray, "static-gray"); + DEFSYM (Qgray_scale, "gray-scale"); + DEFSYM (Qstatic_color, "static-color"); + DEFSYM (Qpseudo_color, "pseudo-color"); + DEFSYM (Qtrue_color, "true-color"); + DEFSYM (Qdirect_color, "direct-color"); + DEFSYM (Qgrayscale, "grayscale"); + DEFSYM (Qcolor, "color"); + #ifdef HAVE_XINPUT2 DEFSYM (Qxinput2, "xinput2"); diff --git a/src/xfont.c b/src/xfont.c index 74237e8aa8..951446b44d 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -253,9 +253,9 @@ xfont_supported_scripts (Display *display, char *fontname, Lisp_Object props, /* Two special cases to avoid opening rather big fonts. */ if (EQ (AREF (props, 2), Qja)) - return list2 (intern ("kana"), intern ("han")); + return list2 (Qkana, Qhan); if (EQ (AREF (props, 2), Qko)) - return list1 (intern ("hangul")); + return list1 (Qhangul); scripts = Fgethash (props, xfont_scripts_cache, Qt); if (EQ (scripts, Qt)) { @@ -1130,19 +1130,19 @@ static void syms_of_xfont_for_pdumper (void); struct font_driver const xfont_driver = { - .type = LISPSYM_INITIALLY (Qx), - .get_cache = xfont_get_cache, - .list = xfont_list, - .match = xfont_match, - .list_family = xfont_list_family, - .open_font = xfont_open, - .close_font = xfont_close, - .prepare_face = xfont_prepare_face, - .has_char = xfont_has_char, - .encode_char = xfont_encode_char, - .text_extents = xfont_text_extents, - .draw = xfont_draw, - .check = xfont_check, + .type = LISPSYM_INITIALLY (Qx), + .get_cache = xfont_get_cache, + .list = xfont_list, + .match = xfont_match, + .list_family = xfont_list_family, + .open_font = xfont_open, + .close_font = xfont_close, + .prepare_face = xfont_prepare_face, + .has_char = xfont_has_char, + .encode_char = xfont_encode_char, + .text_extents = xfont_text_extents, + .draw = xfont_draw, + .check = xfont_check, }; void @@ -1153,6 +1153,10 @@ syms_of_xfont (void) staticpro (&xfont_scratch_props); xfont_scratch_props = make_nil_vector (8); pdumper_do_now_and_after_load (syms_of_xfont_for_pdumper); + + DEFSYM (Qkana, "kana"); + DEFSYM (Qhan, "han"); + DEFSYM (Qhangul, "hangul"); } static void diff --git a/src/xsmfns.c b/src/xsmfns.c index 7015a8eb63..7a17e6dbd8 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -511,7 +511,7 @@ Do not call this function yourself. */) this at the wrong time. */ if (doing_interact && ! kill_emacs) { - bool cancel_shutdown = ! NILP (call0 (intern ("emacs-session-save"))); + bool cancel_shutdown = ! NILP (call0 (Qemacs_session_save)); SmcInteractDone (smc_conn, cancel_shutdown); SmcSaveYourselfDone (smc_conn, True); @@ -542,6 +542,8 @@ Do not call this function yourself. */) void syms_of_xsmfns (void) { + DEFSYM (Qemacs_session_save, "emacs-session-save"); + DEFVAR_LISP ("x-session-id", Vx_session_id, doc: /* The session id Emacs got from the session manager for this session. Changing the value does not change the session id used by Emacs. commit 202c416e2e829cfdfde83bc82705be4b7ad6799e Author: Po Lu Date: Mon Sep 19 09:39:21 2022 +0800 Get rid of intern calls to static strings in xterm.c * src/xterm.c (x_cr_export_frames): Use Qconcat instead of interning concat. (syms_of_xterm): New defsym Qconcat. diff --git a/src/xterm.c b/src/xterm.c index 245306c67c..59cde718d0 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6131,7 +6131,7 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type) unbind_to (count, Qnil); - return CALLN (Fapply, intern ("concat"), Fnreverse (acc)); + return CALLN (Fapply, Qconcat, Fnreverse (acc)); } #endif /* USE_CAIRO */ @@ -29834,6 +29834,9 @@ syms_of_xterm (void) x_dnd_unsupported_drop_data = Qnil; staticpro (&x_dnd_unsupported_drop_data); + /* Used by x_cr_export_frames. */ + DEFSYM (Qconcat, "concat"); + DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms"); DEFSYM (Qlatin_1, "latin-1"); DEFSYM (Qnow, "now"); commit a5405e56449e90203db909ea4ed1b19500e5044b Author: Po Lu Date: Mon Sep 19 09:35:58 2022 +0800 Fix GC protection of scroll bar windows * src/xterm.c (x_atom_refs): Add _EMACS prefix to vendor-specific scroll-bar atoms. (handle_one_xevent): Unprotect windows immediately upon receiving an _EMACS_SCROLLBAR event, instead of waiting for the event to be put on the keyboard buffer. Reported by martin rudalics . diff --git a/src/xterm.c b/src/xterm.c index cb6581b78c..245306c67c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -970,8 +970,8 @@ static const struct x_atom_ref x_atom_refs[] = /* Ghostscript support. */ ATOM_REFS_INIT ("DONE", Xatom_DONE) ATOM_REFS_INIT ("PAGE", Xatom_PAGE) - ATOM_REFS_INIT ("SCROLLBAR", Xatom_Scrollbar) - ATOM_REFS_INIT ("HORIZONTAL_SCROLLBAR", Xatom_Horizontal_Scrollbar) + ATOM_REFS_INIT ("_EMACS_SCROLLBAR", Xatom_Scrollbar) + ATOM_REFS_INIT ("_EMACS_HORIZONTAL_SCROLLBAR", Xatom_Horizontal_Scrollbar) ATOM_REFS_INIT ("_XEMBED", Xatom_XEMBED) /* EWMH */ ATOM_REFS_INIT ("_NET_WM_STATE", Xatom_net_wm_state) @@ -18103,12 +18103,24 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (event->xclient.message_type == dpyinfo->Xatom_Scrollbar) { x_scroll_bar_to_input_event (event, &inev.ie); + + /* Unprotect the first window to be sent in a + ClientMessage event, since it is now on the stack and + thereby subject to garbage collection. */ + x_unprotect_window_for_callback (dpyinfo); + *finish = X_EVENT_GOTO_OUT; goto done; } else if (event->xclient.message_type == dpyinfo->Xatom_Horizontal_Scrollbar) { x_horizontal_scroll_bar_to_input_event (event, &inev.ie); + + /* Unprotect the first window to be sent in a + ClientMessage event, since it is now on the stack and + thereby subject to garbage collection. */ + x_unprotect_window_for_callback (dpyinfo); + *finish = X_EVENT_GOTO_OUT; goto done; } @@ -23709,12 +23721,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, count++; } -#ifdef USE_TOOLKIT_SCROLL_BARS - if (event->xany.type == ClientMessage - && inev.ie.kind == SCROLL_BAR_CLICK_EVENT) - x_unprotect_window_for_callback (dpyinfo); -#endif - if (do_help && !(hold_quit && hold_quit->kind != NO_EVENT)) { commit 7c8a131984ab47349381975dead1712ae25ae2c6 Author: Gregory Heytings Date: Sun Sep 18 21:22:13 2022 +0000 Display a help message when building Emacs failed. * Makefile.in (actual-all): New target, replacing the former 'all' target. (advice-on-failure, sanity-check): New targets. (all): Use the new targets. (bootstrap-all): New target, identical to 'all' but meant for the 'bootstrap' target in GNUmakefile. (actual-bootstrap): New target, replacing the former 'bootstrap' target. Use the 'actual-all' target instead of the 'all' target. (bootstrap): Use the new targets. * GNUmakefile (bootstrap): Use the new 'bootstrap-all' target. diff --git a/GNUmakefile b/GNUmakefile index 8eb61dc0ad..05edbe099b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -115,7 +115,7 @@ endif # 'make bootstrap' in a fresh checkout needn't run 'configure' twice. bootstrap: Makefile - $(MAKE) -f Makefile all + $(MAKE) -f Makefile bootstrap-all .PHONY: bootstrap default $(ORDINARY_GOALS) diff --git a/Makefile.in b/Makefile.in index 3f811ea60f..de263c6858 100644 --- a/Makefile.in +++ b/Makefile.in @@ -366,7 +366,58 @@ endif gsettings_SCHEMAS = etc/org.gnu.emacs.defaults.gschema.xml -all: ${SUBDIR} info $(gsettings_SCHEMAS:.xml=.valid) src-depending-on-lisp +all: + $(MAKE) actual-all || $(MAKE) advice-on-failure make-target=all exit-status=$$? + $(MAKE) sanity-check make-target=all + +# This target is used by the 'bootstrap' target in GNUmakefile, instead of 'all'. +bootstrap-all: + $(MAKE) actual-all || $(MAKE) advice-on-failure make-target=bootstrap exit-status=$$? + $(MAKE) sanity-check make-target=bootstrap + +.PHONY: bootstrap-all actual-all advice-on-failure sanity-check + +actual-all: ${SUBDIR} info $(gsettings_SCHEMAS:.xml=.valid) src-depending-on-lisp + +# ADVICE-ON-FAILURE-BEGIN:all +# You might try to: +# - run "make bootstrap", which might fix the problem +# - run "make V=1", which displays the full commands invoked by make, +#   to further investigate the problem +# ADVICE-ON-FAILURE-END:all + +# ADVICE-ON-FAILURE-BEGIN:bootstrap +# You might try to: +# - run "git clean -fdx" and run "make bootstrap" again, which might +#   fix the problem +#   !BEWARE! "git clean -fdx" deletes all files that are not under +#   !BEWARE! version control, which means that all changes to such +#   !BEWARE! files will be lost and cannot be restored later +# - run "make V=1", which displays the full commands invoked by make, +#   to further investigate the problem +# ADVICE-ON-FAILURE-END:bootstrap + +advice-on-failure: + @echo + @echo " \"make ${make-target}\" failed with exit status ${exit-status}." + @cat Makefile | \ + sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,$${p;/^# ADVICE-ON-FAILURE-END:${make-target}/q};' | \ + sed 's/^# //' | grep -v '^ADVICE-ON-FAILURE-' + @echo + @exit ${exit-status} + +sanity-check: + @v=$$(src/emacs${EXEEXT} --batch --eval \ + '(progn (defun f (n) (if (= 0 n) 1 (* n (f (- n 1))))) (princ (f 10)))' \ + 2> /dev/null); \ + [ "X$$v" == "X3628800" ] && exit 0; \ + echo; \ + echo " \"make ${make-target}\" succeeded, but Emacs is not functional."; \ + cat Makefile | \ + sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,$${p;/^# ADVICE-ON-FAILURE-END:${make-target}/q};' | \ + sed 's/^# //' | grep -v '^ADVICE-ON-FAILURE-'; \ + echo; \ + exit 1 .PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 epaths-force-ns-self-contained etc-emacsver @@ -1170,7 +1221,11 @@ check-info: info ### This first cleans the lisp subdirectory, removing all compiled ### Lisp files. Then re-run make to build all the files anew. -.PHONY: bootstrap +.PHONY: bootstrap actual-bootstrap + +bootstrap: + $(MAKE) actual-bootstrap || $(MAKE) advice-on-failure make-target=bootstrap exit-status=$$? + $(MAKE) sanity-check make-target=bootstrap # Without a 'configure' variable, bootstrapping does the following: # * Remove files to start from a bootstrap-clean slate. @@ -1181,7 +1236,7 @@ check-info: info # * Remove files to start from an extraclean slate. # * Do the actual build, during which the 'configure' variable is # used (see the Makefile goal in GNUmakefile). -bootstrap: +actual-bootstrap: ifndef configure $(MAKE) bootstrap-clean cd $(srcdir) && ./autogen.sh autoconf @@ -1189,7 +1244,7 @@ ifndef configure else $(MAKE) extraclean endif - $(MAKE) all + $(MAKE) actual-all .PHONY: ChangeLog change-history change-history-commit change-history-nocommit .PHONY: preferred-branch-is-current unchanged-history-files commit a2f9788cbc5f514da5f11d9f875fd7482bb00732 Author: Eli Zaretskii Date: Sun Sep 18 20:21:58 2022 +0300 ; Minor copyedits of *-frame-alist doc strings * src/frame.c (syms_of_frame) : * lisp/frame.el (initial-frame-alist): Minor doc fixes. diff --git a/lisp/frame.el b/lisp/frame.el index 69119b4c24..a6b0f17189 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -64,7 +64,7 @@ handles the corresponding kind of display.") ;; But that's not necessary, because the default is to have one. ;; By not specifying it here, we let an X resource specify it. (defcustom initial-frame-alist nil - "Alist of parameters for the initial X window frame. + "Alist of parameters for the initial window-system (a.k.a. \"GUI\") frame. You can set this in your init file; for example, (setq initial-frame-alist diff --git a/src/frame.c b/src/frame.c index 0c278259a7..506780ae36 100644 --- a/src/frame.c +++ b/src/frame.c @@ -6192,7 +6192,7 @@ You can also use a floating number between 0.0 and 1.0. */); #endif DEFVAR_LISP ("default-frame-alist", Vdefault_frame_alist, - doc: /* Alist of default values for frame creation. + doc: /* Alist of default values of frame parameters for frame creation. These may be set in your init file, like this: (setq default-frame-alist \\='((width . 80) (height . 55) (menu-bar-lines . 1))) These override values given in window system configuration data, commit c200098ddeb090b7b95f482a269bbe2a7a40d09d Author: Eli Zaretskii Date: Sun Sep 18 19:59:58 2022 +0300 ; * src/intervals.c (get_local_map): Fix commentary. diff --git a/src/intervals.c b/src/intervals.c index 189308e8e3..c5b720470b 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -2162,8 +2162,8 @@ get_property_and_range (ptrdiff_t pos, Lisp_Object prop, Lisp_Object *val, /* Return the proper local keymap TYPE for position POSITION in BUFFER; TYPE should be one of `keymap' or `local-map'. Use the map - specified by the PROP property, if any. Otherwise, if TYPE is - `local-map' use BUFFER's local map. */ + specified by the TYPE property, if any. Otherwise, if TYPE is + `local-map', use BUFFER's local map. */ Lisp_Object get_local_map (ptrdiff_t position, struct buffer *buffer, Lisp_Object type) commit 1bdac41e4d9bbc23b654b90d593a8a3588052868 Author: Stefan Kangas Date: Sun Sep 18 18:55:19 2022 +0200 Prefer using DEFSYMs to intern with wrong_type_argument * src/data.c (syms_of_data) : * src/fileio.c (syms_of_fileio) : * src/font.c (syms_of_font) : New DEFSYMs. * src/dbusbind.c (xd_signature, xd_append_arg): * src/fileio.c (file_offset, Finsert_file_contents): * src/font.c (Ffontp): Prefer using above new DEFSYMs to using intern directly. diff --git a/src/data.c b/src/data.c index b19e10582e..221a6f5883 100644 --- a/src/data.c +++ b/src/data.c @@ -4124,6 +4124,7 @@ syms_of_data (void) DEFSYM (Qsymbolp, "symbolp"); DEFSYM (Qfixnump, "fixnump"); DEFSYM (Qintegerp, "integerp"); + DEFSYM (Qbooleanp, "booleanp"); DEFSYM (Qnatnump, "natnump"); DEFSYM (Qwholenump, "wholenump"); DEFSYM (Qstringp, "stringp"); diff --git a/src/dbusbind.c b/src/dbusbind.c index 943a4aff8e..1c74180f15 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -398,7 +398,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) case DBUS_TYPE_BOOLEAN: /* There must be an argument. */ if (EQ (QCboolean, object)) - wrong_type_argument (intern ("booleanp"), object); + wrong_type_argument (Qbooleanp, object); sprintf (signature, "%c", dtype); break; @@ -649,7 +649,7 @@ xd_append_arg (int dtype, Lisp_Object object, DBusMessageIter *iter) case DBUS_TYPE_BOOLEAN: /* There must be an argument. */ if (EQ (QCboolean, object)) - wrong_type_argument (intern ("booleanp"), object); + wrong_type_argument (Qbooleanp, object); { dbus_bool_t val = (NILP (object)) ? FALSE : TRUE; XD_DEBUG_MESSAGE ("%c %s", dtype, (val == FALSE) ? "false" : "true"); diff --git a/src/fileio.c b/src/fileio.c index 9697f6c8cf..6efea8ac36 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3808,7 +3808,7 @@ file_offset (Lisp_Object val) } } - wrong_type_argument (intern ("file-offset"), val); + wrong_type_argument (Qfile_offset, val); } /* Return a special time value indicating the error number ERRNUM. */ @@ -4875,7 +4875,7 @@ by calling `format-decode', which see. */) if (! NILP (insval)) { if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); inserted = XFIXNAT (insval); } } @@ -4898,7 +4898,7 @@ by calling `format-decode', which see. */) insval = call3 (Qformat_decode, Qnil, make_fixnum (inserted), visit); if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); inserted = XFIXNAT (insval); } else @@ -4921,7 +4921,7 @@ by calling `format-decode', which see. */) insval = call3 (Qformat_decode, Qnil, make_fixnum (oinserted), visit); if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); if (ochars_modiff == CHARS_MODIFF) /* format_decode didn't modify buffer's characters => move point back to position before inserted text and leave @@ -4944,7 +4944,7 @@ by calling `format-decode', which see. */) if (!NILP (insval)) { if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); inserted = XFIXNAT (insval); } } @@ -4962,7 +4962,7 @@ by calling `format-decode', which see. */) if (!NILP (insval)) { if (! RANGED_FIXNUMP (0, insval, ZV - PT)) - wrong_type_argument (intern ("inserted-chars"), insval); + wrong_type_argument (Qinserted_chars, insval); if (ochars_modiff == CHARS_MODIFF) /* after_insert_file_functions didn't modify buffer's characters => move point back to @@ -6431,9 +6431,11 @@ syms_of_fileio (void) DEFSYM (Qfile_date_error, "file-date-error"); DEFSYM (Qfile_missing, "file-missing"); DEFSYM (Qpermission_denied, "permission-denied"); + DEFSYM (Qfile_offset, "file-offset"); DEFSYM (Qfile_notify_error, "file-notify-error"); DEFSYM (Qremote_file_error, "remote-file-error"); DEFSYM (Qexcl, "excl"); + DEFSYM (Qinserted_chars, "inserted-chars"); DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system, doc: /* Coding system for encoding file names. diff --git a/src/font.c b/src/font.c index 8acedb9bf8..2a8f00630c 100644 --- a/src/font.c +++ b/src/font.c @@ -4041,7 +4041,7 @@ which kind of font it is. It must be one of `font-spec', `font-entity', return (FONT_ENTITY_P (object) ? Qt : Qnil); if (EQ (extra_type, Qfont_object)) return (FONT_OBJECT_P (object) ? Qt : Qnil); - wrong_type_argument (intern ("font-extra-type"), extra_type); + wrong_type_argument (Qfont_extra_type, extra_type); ; } DEFUN ("font-spec", Ffont_spec, Sfont_spec, 0, MANY, 0, @@ -5594,6 +5594,7 @@ syms_of_font (void) DEFSYM (QL2R, "L2R"); DEFSYM (QR2L, "R2L"); + DEFSYM (Qfont_extra_type, "font-extra-type"); DEFSYM (Qfont_driver_superseded_by, "font-driver-superseded-by"); scratch_font_spec = Ffont_spec (0, NULL); commit e27d9a46dc585051d938a6506dc1c7d1e055f3c5 Author: Eli Zaretskii Date: Sun Sep 18 19:09:54 2022 +0300 ; Fix doc strings in osc.el * lisp/osc.el (osc-filter-region, osc-apply-on-region) (osc-window-title-handler, osc-directory-tracker) (osc-hyperlink-handler, osc-for-compilation-buffer) (osc-compilation-filter): Fix doc strings. ` diff --git a/lisp/osc.el b/lisp/osc.el index ea6abaebd3..8f4cd630ba 100644 --- a/lisp/osc.el +++ b/lisp/osc.el @@ -39,7 +39,7 @@ "Regexp matching an OSC control sequence.") (defun osc-filter-region (begin end) - "Filter out all OSC control sequences from region BEGIN to END." + "Filter out all OSC control sequences from region between BEGIN and END." (save-excursion (goto-char begin) ;; Delete escape sequences. @@ -57,16 +57,16 @@ See `osc-apply-on-region' for details.") ;; position of an escape sequence without termination. (defun osc-apply-on-region (begin end) - "Interpret OSC escape sequences in region. -This function search for escape sequences of the forms + "Interpret OSC escape sequences in region between BEGIN and END. +This function searches for escape sequences of the forms ESC ] command ; text BEL ESC ] command ; text ESC \\ Every occurrence of such escape sequences is removed from the -buffer. Then, if `command' is a key of the local variable -`osc-handlers' alist, the corresponding value, which should be a -function, is called with `command' and `text' as arguments, with +buffer. Then, if `command' is a key in the alist that is the value +of the local variable `osc-handlers', that key's value, which should +be a function, is called with `command' and `text' as arguments, with point where the escape sequence was located." (save-excursion (goto-char (or osc--marker begin)) @@ -91,11 +91,11 @@ point where the escape sequence was located." (defvar-local osc-window-title nil) (defun osc-window-title-handler (_ text) "Set value of `osc-window-title' from an OSC 2 escape sequence. -The variable `osc-window-title' can be referred to in +The variable `osc-window-title' can then be referenced in `frame-title-format' to dynamically set the frame title. -This function is intended to be included as an entry of -`osc-handlers'." +This function is intended to be included as an element of the +list that is the value of `osc-handlers'." (setq osc-window-title text)) ;; Current directory tracking (OSC 7) @@ -106,10 +106,10 @@ This function is intended to be included as an entry of (defun osc-directory-tracker (_ text) "Update `default-directory' from OSC 7 escape sequences. -This function is intended to be included as an entry of -`osc-handlers'. You should moreover arrange for your shell to -print the appropriate escape sequence at each prompt, say with -the following command: +This function is intended to be included as an element of the +the list that is the value of `osc-handlers'. You should arrange +for your shell to print the appropriate escape sequence at each prompt, +such as with the following command: printf \"\\e]7;file://%s%s\\e\\\\\" \"$HOSTNAME\" \"$PWD\" @@ -142,8 +142,8 @@ and `shell-dirtrack-mode'." (defun osc-hyperlink-handler (_ text) "Create a hyperlink from an OSC 8 escape sequence. -This function is intended to be included as an entry of -`osc-handlers'." +This function is intended to be included as an elemnt of the list +that is the value of `osc-handlers'." (when osc-hyperlink--state (let ((start (car osc-hyperlink--state)) (url (cdr osc-hyperlink--state))) @@ -155,29 +155,30 @@ This function is intended to be included as an entry of (cons (point-marker) (match-string-no-properties 1 text))))) (defcustom osc-for-compilation-buffer 'filter - "Determines what to do of OSC escape sequences in compilation output. + "What to do with OSC escape sequences in compilation output. + If nil, do nothing. If the symbol `filter', then filter out all OSC control sequences. -If anything else (such as t), then collect OSC control sequences -and call appropriate handler as described in `osc-handlers'. +If any other non-nil value, then collect OSC control sequences +and call the appropriate handlers as described in `osc-handlers'. In order for this to have any effect, `osc-compilation-filter' must be in `compilation-filter-hook'." :type '(choice (const :tag "Do nothing" nil) - (const :tag "Filter" filter) - (other :tag "Translate" t)) + (const :tag "Filter out OSC" filter) + (other :tag "Translate OSC" t)) :group 'osc - :version "29.0") + :version "29.1") (defvar compilation-filter-start) ;;;###autoload (defun osc-compilation-filter () "Maybe collect OSC control sequences. -This function depends on the `osc-for-compilation-buffer' -variable, and is meant to be used in `compilation-filter-hook'." +This function depends on the variable `osc-for-compilation-buffer', +and is meant to be used in `compilation-filter-hook'." (let ((inhibit-read-only t)) (pcase osc-for-compilation-buffer ('nil nil) commit 242fca62c21910c55b5ad96e04f4bf85e2e67544 Author: Eli Zaretskii Date: Sun Sep 18 18:56:30 2022 +0300 ; * etc/NEWS: Fix typos and punctuation in OSC entry. diff --git a/etc/NEWS b/etc/NEWS index 88d00d9474..e5d9b1ca23 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2436,14 +2436,14 @@ Enabling this minor mode turns on hiding header material, like 'elide-head' and 'elide-head-show' are now obsolete. *** New package 'osc'. -Support for OSC ("Operating System Command") espace sequences has been +Support for OSC ("Operating System Command") escape sequences has been extracted from 'comint.el' in order to provide interpretation of OSC -escape sequences in compilation buffers. +sequences in compilation buffers. Adding the new function 'osc-compilation-filter' to -'compilation-filter-hook' enables interpretation of OSC ("Operating -System Command") escape sequences in compilation buffers. By default, -all sequences are filtered out. +'compilation-filter-hook' enables interpretation of OSC escape +sequences in compilation buffers. By default, all sequences are +filtered out. A handler for OSC 2, the command to set a window title, is provided. commit e5aeb5eaecd5f3a769ac72259ee893353313e610 Author: Michael Albinus Date: Sun Sep 18 16:53:49 2022 +0200 Minor Tramp cleanups * lisp/net/tramp-compat.el (tramp-compat-rx): Declare. * lisp/net/tramp-integration.el (info-lookup-maybe-add-help): Fix `rx' call. diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 58954c238e..d8f31daa1f 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -43,8 +43,7 @@ ;; existence, or "file-attributes" caches the result of the function ;; `file-attributes'. These entries have a timestamp, and they ;; expire after `remote-file-name-inhibit-cache' seconds if this -;; variable is set. These properties are taken into account only if -;; the connection is established, or `non-essential' is nil. +;; variable is set. ;; ;; - The key is a process. These are temporary properties related to ;; an open connection. Examples: "scripts" keeps shell script diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index aae15fafdf..a7dd9c03f3 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -36,6 +36,7 @@ (require 'shell) (require 'subr-x) +(declare-function tramp-compat-rx "tramp") (declare-function tramp-error "tramp") (declare-function tramp-file-name-handler "tramp") (declare-function tramp-tramp-file-p "tramp") diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 61b2c2ecb7..b8364b208c 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -217,12 +217,12 @@ NAME must be equal to `tramp-current-connection'." (info-lookup-maybe-add-help :mode 'tramp-info-lookup-mode :topic 'symbol :regexp (rx (+ (not (any "\t\n \"'(),[]`‘’")))) - :doc-spec '(("(tramp)Function Index" nil - (rx bol blank (+ "-") blank (* nonl) ": ") - (rx (| blank eol))) + :doc-spec `(("(tramp)Function Index" nil + ,(rx bol blank (+ "-") blank (* nonl) ":" blank) + ,(rx (| blank eol))) ("(tramp)Variable Index" nil - (rx bol blank (+ "-") blank (* nonl) ": ") - (rx (| blank eol))))) + ,(rx bol blank (+ "-") blank (* nonl) ":" blank) + ,(rx (| blank eol))))) (add-hook 'tramp-integration-unload-hook commit baf1a7a4a0f21636ea8314a6a927f69a0c66aac5 Author: Michael Heerdegen Date: Wed Aug 31 03:13:09 2022 +0200 Turn gv-synthetic-place into a function This fixes Bug#57397. * lisp/emacs-lisp/gv.el (gv-synthetic-place): Make a function and add trivial compiler macro to avoid decreasing efficiency. diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 1db9d96d99..d4aed3ac39 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -536,13 +536,13 @@ The return value is the last VAL in the list. (funcall do `(error . ,args) (lambda (v) `(progn ,v (error . ,args)))))) -(defmacro gv-synthetic-place (getter setter) +(defun gv-synthetic-place (getter setter) "Special place described by its setter and getter. GETTER and SETTER (typically obtained via `gv-letplace') get and -set that place. I.e. This macro allows you to do the \"reverse\" of what -`gv-letplace' does. -This macro only makes sense when used in a place." - (declare (gv-expander funcall)) +set that place. I.e. this function allows you to do the +\"reverse\" of what `gv-letplace' does. This function only makes +sense when used in a place." + (declare (gv-expander funcall) (compiler-macro (lambda (_) getter))) (ignore setter) getter) commit 57cc85f05865e24c23bf2a05c5873c42961ca20f Author: Matthias Meulien Date: Sun Sep 18 15:46:18 2022 +0200 Add NEWS entry for osc.el (bug#57821) diff --git a/etc/NEWS b/etc/NEWS index effd02fead..88d00d9474 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2435,6 +2435,18 @@ Enabling this minor mode turns on hiding header material, like 'elide-head' does; disabling it shows the header. The commands 'elide-head' and 'elide-head-show' are now obsolete. +*** New package 'osc'. +Support for OSC ("Operating System Command") espace sequences has been +extracted from 'comint.el' in order to provide interpretation of OSC +escape sequences in compilation buffers. + +Adding the new function 'osc-compilation-filter' to +'compilation-filter-hook' enables interpretation of OSC ("Operating +System Command") escape sequences in compilation buffers. By default, +all sequences are filtered out. + +A handler for OSC 2, the command to set a window title, is provided. + +++ *** New user option 'project-vc-include-untracked'. If non-nil, files untracked by a VCS are considered to be part of commit 9afe0de266e889c883984826e1c6a42c278dbd11 Author: Lars Ingebrigtsen Date: Sun Sep 18 14:51:37 2022 +0200 Fix osc.el compilation warning * lisp/osc.el (compilation-filter-start): Avoid compilation warning. diff --git a/lisp/osc.el b/lisp/osc.el index 89467bc4cf..ea6abaebd3 100644 --- a/lisp/osc.el +++ b/lisp/osc.el @@ -171,6 +171,8 @@ must be in `compilation-filter-hook'." :group 'osc :version "29.0") +(defvar compilation-filter-start) + ;;;###autoload (defun osc-compilation-filter () "Maybe collect OSC control sequences. commit c791f3669800188b32b9b5b7feec6ab73adfddd1 Author: Matthias Meulien Date: Sat Sep 17 18:59:31 2022 +0200 OSC escape sequences filter for compilation buffer * lisp/osc.el (osc-control-seq-regexp): Regexp matching OSC control sequence. (osc-filter-region): Filter out OSC control sequences from region. (osc-for-compilation-buffer): Determines what to do with OSC escape sequences in compilation output. (osc-compilation-filter): Implement OSC escape sequence handling for compilation output (bug#57821). diff --git a/lisp/osc.el b/lisp/osc.el index 619972dab1..89467bc4cf 100644 --- a/lisp/osc.el +++ b/lisp/osc.el @@ -26,8 +26,26 @@ ;; sequences. Handlers for OSC 2, 7 and 8 (for window title, current ;; directory and hyperlinks respectively) are provided. +;; The function `osc-compilation-filter' can be added to +;; `compilation-filter-hook' to collect OSC sequences in compilation +;; buffers. The variable `osc-for-compilation-buffer' tells what to do +;; with collected sequences. + ;;; Code: +(defconst osc-control-seq-regexp + ;; See ECMA 48, section 8.3.89 "OSC - OPERATING SYSTEM COMMAND". + "\e\\][\x08-\x0D]*[\x20-\x7E]*\\(\a\\|\e\\\\\\)" + "Regexp matching an OSC control sequence.") + +(defun osc-filter-region (begin end) + "Filter out all OSC control sequences from region BEGIN to END." + (save-excursion + (goto-char begin) + ;; Delete escape sequences. + (while (re-search-forward osc-control-seq-regexp end t) + (delete-region (match-beginning 0) (match-end 0))))) + (defvar-local osc-handlers '(("2" . osc-window-title-handler) ("7" . osc-directory-tracker) ("8" . osc-hyperlink-handler)) @@ -136,5 +154,35 @@ This function is intended to be included as an entry of (and (string-match ";\\(.+\\)" text) (cons (point-marker) (match-string-no-properties 1 text))))) +(defcustom osc-for-compilation-buffer 'filter + "Determines what to do of OSC escape sequences in compilation output. +If nil, do nothing. + +If the symbol `filter', then filter out all OSC control sequences. + +If anything else (such as t), then collect OSC control sequences +and call appropriate handler as described in `osc-handlers'. + +In order for this to have any effect, `osc-compilation-filter' +must be in `compilation-filter-hook'." + :type '(choice (const :tag "Do nothing" nil) + (const :tag "Filter" filter) + (other :tag "Translate" t)) + :group 'osc + :version "29.0") + +;;;###autoload +(defun osc-compilation-filter () + "Maybe collect OSC control sequences. +This function depends on the `osc-for-compilation-buffer' +variable, and is meant to be used in `compilation-filter-hook'." + (let ((inhibit-read-only t)) + (pcase osc-for-compilation-buffer + ('nil nil) + ('filter + (osc-filter-region compilation-filter-start (point))) + (_ + (osc-apply-on-region compilation-filter-start (point)))))) + (provide 'osc) ;;; osc.el ends here commit 530fdab880e9da25bf37a64d167358454f362b56 Author: Matthias Meulien Date: Sat Sep 17 17:54:24 2022 +0200 Handle OSC command to set window title * lisp/osc.el (osc-handlers): Bind osc-window-title-handler to OSC command 2. (osc-window-title): Local variable storing string extracted from OSC command 2. (osc-window-title-handler): Copy text from OSC command 2 to osc-window-title (bug#57821). diff --git a/lisp/osc.el b/lisp/osc.el index 224981a856..619972dab1 100644 --- a/lisp/osc.el +++ b/lisp/osc.el @@ -23,12 +23,13 @@ ;;; Commentary: ;; Interpretation of OSC (Operating System Commands) escape -;; sequences. Handlers for OSC 7 and 8 (for current directory and -;; hyperlinks respectively) are provided. +;; sequences. Handlers for OSC 2, 7 and 8 (for window title, current +;; directory and hyperlinks respectively) are provided. ;;; Code: -(defvar-local osc-handlers '(("7" . osc-directory-tracker) +(defvar-local osc-handlers '(("2" . osc-window-title-handler) + ("7" . osc-directory-tracker) ("8" . osc-hyperlink-handler)) "Alist of handlers for OSC escape sequences. See `osc-apply-on-region' for details.") @@ -67,6 +68,18 @@ point where the escape sequence was located." (put-text-property pos0 end 'invisible t) (setq osc--marker (copy-marker pos0))))))) +;; Window title handling (OSC 2) + +(defvar-local osc-window-title nil) +(defun osc-window-title-handler (_ text) + "Set value of `osc-window-title' from an OSC 2 escape sequence. +The variable `osc-window-title' can be referred to in +`frame-title-format' to dynamically set the frame title. + +This function is intended to be included as an entry of +`osc-handlers'." + (setq osc-window-title text)) + ;; Current directory tracking (OSC 7) (declare-function url-host "url/url-parse.el") commit 7354f4e3e657e41781b04640797a47c3aaba1457 Author: Matthias Meulien Date: Sun Sep 18 13:54:46 2022 +0200 Extract support of OSC escape sequences from comint * lisp/comint.el (osc): Now requires osc.el. (comint-osc-directory-tracker): Alias to osc-directory-tracker. (comint-osc-hyperlink-handler): Alias to osc-hyperlink-handler. (comint-osc-hyperlink-map): Alias to osc-hyperlink-map. (comint-osc-handlers): Alias to osc-handlers. (comint-osc-hyperlink): Alias to osc-hyperlink. (comint-osc-process-output): Rewritten to call osc-apply-on-region. * lisp/osc.el (osc-handlers): Clone comint-osc-handlers. (osc--marker): Clone comint-osc--marker. (osc-apply-on-region): Implementation taken from comint-osc-process-output. (osc-directory-tracker): Clone from comint-osc-directory-tracker. (osc-hyperlink-map): Clone from comint-osc-hyperlink-map. (osc-hyperlink): Clone from comint-osc-hyperlink. (osc-hyperlink--state): Clone from comint-osc-hyperlink--state. (osc-hyperlink-handler): Clone from comint-osc-hyperlink-handler. * test/lisp/osc-tests.el (osc): Test osc-apply-region (bug#57821). diff --git a/lisp/comint.el b/lisp/comint.el index 696dac3d12..afaa27c2c0 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -103,6 +103,7 @@ (require 'ring) (require 'ansi-color) +(require 'osc) (require 'regexp-opt) ;For regexp-opt-charset. (eval-when-compile (require 'subr-x)) @@ -3914,12 +3915,12 @@ REGEXP-GROUP is the regular expression group in REGEXP to use." ;; to `comint-osc-handlers' allows a customized treatment of further ;; sequences. -(defvar-local comint-osc-handlers '(("7" . comint-osc-directory-tracker) - ("8" . comint-osc-hyperlink-handler)) - "Alist of handlers for OSC escape sequences. -See `comint-osc-process-output' for details.") - -(defvar-local comint-osc--marker nil) +;; Aliases defined for reverse compatibility +(defalias 'comint-osc-handlers 'osc-handlers) +(defalias 'comint-osc-directory-tracker 'osc-directory-tracker) +(defalias 'comint-osc-hyperlink-handler 'osc-hyperlink-handler) +(defalias 'comint-osc-hyperlink 'osc-hyperlink) +(defalias 'comint-osc-hyperlink-map 'osc-hyperlink-map) (defun comint-osc-process-output (_) "Interpret OSC escape sequences in comint output. @@ -3935,81 +3936,10 @@ removed from the buffer. Then, if `command' is a key of the `comint-osc-handlers' alist, the corresponding value, which should be a function, is called with `command' and `text' as arguments, with point where the escape sequence was located." - (let ((bound (process-mark (get-buffer-process (current-buffer))))) - (save-excursion - ;; Start one char before last output to catch a possibly stray ESC - (goto-char (or comint-osc--marker (1- comint-last-output-start))) - (when (eq (char-before) ?\e) (backward-char)) - (while (re-search-forward "\e]" bound t) - (let ((pos0 (match-beginning 0)) - (code (and (re-search-forward "\\=\\([0-9A-Za-z]*\\);" bound t) - (match-string 1))) - (pos1 (point))) - (if (re-search-forward "\a\\|\e\\\\" bound t) - (let ((text (buffer-substring-no-properties - pos1 (match-beginning 0)))) - (setq comint-osc--marker nil) - (delete-region pos0 (point)) - (when-let ((fun (cdr (assoc-string code comint-osc-handlers)))) - (funcall fun code text))) - (put-text-property pos0 bound 'invisible t) - (setq comint-osc--marker (copy-marker pos0)))))))) - -;; Current directory tracking (OSC 7) - -(declare-function url-host "url/url-parse.el") -(declare-function url-type "url/url-parse.el") -(declare-function url-filename "url/url-parse.el") -(defun comint-osc-directory-tracker (_ text) - "Update `default-directory' from OSC 7 escape sequences. - -This function is intended to be included as an entry of -`comint-osc-handlers'. You should moreover arrange for your -shell to print the appropriate escape sequence at each prompt, -say with the following command: - - printf \"\\e]7;file://%s%s\\e\\\\\" \"$HOSTNAME\" \"$PWD\" - -This functionality serves as an alternative to `dirtrack-mode' -and `shell-dirtrack-mode'." - (let ((url (url-generic-parse-url text))) - (when (and (string= (url-type url) "file") - (or (null (url-host url)) - (string= (url-host url) (system-name)))) - (ignore-errors - (cd-absolute (url-unhex-string (url-filename url))))))) - -;; Hyperlink handling (OSC 8) - -(defvar comint-osc-hyperlink-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-c\r" 'browse-url-button-open) - (define-key map [mouse-2] 'browse-url-button-open) - (define-key map [follow-link] 'mouse-face) - map) - "Keymap used by OSC 8 hyperlink buttons.") - -(define-button-type 'comint-osc-hyperlink - 'keymap comint-osc-hyperlink-map - 'help-echo (lambda (_ buffer pos) - (when-let ((url (get-text-property pos 'browse-url-data buffer))) - (format "mouse-2, C-c RET: Open %s" url)))) - -(defvar-local comint-osc-hyperlink--state nil) - -(defun comint-osc-hyperlink-handler (_ text) - "Create a hyperlink from an OSC 8 escape sequence. -This function is intended to be included as an entry of -`comint-osc-handlers'." - (when comint-osc-hyperlink--state - (let ((start (car comint-osc-hyperlink--state)) - (url (cdr comint-osc-hyperlink--state))) - (make-text-button start (point) - 'type 'comint-osc-hyperlink - 'browse-url-data url))) - (setq comint-osc-hyperlink--state - (and (string-match ";\\(.+\\)" text) - (cons (point-marker) (match-string-no-properties 1 text))))) + (let ((start (1- comint-last-output-start)) + ;; Start one char before last output to catch a possibly stray ESC + (bound (process-mark (get-buffer-process (current-buffer))))) + (osc-apply-on-region start bound))) ;;; Input fontification and indentation through an indirect buffer diff --git a/lisp/osc.el b/lisp/osc.el new file mode 100644 index 0000000000..224981a856 --- /dev/null +++ b/lisp/osc.el @@ -0,0 +1,127 @@ +;;; osc.el --- Support for OSC escape sequences -*- lexical-binding: t; -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Augusto Stoffel +;; Matthias Meulien +;; Maintainer: emacs-devel@gnu.org +;; Keywords: processes, terminals, services + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Interpretation of OSC (Operating System Commands) escape +;; sequences. Handlers for OSC 7 and 8 (for current directory and +;; hyperlinks respectively) are provided. + +;;; Code: + +(defvar-local osc-handlers '(("7" . osc-directory-tracker) + ("8" . osc-hyperlink-handler)) + "Alist of handlers for OSC escape sequences. +See `osc-apply-on-region' for details.") + +(defvar-local osc--marker nil) +;; The function `osc-apply-on-region' can set `osc--marker' to the start +;; position of an escape sequence without termination. + +(defun osc-apply-on-region (begin end) + "Interpret OSC escape sequences in region. +This function search for escape sequences of the forms + + ESC ] command ; text BEL + ESC ] command ; text ESC \\ + +Every occurrence of such escape sequences is removed from the +buffer. Then, if `command' is a key of the local variable +`osc-handlers' alist, the corresponding value, which should be a +function, is called with `command' and `text' as arguments, with +point where the escape sequence was located." + (save-excursion + (goto-char (or osc--marker begin)) + (when (eq (char-before) ?\e) (backward-char)) + (while (re-search-forward "\e]" end t) + (let ((pos0 (match-beginning 0)) + (code (and (re-search-forward "\\=\\([0-9A-Za-z]*\\);" end t) + (match-string 1))) + (pos1 (point))) + (if (re-search-forward "\a\\|\e\\\\" end t) + (let ((text (buffer-substring-no-properties + pos1 (match-beginning 0)))) + (setq osc--marker nil) + (delete-region pos0 (point)) + (when-let ((fun (cdr (assoc-string code osc-handlers)))) + (funcall fun code text))) + (put-text-property pos0 end 'invisible t) + (setq osc--marker (copy-marker pos0))))))) + +;; Current directory tracking (OSC 7) + +(declare-function url-host "url/url-parse.el") +(declare-function url-type "url/url-parse.el") +(declare-function url-filename "url/url-parse.el") +(defun osc-directory-tracker (_ text) + "Update `default-directory' from OSC 7 escape sequences. + +This function is intended to be included as an entry of +`osc-handlers'. You should moreover arrange for your shell to +print the appropriate escape sequence at each prompt, say with +the following command: + + printf \"\\e]7;file://%s%s\\e\\\\\" \"$HOSTNAME\" \"$PWD\" + +This functionality serves as an alternative to `dirtrack-mode' +and `shell-dirtrack-mode'." + (let ((url (url-generic-parse-url text))) + (when (and (string= (url-type url) "file") + (or (null (url-host url)) + (string= (url-host url) (system-name)))) + (ignore-errors + (cd-absolute (url-unhex-string (url-filename url))))))) + +;; Hyperlink handling (OSC 8) + +(defvar osc-hyperlink-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c\r" 'browse-url-button-open) + (define-key map [mouse-2] 'browse-url-button-open) + (define-key map [follow-link] 'mouse-face) + map) + "Keymap used by OSC 8 hyperlink buttons.") + +(define-button-type 'osc-hyperlink + 'keymap osc-hyperlink-map + 'help-echo (lambda (_ buffer pos) + (when-let ((url (get-text-property pos 'browse-url-data buffer))) + (format "mouse-2, C-c RET: Open %s" url)))) + +(defvar-local osc-hyperlink--state nil) + +(defun osc-hyperlink-handler (_ text) + "Create a hyperlink from an OSC 8 escape sequence. +This function is intended to be included as an entry of +`osc-handlers'." + (when osc-hyperlink--state + (let ((start (car osc-hyperlink--state)) + (url (cdr osc-hyperlink--state))) + (make-text-button start (point) + 'type 'osc-hyperlink + 'browse-url-data url))) + (setq osc-hyperlink--state + (and (string-match ";\\(.+\\)" text) + (cons (point-marker) (match-string-no-properties 1 text))))) + +(provide 'osc) +;;; osc.el ends here diff --git a/test/lisp/osc-tests.el b/test/lisp/osc-tests.el new file mode 100644 index 0000000000..d53bab08d3 --- /dev/null +++ b/test/lisp/osc-tests.el @@ -0,0 +1,57 @@ +;;; osc-tests.el --- Tests for osc.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Matthias Meulien +;; Keywords: + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'osc) +(require 'ert) + +(defvar osc-tests--strings + `( + ("Hello World" "Hello World") + + ;; window title + ("Buffer \e]2;A window title\e\\content" "Buffer content") + + ;; window title + ("Unfinished \e]2;window title" "Unfinished \e]2;window title") + + ;; current directory + ("\e]7;file://127.0.0.1/tmp\e\\user@host$ " "user@host$ ") + + ;; hyperlink + ("\e]8;;http://example.com\e\\This is a link\e]8;;\e\\" "This is a link") + )) +;; Don't output those strings to stdout since they may have +;; side-effects on the environment + +(ert-deftest osc-tests-apply-region-no-handlers () + (let ((osc-handlers nil)) + (pcase-dolist (`(,input ,text) osc-tests--strings) + (with-temp-buffer + (insert input) + (osc-apply-on-region (point-min) (point-max)) + (should (equal (buffer-string) text)))))) commit 39cc0c2f234ccac782a722d0ee998c4f57e0f65f Author: Lars Ingebrigtsen Date: Sun Sep 18 13:20:51 2022 +0200 Improve the initial-frame-alist doc string * lisp/frame.el (initial-frame-alist): Clarify how to set this variable (bug#57890). diff --git a/lisp/frame.el b/lisp/frame.el index ae8449d0ea..67c1168557 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -77,17 +77,20 @@ If the value calls for a frame without a minibuffer, and you have not created a minibuffer frame on your own, a minibuffer frame is created according to `minibuffer-frame-alist'. -You can specify geometry-related options for just the initial -frame by setting this variable in your init file; however, they -won't take effect until Emacs reads your init file, which happens -after creating the initial frame. If you want the initial frame -to have the proper geometry as soon as it appears, you need to -use this three-step process: +Emacs reads your main init file after creating the initial frame, +so setting it there won't have the expected effect. Instead, you +can set it in `early-init-file'. + +If you're using X, and you want (for instance) to have different +geometries on different displays, you need to use this three-step +process: + * Specify X resources to give the geometry you want. * Set `default-frame-alist' to override these options so that they don't affect subsequent frames. -* Set `initial-frame-alist' in a way that matches the X resources, - to override what you put in `default-frame-alist'." +* Set `initial-frame-alist' in your normal init file in a way + that matches the X resources, to override what you put in + `default-frame-alist'." :type '(repeat (cons :format "%v" (symbol :tag "Parameter") (sexp :tag "Value"))) commit 62b1e3b1f3d8d89cd8581f28642a107078127af7 Author: Lars Ingebrigtsen Date: Sun Sep 18 13:10:02 2022 +0200 Restore the point after aborting an image crop * lisp/image/image-crop.el (image-crop): Restore point after aborted cropping (bug#57874). diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el index 8b6694f223..39c5757636 100644 --- a/lisp/image/image-crop.el +++ b/lisp/image/image-crop.el @@ -29,6 +29,7 @@ (require 'svg) (require 'text-property-search) +(eval-when-compile (require 'subr-x)) (defgroup image-crop () "Image cropping." @@ -149,6 +150,7 @@ After cropping an image, you can save it by `M-x image-save' or (data (image-crop--content-type data)))) (image-scaling-factor 1) + (orig-point (point)) (size (image-size image t)) (svg (svg-create (car size) (cdr size) :xmlns:xlink "http://www.w3.org/1999/xlink" @@ -186,25 +188,27 @@ After cropping an image, you can save it by `M-x image-save' or (svg-embed svg data type t :width (car size) :height (cdr size)) - (delete-region image-start image-end) - (svg-insert-image svg) - (let ((area (condition-case _ - (save-excursion - (forward-line 1) - (image-crop--crop-image-1 - svg (if cut "cut" "crop"))) - (quit nil)))) - (message (substitute-command-keys - "Type \\[image-save] to save %s image to file") - (if cut "cut" "cropped")) - (delete-region (pos-bol) (pos-eol)) - (if area - (image-crop--crop-image-update - area orig-data size type cut text) - ;; If the user didn't complete the crop, re-insert the - ;; original image (and text). - (insert text)) - (undo-amalgamate-change-group undo-handle))))) + (with-buffer-unmodified-if-unchanged + (delete-region image-start image-end) + (svg-insert-image svg) + (let ((area (condition-case _ + (save-excursion + (forward-line 1) + (image-crop--crop-image-1 + svg (if cut "cut" "crop"))) + (quit nil)))) + (message (substitute-command-keys + "Type \\[image-save] to save %s image to file") + (if cut "cut" "cropped")) + (delete-region (pos-bol) (pos-eol)) + (if area + (image-crop--crop-image-update + area orig-data size type cut text) + ;; If the user didn't complete the crop, re-insert the + ;; original image (and text). + (insert text) + (goto-char orig-point)) + (undo-amalgamate-change-group undo-handle)))))) (defun image-crop--crop-image-update (area data size type cut text) (let* ((image-scaling-factor 1) commit 5332e4fecb4dece0f15c1ffcba422864b73459ef Author: Augusto Stoffel Date: Sun Sep 18 13:01:23 2022 +0200 pulse-momentary-highlight-one-line: Act on visual line * lisp/cedet/pulse.el (pulse-momentary-highlight-one-line): Act on entire visual line, ignoring fields etc (bug#57876). diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el index 9941f2a0cb..0564cf6d04 100644 --- a/lisp/cedet/pulse.el +++ b/lisp/cedet/pulse.el @@ -202,12 +202,8 @@ If POINT is nil or missing, the current point is used instead. Optional argument FACE specifies the face to do the highlighting." (save-excursion (goto-char (or point (point))) - (let ((start (line-beginning-position)) - (end (save-excursion - (end-of-line) - (when (not (eobp)) - (forward-char 1)) - (point)))) + (let ((start (progn (vertical-motion 0) (point))) + (end (progn (vertical-motion 1) (point)))) (pulse-momentary-highlight-region start end face)))) ;;;###autoload commit 06618e9435a65ff1c3be864d5433ec136c2ffc0e Author: Augusto Stoffel Date: Sun Sep 18 12:53:28 2022 +0200 Remap 'up-list' in python-mode-map * lisp/progmodes/python.el (python-mode-map): Remap 'up-list' to 'python-nav-up-list' (bug#57885). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 6ef468d2cb..09f94f4b34 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -300,6 +300,7 @@ instead." (define-key map [remap backward-sentence] #'python-nav-backward-block) (define-key map [remap forward-sentence] #'python-nav-forward-block) (define-key map [remap backward-up-list] #'python-nav-backward-up-list) + (define-key map [remap up-list] #'python-nav-up-list) (define-key map [remap mark-defun] #'python-mark-defun) (define-key map "\C-c\C-j" #'imenu) ;; Indent specific commit af2a25aa19338ed8ce1984eeed25919761b1257e Author: Augusto Stoffel Date: Sun Sep 18 12:53:04 2022 +0200 Add new command python-shell-restart * lisp/progmodes/python.el (python-shell-restart): New command (bug#57885). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9f9439aac6..6ef468d2cb 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3217,6 +3217,26 @@ process buffer for a list of commands.)" show))) (get-buffer-process buffer))) +(defun python-shell-restart (&optional show) + "Restart the Python shell. +Optional argument SHOW (interactively, the prefix argument), if +non-nil, means also display the Python shell buffer." + (interactive "P") + (with-current-buffer + (or (and (derived-mode-p 'inferior-python-mode) + (current-buffer)) + (seq-some (lambda (dedicated) + (get-buffer (format "*%s*" (python-shell-get-process-name + dedicated)))) + '(buffer project nil)) + (user-error "No Python shell")) + (when-let ((proc (get-buffer-process (current-buffer)))) + (kill-process proc) + (while (accept-process-output proc))) + (python-shell-make-comint (python-shell-calculate-command) + (string-trim (buffer-name) "\\*" "\\*") + show))) + (defun run-python-internal () "Run an inferior Internal Python process. Input and output via buffer named after commit 69cc3d38bc7b5887e7f1497937d0ea8be1f70673 Author: Michael Albinus Date: Sun Sep 18 12:51:52 2022 +0200 Fix Tramp error with eshell integration * lisp/net/tramp-integration.el (tramp-eshell-directory-change): Respect local `default-directory'. (Bug#57556) diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index b5df9804ab..9aa4b2b1e8 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -134,8 +134,10 @@ been set up by `rfn-eshadow-setup-minibuffer'." ;; Remove last element of `(exec-path)', which is `exec-directory'. ;; Use `path-separator' as it does eshell. (setq eshell-path-env - (mapconcat - #'identity (butlast (tramp-compat-exec-path)) path-separator))) + (if (file-remote-p default-directory) + (mapconcat + #'identity (butlast (tramp-compat-exec-path)) path-separator) + (getenv "PATH")))) (with-eval-after-load 'esh-util (add-hook 'eshell-mode-hook commit 59e887f913eb6af9c61091e37377cba8f2676ecb Author: Stefan Kangas Date: Sun Sep 18 12:12:44 2022 +0200 image-dired: Don't require subr-x * lisp/image/image-dired-dired.el (subr-x): * lisp/image/image-dired.el (subr-x): Don't require, since string-join is now autoloaded. diff --git a/lisp/image/image-dired-dired.el b/lisp/image/image-dired-dired.el index 68e35191e8..ba3145c702 100644 --- a/lisp/image/image-dired-dired.el +++ b/lisp/image/image-dired-dired.el @@ -27,8 +27,6 @@ ;;; Code: -(eval-when-compile (require 'subr-x)) ; for string-join - (require 'image-dired) (defgroup image-dired-dired nil diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 265f23eb52..c2bb874cef 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -139,7 +139,6 @@ (eval-when-compile (require 'cl-lib) - (require 'subr-x) ; for string-join (require 'wid-edit)) (require 'image-dired-external) commit d7c4532f7c59908cc4c29ed3fa1c9f7763878172 Author: Michael Albinus Date: Sun Sep 18 10:52:34 2022 +0200 ; Instrument filenotify-tests Author: diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index cde93e6ed6..1e36117825 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -178,7 +178,7 @@ Return nil when any other file notification watch is still active." (setq file-notify-debug nil password-cache-expiry nil - tramp-verbose (when (getenv "EMACS_EMBA_CI") 10 0) + tramp-verbose (if (getenv "EMACS_EMBA_CI") 10 0) ;; When the remote user id is 0, Tramp refuses unsafe temporary files. tramp-allow-unsafe-temporary-files commit 67620c2a13b7ec8e16b5649c3f989b903692268b Author: Michael Albinus Date: Sun Sep 18 10:51:33 2022 +0200 ; Instrument filenotify-tests diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index bdf0da7a73..cde93e6ed6 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -137,6 +137,11 @@ Return nil when any other file notification watch is still active." (defun file-notify--test-cleanup () "Cleanup after a test." + (when (getenv "EMACS_EMBA_CI") + (dolist (buf (tramp-list-tramp-buffers)) + (message ";; %s\n%s" buf (tramp-get-buffer-string buf)) + (kill-buffer buf))) + (file-notify-rm-all-watches) (ignore-errors @@ -173,7 +178,8 @@ Return nil when any other file notification watch is still active." (setq file-notify-debug nil password-cache-expiry nil - tramp-verbose 0 + tramp-verbose (when (getenv "EMACS_EMBA_CI") 10 0) + ;; When the remote user id is 0, Tramp refuses unsafe temporary files. tramp-allow-unsafe-temporary-files (or tramp-allow-unsafe-temporary-files noninteractive)) commit 25587ada2c094e5435a7a39bf99e97730cc7ecd0 Author: Po Lu Date: Sun Sep 18 15:23:42 2022 +0800 Remove what should be unnecessary calls to block_input * src/xterm.c (handle_one_xevent): Do not block input inside. This function is not reentrant and is always called with input blocked. diff --git a/src/xterm.c b/src/xterm.c index deceafbc81..cb6581b78c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -17628,6 +17628,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, int dx, dy; USE_SAFE_ALLOCA; + /* This function is not reentrant, so input should be blocked before + it is called. */ + + if (!input_blocked_p ()) + emacs_abort (); + *finish = X_EVENT_NORMAL; EVENT_INIT (inev.ie); @@ -18526,11 +18532,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, Window root; unsigned int dummy_uint; - block_input (); XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &root, &f->left_pos, &f->top_pos, &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint); - unblock_input (); } x_set_frame_alpha (f); @@ -18555,7 +18559,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, { if (!FRAME_VISIBLE_P (f)) { - block_input (); /* By default, do not set the frame's visibility here, see https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html. The default behavior can be overridden by setting @@ -18574,7 +18577,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, #endif f->output_data.x->has_been_visible = true; SET_FRAME_GARBAGED (f); - unblock_input (); } else if (FRAME_GARBAGED_P (f)) { @@ -20069,12 +20071,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, flicker. Don't try to optimize these calls by looking only for size changes: that's not sufficient. We miss some surface invalidations and flicker. */ - block_input (); #ifdef HAVE_XDBE if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) x_drop_xrender_surfaces (f); #endif - unblock_input (); #if defined USE_CAIRO && !defined USE_GTK if (f) x_cr_update_surface_desired_size (f, configureEvent.xconfigure.width, @@ -20104,10 +20104,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, f->new_width, f->new_height); #ifdef HAVE_XDBE - block_input (); if (FRAME_X_DOUBLE_BUFFERED_P (f)) x_drop_xrender_surfaces (f); - unblock_input (); #endif xg_frame_resized (f, configureEvent.xconfigure.width, configureEvent.xconfigure.height); @@ -20197,11 +20195,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, Window root; unsigned int dummy_uint; - block_input (); XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &root, &f->left_pos, &f->top_pos, &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint); - unblock_input (); } if (!FRAME_TOOLTIP_P (f) @@ -20486,12 +20482,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf))) { - block_input (); XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), RevertToParent, event->xbutton.time); if (FRAME_PARENT_FRAME (f)) XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); - unblock_input (); } } @@ -22152,7 +22146,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf))) { - block_input (); #if defined HAVE_GTK3 || (!defined USE_GTK && !defined USE_X_TOOLKIT) if (device) { @@ -22175,7 +22168,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, #endif if (FRAME_PARENT_FRAME (f)) XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); - unblock_input (); } } @@ -23680,7 +23672,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, #endif OTHER: #ifdef USE_X_TOOLKIT - block_input (); if (*finish != X_EVENT_DROP) { /* Ignore some obviously bogus ConfigureNotify events that @@ -23697,7 +23688,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, #endif } } - unblock_input (); #endif /* USE_X_TOOLKIT */ #if defined USE_GTK && !defined HAVE_GTK3 && defined HAVE_XINPUT2 if (*finish != X_EVENT_DROP && copy)