commit f703232b7ff3453640179c6c1e9415e9ff1af987 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Wed Dec 22 11:13:23 2021 +0800 Use XI2 calls to warp the client pointer * src/xfns.c (Fx_set_mouse_absolute_pixel_position): * src/xterm.c (frame_set_mouse_pixel_position): Replace calls to XWarpPointer with calls to XIWarpPointer with the client pointer explictly specified. This avoids the odd situation where the client pointer of the root window is not the client pointer of the frame. diff --git a/src/xfns.c b/src/xfns.c index 30ed358fb2..168debc8f3 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5643,8 +5643,23 @@ The coordinates X and Y are interpreted in pixels relative to a position int yval = check_integer_range (y, INT_MIN, INT_MAX); block_input (); - XWarpPointer (FRAME_X_DISPLAY (f), None, DefaultRootWindow (FRAME_X_DISPLAY (f)), - 0, 0, 0, 0, xval, yval); +#ifdef HAVE_XINPUT2 + int deviceid; + + if (FRAME_DISPLAY_INFO (f)->supports_xi2) + { + if (XIGetClientPointer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + &deviceid)) + { + XIWarpPointer (FRAME_X_DISPLAY (f), deviceid, None, + DefaultRootWindow (FRAME_X_DISPLAY (f)), + 0, 0, 0, 0, xval, yval); + } + } + else +#endif + XWarpPointer (FRAME_X_DISPLAY (f), None, DefaultRootWindow (FRAME_X_DISPLAY (f)), + 0, 0, 0, 0, xval, yval); unblock_input (); return Qnil; diff --git a/src/xterm.c b/src/xterm.c index 33396cc9ab..070ee7d671 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -13223,9 +13223,24 @@ void frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) { block_input (); +#ifdef HAVE_XINPUT2 + int deviceid; - XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f), - 0, 0, 0, 0, pix_x, pix_y); + if (FRAME_DISPLAY_INFO (f)->supports_xi2) + { + if (XIGetClientPointer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + &deviceid)) + { + XIWarpPointer (FRAME_X_DISPLAY (f), + deviceid, None, + FRAME_X_WINDOW (f), + 0, 0, 0, 0, pix_x, pix_y); + } + } + else +#endif + XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f), + 0, 0, 0, 0, pix_x, pix_y); unblock_input (); } commit 026804b60631d4766bb99bf94a4ad04e13ae0d07 Author: Po Lu Date: Wed Dec 22 09:24:05 2021 +0800 Fix GTK crash when clicking on xwidgets on XI2 * src/xterm.c (handle_one_xevent): Drop button events destined for an xwidget. diff --git a/src/xterm.c b/src/xterm.c index 8618a98679..33396cc9ab 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9704,6 +9704,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, inev.ie.kind = SELECT_WINDOW_EVENT; inev.ie.frame_or_window = xvw->w; } + + *finish = X_EVENT_DROP; goto OTHER; } #endif commit 4b7e73432cd07612e5225189e18696f755c8f954 Author: Paul Eggert Date: Tue Dec 21 15:36:16 2021 -0800 Update from gnulib diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index fbec70c135..66b733cfe4 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -1328,7 +1328,6 @@ BUILT_SOURCES += $(ALLOCA_H) ifneq (,$(GL_GENERATE_ALLOCA_H_CONDITION)) alloca.h: alloca.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' < $(srcdir)/alloca.in.h; \ } > $@-t && \ @@ -1391,7 +1390,6 @@ BUILT_SOURCES += $(BYTESWAP_H) ifneq (,$(GL_GENERATE_BYTESWAP_H_CONDITION)) byteswap.h: byteswap.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/byteswap.in.h; \ } > $@-t && \ @@ -1572,7 +1570,6 @@ BUILT_SOURCES += dirent.h # doesn't have one that works with the given compiler. dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \ @@ -1665,8 +1662,8 @@ ifneq (,$(gl_GNULIB_ENABLED_dynarray_CONDITION)) BUILT_SOURCES += malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h malloc/dynarray.gl.h: malloc/dynarray.h - $(AM_V_at)$(MKDIR_P) 'malloc' - $(AM_V_GEN)rm -f $@-t $@ && \ + $(AM_V_GEN)$(MKDIR_P) 'malloc' + $(AM_V_at)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e '/libc_hidden_proto/d' < $(srcdir)/malloc/dynarray.h; \ } > $@-t && \ @@ -1674,8 +1671,8 @@ malloc/dynarray.gl.h: malloc/dynarray.h MOSTLYCLEANFILES += malloc/dynarray.gl.h malloc/dynarray.gl.h-t malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c - $(AM_V_at)$(MKDIR_P) 'malloc' - $(AM_V_GEN)rm -f $@-t $@ && \ + $(AM_V_GEN)$(MKDIR_P) 'malloc' + $(AM_V_at)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|||g' \ -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \ @@ -1719,7 +1716,6 @@ BUILT_SOURCES += $(ERRNO_H) ifneq (,$(GL_GENERATE_ERRNO_H_CONDITION)) errno.h: errno.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -1769,7 +1765,6 @@ BUILT_SOURCES += $(EXECINFO_H) ifneq (,$(GL_GENERATE_EXECINFO_H_CONDITION)) execinfo.h: execinfo.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/execinfo.in.h; \ } > $@-t && \ @@ -1840,7 +1835,6 @@ BUILT_SOURCES += fcntl.h # doesn't have one that works with the given compiler. fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -2045,7 +2039,6 @@ BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H) ifneq (,$(GL_GENERATE_GETOPT_H_CONDITION)) getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ @@ -2164,7 +2157,6 @@ BUILT_SOURCES += $(IEEE754_H) ifneq (,$(GL_GENERATE_IEEE754_H_CONDITION)) ieee754.h: ieee754.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/ifndef _GL_GNULIB_HEADER/if 0/g' \ $(srcdir)/ieee754.in.h; \ @@ -2208,7 +2200,6 @@ BUILT_SOURCES += inttypes.h # doesn't have one that works with the given compiler. inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -2310,7 +2301,6 @@ BUILT_SOURCES += $(LIMITS_H) ifneq (,$(GL_GENERATE_LIMITS_H_CONDITION)) limits.h: limits.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -2612,8 +2602,8 @@ ifneq (,$(gl_GNULIB_ENABLED_scratch_buffer_CONDITION)) BUILT_SOURCES += malloc/scratch_buffer.gl.h malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h - $(AM_V_at)$(MKDIR_P) 'malloc' - $(AM_V_GEN)rm -f $@-t $@ && \ + $(AM_V_GEN)$(MKDIR_P) 'malloc' + $(AM_V_at)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \ -e 's|__glibc_likely|_GL_LIKELY|g' \ @@ -2663,7 +2653,6 @@ BUILT_SOURCES += signal.h # doesn't have a complete one. signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -2775,7 +2764,6 @@ BUILT_SOURCES += $(STDALIGN_H) ifneq (,$(GL_GENERATE_STDALIGN_H_CONDITION)) stdalign.h: stdalign.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/stdalign.in.h; \ } > $@-t && \ @@ -2801,7 +2789,6 @@ BUILT_SOURCES += $(STDDEF_H) ifneq (,$(GL_GENERATE_STDDEF_H_CONDITION)) stddef.h: stddef.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -2835,7 +2822,6 @@ BUILT_SOURCES += $(STDINT_H) ifneq (,$(GL_GENERATE_STDINT_H_CONDITION)) stdint.h: stdint.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ @@ -2887,7 +2873,6 @@ BUILT_SOURCES += stdio.h # doesn't have one that works with the given compiler. stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -3026,7 +3011,6 @@ BUILT_SOURCES += stdlib.h stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -3183,7 +3167,6 @@ BUILT_SOURCES += string.h # doesn't have one that works with the given compiler. string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -3344,8 +3327,8 @@ BUILT_SOURCES += sys/random.h # We need the following in order to create when the system # doesn't have one. sys/random.h: sys_random.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) - $(AM_V_at)$(MKDIR_P) 'sys' - $(AM_V_GEN)rm -f $@-t $@ && \ + $(AM_V_GEN)$(MKDIR_P) 'sys' + $(AM_V_at)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -3378,8 +3361,8 @@ BUILT_SOURCES += sys/select.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) - $(AM_V_at)$(MKDIR_P) 'sys' - $(AM_V_GEN)rm -f $@-t $@ && \ + $(AM_V_GEN)$(MKDIR_P) 'sys' + $(AM_V_at)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -3414,8 +3397,8 @@ BUILT_SOURCES += sys/stat.h # We need the following in order to create when the system # has one that is incomplete. sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) - $(AM_V_at)$(MKDIR_P) 'sys' - $(AM_V_GEN)rm -f $@-t $@ && \ + $(AM_V_GEN)$(MKDIR_P) 'sys' + $(AM_V_at)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -3489,8 +3472,8 @@ BUILT_SOURCES += sys/time.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) - $(AM_V_at)$(MKDIR_P) 'sys' - $(AM_V_GEN)rm -f $@-t $@ && \ + $(AM_V_GEN)$(MKDIR_P) 'sys' + $(AM_V_at)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ @@ -3525,8 +3508,8 @@ BUILT_SOURCES += sys/types.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. sys/types.h: sys_types.in.h $(top_builddir)/config.status - $(AM_V_at)$(MKDIR_P) 'sys' - $(AM_V_GEN)rm -f $@-t $@ && \ + $(AM_V_GEN)$(MKDIR_P) 'sys' + $(AM_V_at)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -3564,7 +3547,6 @@ BUILT_SOURCES += time.h # doesn't have one that works with the given compiler. time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -3695,7 +3677,6 @@ libgnu_a_SOURCES += unistd.c # when the system doesn't have one. unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ - $(MKDIR_P) '.' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ diff --git a/lib/intprops.h b/lib/intprops.h index 7f20f09fa0..a10d793e0a 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -240,7 +240,7 @@ #endif /* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */ -#if defined __clang_major_ && __clang_major__ < 14 +#if defined __clang_major__ && __clang_major__ < 14 /* Work around Clang bug . */ # define _GL_HAS_BUILTIN_MUL_OVERFLOW 0 #else diff --git a/lib/warn-on-use.h b/lib/warn-on-use.h index 612937abb0..3984294616 100644 --- a/lib/warn-on-use.h +++ b/lib/warn-on-use.h @@ -84,20 +84,20 @@ # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) /* A compiler attribute is available in gcc versions 4.3.0 and later. */ # define _GL_WARN_ON_USE(function, message) \ -extern __typeof__ (function) function __attribute__ ((__warning__ (message))) +_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ __attribute__ ((__warning__ (message))) # elif __clang_major__ >= 4 /* Another compiler attribute is available in clang. */ # define _GL_WARN_ON_USE(function, message) \ -extern __typeof__ (function) function \ +_GL_WARN_EXTERN_C __typeof__ (function) function \ __attribute__ ((__diagnose_if__ (1, message, "warning"))) # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ __attribute__ ((__diagnose_if__ (1, message, "warning"))) # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING /* Verify the existence of the function. */ # define _GL_WARN_ON_USE(function, message) \ -extern __typeof__ (function) function +_GL_WARN_EXTERN_C __typeof__ (function) function # define _GL_WARN_ON_USE_ATTRIBUTE(message) # else /* Unsupported. */ # define _GL_WARN_ON_USE(function, message) \ commit f1668ef23c19a34a0e99506f7751c33c05f99179 Author: Philip Kaludercic Date: Thu Dec 9 17:36:14 2021 +0100 Delete completion window on quitting * lisp/simple.el (completion-list-mode-map): Rebind delete-completion-window over keyboard-quit. diff --git a/lisp/simple.el b/lisp/simple.el index e2d140af89..eb21814a3d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8982,6 +8982,7 @@ makes it easier to edit it." (define-key map [down-mouse-2] nil) (define-key map "\C-m" 'choose-completion) (define-key map "\e\e\e" 'delete-completion-window) + (define-key map [remap keyboard-quit] #'delete-completion-window) (define-key map [left] 'previous-completion) (define-key map [right] 'next-completion) (define-key map [?\t] 'next-completion) commit 15693c81163e70b5df786e7c034bd236a40794bb Author: Philip Kaludercic Date: Thu Dec 9 17:26:14 2021 +0100 Allow for next-completion to wrap around the completion buffer * lisp/simple.el (completion-wrap-movement): Add new option. (previous-completion): Update docstring. (next-completion): Respect completion-wrap-movement. (switch-to-completions): Handle backwards completion by jumping to the end of the buffer. * lisp/minibuffer.el: (minibuffer-local-completion-map): Bind minibuffer-complete to backtab (completion--in-region-1): Handle backtab to scroll backwards diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 28bd1df59a..112c609a0a 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1379,14 +1379,18 @@ scroll the window of possible completions." ;; and this command is repeated, scroll that window. ((and (window-live-p minibuffer-scroll-window) (eq t (frame-visible-p (window-frame minibuffer-scroll-window)))) - (let ((window minibuffer-scroll-window)) + (let ((window minibuffer-scroll-window) + (reverse (equal (this-command-keys) [backtab]))) (with-current-buffer (window-buffer window) - (if (pos-visible-in-window-p (point-max) window) - ;; If end is in view, scroll up to the beginning. - (set-window-start window (point-min) nil) + (if (pos-visible-in-window-p (if reverse (point-min) (point-max)) window) + ;; If end or beginning is in view, scroll up to the + ;; beginning or end respectively. + (if reverse + (set-window-point window (point-max)) + (set-window-start window (point-min) nil)) ;; Else scroll down one screen. (with-selected-window window - (scroll-up))) + (if reverse (scroll-down) (scroll-up)))) nil))) ;; If we're cycling, keep on cycling. ((and completion-cycling completion-all-sorted-completions) @@ -2651,6 +2655,7 @@ The completion method is determined by `completion-at-point-functions'." (let ((map (make-sparse-keymap))) (set-keymap-parent map minibuffer-local-map) (define-key map "\t" 'minibuffer-complete) + (define-key map [backtab] 'minibuffer-complete) ;; M-TAB is already abused for many other purposes, so we should find ;; another binding for it. ;; (define-key map "\e\t" 'minibuffer-force-complete) diff --git a/lisp/simple.el b/lisp/simple.el index 62a9f264d6..e2d140af89 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9029,38 +9029,68 @@ Go to the window from which completion was requested." (if (get-buffer-window buf) (select-window (get-buffer-window buf)))))) +(defcustom completion-wrap-movement t + "Non-nil means to wrap around when selecting completion options. +This affects the commands `next-completion' and +`previous-completion'." + :type 'boolean + :version "29.1" + :group 'completion) + (defun previous-completion (n) - "Move to the previous item in the completion list." + "Move to the previous item in the completion list. +With prefix argument N, move back N items (negative N means move +forward)." (interactive "p") (next-completion (- n))) (defun next-completion (n) "Move to the next item in the completion list. -With prefix argument N, move N items (negative N means move backward)." +With prefix argument N, move N items (negative N means move +backward)." (interactive "p") (let ((beg (point-min)) (end (point-max))) - (while (and (> n 0) (not (eobp))) - ;; If in a completion, move to the end of it. - (when (get-text-property (point) 'mouse-face) - (goto-char (next-single-property-change (point) 'mouse-face nil end))) - ;; Move to start of next one. - (unless (get-text-property (point) 'mouse-face) - (goto-char (next-single-property-change (point) 'mouse-face nil end))) - (setq n (1- n))) - (while (and (< n 0) (not (bobp))) - (let ((prop (get-text-property (1- (point)) 'mouse-face))) - ;; If in a completion, move to the start of it. - (when (and prop (eq prop (get-text-property (point) 'mouse-face))) - (goto-char (previous-single-property-change - (point) 'mouse-face nil beg))) - ;; Move to end of the previous completion. - (unless (or (bobp) (get-text-property (1- (point)) 'mouse-face)) - (goto-char (previous-single-property-change - (point) 'mouse-face nil beg))) - ;; Move to the start of that one. - (goto-char (previous-single-property-change - (point) 'mouse-face nil beg)) - (setq n (1+ n)))))) + (catch 'bound + (while (> n 0) + ;; If in a completion, move to the end of it. + (when (get-text-property (point) 'mouse-face) + (goto-char (next-single-property-change (point) 'mouse-face nil end))) + ;; If at the last completion option, wrap or skip to the + ;; minibuffer, if requested. + (when (and completion-wrap-movement (eobp)) + (if (and (member (this-command-keys) '("\t" [backtab])) + completion-auto-select) + (throw 'bound nil) + (goto-char (point-min)))) + ;; Move to start of next one. + (unless (get-text-property (point) 'mouse-face) + (goto-char (next-single-property-change (point) 'mouse-face nil end))) + (setq n (1- n))) + (while (< n 0) + (let ((prop (get-text-property (1- (point)) 'mouse-face))) + ;; If in a completion, move to the start of it. + (when (and prop (eq prop (get-text-property (point) 'mouse-face))) + (goto-char (previous-single-property-change + (point) 'mouse-face nil beg))) + ;; Move to end of the previous completion. + (unless (or (bobp) (get-text-property (1- (point)) 'mouse-face)) + (goto-char (previous-single-property-change + (point) 'mouse-face nil beg))) + ;; If at the first completion option, wrap or skip to the + ;; minibuffer, if requested. + (when (and completion-wrap-movement (bobp)) + (if (and (member (this-command-keys) '("\t" [backtab])) + completion-auto-select) + (progn + (goto-char (next-single-property-change (point) 'mouse-face nil end)) + (throw 'bound nil)) + (goto-char (point-max)))) + ;; Move to the start of that one. + (goto-char (previous-single-property-change + (point) 'mouse-face nil beg)) + (setq n (1+ n))))) + (when (/= 0 n) + (switch-to-minibuffer)))) (defun choose-completion (&optional event) "Choose the completion at point. @@ -9285,10 +9315,16 @@ select the completion near point.\n\n"))))) (get-buffer-window "*Completions*" 0))))) (when window (select-window window) - ;; In the new buffer, go to the first completion. - ;; FIXME: Perhaps this should be done in `minibuffer-completion-help'. - (when (bobp) - (next-completion 1))))) + (cond + ((and (memq this-command '(completion-at-point minibuffer-complete)) + (equal (this-command-keys) [backtab]) + (bobp)) + (goto-char (point-max)) + (previous-completion 1)) + ;; In the new buffer, go to the first completion. + ;; FIXME: Perhaps this should be done in `minibuffer-completion-help'. + ((bobp) + (next-completion 1)))))) (defun read-expression-switch-to-completions () "Select the completion list window while reading an expression." commit f6967d2f6666d2e8b40f502e5a948c81c3236249 Author: Philip Kaludercic Date: Thu Dec 9 17:34:54 2021 +0100 Allow for the completion buffer to be automatically selected * lisp/simple.el (completion-auto-select): Add new option. (completion-setup-function): Respect completion-auto-select. diff --git a/lisp/simple.el b/lisp/simple.el index 6d46fc19aa..62a9f264d6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9228,6 +9228,12 @@ Called from `temp-buffer-show-hook'." :version "22.1" :group 'completion) +(defcustom completion-auto-select t + "Non-nil means to automatically select the completions buffer." + :type 'boolean + :version "29.1" + :group 'completion) + ;; This function goes in completion-setup-hook, so that it is called ;; after the text of the completion list buffer is written. (defun completion-setup-function () @@ -9264,7 +9270,9 @@ Called from `temp-buffer-show-hook'." (insert "Click on a completion to select it.\n")) (insert (substitute-command-keys "In this buffer, type \\[choose-completion] to \ -select the completion near point.\n\n")))))) +select the completion near point.\n\n"))))) + (when completion-auto-select + (switch-to-completions))) (add-hook 'completion-setup-hook #'completion-setup-function) commit 678b29711b5c0a545f38d414c1ce2ddc92525f63 Author: Eli Zaretskii Date: Tue Dec 21 19:18:33 2021 +0200 ; * src/xdisp.c (display_string): Fix a typo in a comment. diff --git a/src/xdisp.c b/src/xdisp.c index 35675a6a36..f4dcb1838d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -27641,7 +27641,7 @@ display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_st face = FACE_FROM_ID (it->f, it->face_id); it->face_box_p = face->box != FACE_NO_BOX; - /* If we have a display spec, but there's no Lisp being + /* If we have a display spec, but there's no Lisp string being displayed, then check whether we've got one from the :propertize being passed in and use that. */ if (NILP (lisp_string)) commit 11c2ffddc9fe039fe2b729818922d35a6e8a0369 Author: Stefan Kangas Date: Tue Dec 21 18:04:33 2021 +0100 Declare functions to silence byte-compiler * lisp/auth-source.el (gnutls-symmetric-decrypt, gnutls-ciphers): * lisp/net/dbus.el (libxml-parse-xml-region): * lisp/simple.el (thread-name): * lisp/thread.el (thread-name, thread-signal, thread--blocker) (current-thread, thread-live-p, all-threads): * test/lisp/emacs-lisp/multisession-tests.el (sqlite-close): * test/lisp/net/gnutls-tests.el (gnutls-symmetric-decrypt) (gnutls-symmetric-encrypt, gnutls-hash-mac, gnutls-hash-digest) (gnutls-ciphers, gnutls-digests, gnutls-macs): * test/lisp/net/network-stream-tests.el (gnutls-peer-status): * test/lisp/net/shr-tests.el (libxml-parse-html-region): * test/src/decompress-tests.el (zlib-decompress-region): * test/src/process-tests.el (thread-last-error, thread-join) (make-thread): * test/src/xml-tests.el (libxml-parse-xml-region): Declare functions to silence byte-compiler in --without-all builds. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 3c1a6feaee..8c5b5564e7 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -45,6 +45,9 @@ (require 'cl-lib) (require 'eieio) +(declare-function gnutls-symmetric-decrypt "gnutls.c") +(declare-function gnutls-ciphers "gnutls.c") + (autoload 'secrets-create-item "secrets") (autoload 'secrets-delete-item "secrets") (autoload 'secrets-get-alias "secrets") diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 411249767f..9e5d652cf0 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -36,6 +36,7 @@ ;; Declare used subroutines and variables. (declare-function dbus-message-internal "dbusbind.c") (declare-function dbus--init-bus "dbusbind.c") +(declare-function libxml-parse-xml-region "xml.c") (defvar dbus-message-type-invalid) (defvar dbus-message-type-method-call) (defvar dbus-message-type-method-return) diff --git a/lisp/simple.el b/lisp/simple.el index b217aeb49c..6d46fc19aa 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4702,6 +4702,8 @@ File name handlers might not support pty association, if PROGRAM is nil." (forward-line -1) (beginning-of-line)))) +(declare-function thread-name "thread.c") + (defun list-processes--refresh () "Recompute the list of processes for the Process List buffer. Also, delete any process that is exited or signaled." diff --git a/lisp/thread.el b/lisp/thread.el index efb058c436..10b88dd93a 100644 --- a/lisp/thread.el +++ b/lisp/thread.el @@ -30,6 +30,13 @@ (eval-when-compile (require 'pcase)) (eval-when-compile (require 'subr-x)) +(declare-function thread-name "thread.c") +(declare-function thread-signal "thread.c") +(declare-function thread--blocker "thread.c") +(declare-function current-thread "thread.c") +(declare-function thread-live-p "thread.c") +(declare-function all-threads "thread.c") + ;;;###autoload (defun thread-handle-event (event) "Handle thread events, propagated by `thread-signal'. diff --git a/test/lisp/emacs-lisp/multisession-tests.el b/test/lisp/emacs-lisp/multisession-tests.el index 1bf0a533a7..f1dbbb29fd 100644 --- a/test/lisp/emacs-lisp/multisession-tests.el +++ b/test/lisp/emacs-lisp/multisession-tests.el @@ -26,6 +26,8 @@ (require 'ert-x) (require 'cl-lib) +(declare-function sqlite-close "sqlite.c") + (ert-deftest multi-test-sqlite-simple () (skip-unless (sqlite-available-p)) (ert-with-temp-file dir diff --git a/test/lisp/net/gnutls-tests.el b/test/lisp/net/gnutls-tests.el index 76c00b7eaa..f549ecd51d 100644 --- a/test/lisp/net/gnutls-tests.el +++ b/test/lisp/net/gnutls-tests.el @@ -30,6 +30,14 @@ (require 'gnutls) (require 'hex-util) +(declare-function gnutls-symmetric-decrypt "gnutls.c") +(declare-function gnutls-symmetric-encrypt "gnutls.c") +(declare-function gnutls-hash-mac "gnutls.c") +(declare-function gnutls-hash-digest "gnutls.c") +(declare-function gnutls-ciphers "gnutls.c") +(declare-function gnutls-digests "gnutls.c") +(declare-function gnutls-macs "gnutls.c") + (defvar gnutls-tests-message-prefix "") (defsubst gnutls-tests-message (format-string &rest args) diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el index 8f5bddb71f..1e1eacb983 100644 --- a/test/lisp/net/network-stream-tests.el +++ b/test/lisp/net/network-stream-tests.el @@ -32,6 +32,8 @@ ;; it pulls in nsm, which then makes the :nowait t' tests fail unless ;; we disable the nsm, which we do by binding 'network-security-level' +(declare-function gnutls-peer-status "gnutls.c") + (ert-deftest make-local-unix-server () (skip-unless (featurep 'make-network-process '(:family local))) (let* ((file (make-temp-name "/tmp/server-test")) diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el index bfb83f2518..846ec1a9db 100644 --- a/test/lisp/net/shr-tests.el +++ b/test/lisp/net/shr-tests.el @@ -27,6 +27,8 @@ (require 'ert-x) (require 'shr) +(declare-function libxml-parse-html-region "xml.c") + (defun shr-test (name) (with-temp-buffer (insert-file-contents (format (concat (ert-resource-directory) "/%s.html") name)) diff --git a/test/src/decompress-tests.el b/test/src/decompress-tests.el index 1d25cf2f66..708d91487e 100644 --- a/test/src/decompress-tests.el +++ b/test/src/decompress-tests.el @@ -23,6 +23,8 @@ (require 'ert) +(declare-function zlib-decompress-region "decompress.c") + (defvar zlib-tests-data-directory (expand-file-name "data/decompress" (getenv "EMACS_TEST_DIRECTORY")) "Directory containing zlib test data.") diff --git a/test/src/process-tests.el b/test/src/process-tests.el index f14a460d1a..baa825778a 100644 --- a/test/src/process-tests.el +++ b/test/src/process-tests.el @@ -31,6 +31,10 @@ (require 'dns) (require 'url-http) +(declare-function thread-last-error "thread.c") +(declare-function thread-join "thread.c") +(declare-function make-thread "thread.c") + ;; Timeout in seconds; the test fails if the timeout is reached. (defvar process-test-sentinel-wait-timeout 2.0) diff --git a/test/src/xml-tests.el b/test/src/xml-tests.el index 7c4ca396f7..62d9e3ff7e 100644 --- a/test/src/xml-tests.el +++ b/test/src/xml-tests.el @@ -27,6 +27,8 @@ (require 'ert) +(declare-function libxml-parse-xml-region "xml.c") + (defvar libxml-tests--data-comments-preserved `(;; simple case ("bar" commit 32a764e106cb6ffbf5f596478d8318e256db58d7 Author: Stefan Kangas Date: Tue Dec 21 18:01:23 2021 +0100 Fix some tests in --without-all builds * test/lisp/image-tests.el (image-type/from-filename): * test/src/image-tests.el (image-tests-init-image-library): * test/src/thread-tests.el (threads-test-bug33073): Fix tests in --without-all builds. diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el index 79b0014f60..47d321d5b5 100644 --- a/test/lisp/image-tests.el +++ b/test/lisp/image-tests.el @@ -82,7 +82,8 @@ (ert-deftest image-type/from-filename () ;; On emba, `image-types' and `image-load-path' do not exist. (skip-unless (and (bound-and-true-p image-types) - (bound-and-true-p image-load-path))) + (bound-and-true-p image-load-path) + (image-type-available-p 'jpeg))) (should (eq (image-type "foo.jpg") 'jpeg))) (defun image-tests--type-from-file-header (type) diff --git a/test/src/image-tests.el b/test/src/image-tests.el index 2b236086b6..e54d0df71f 100644 --- a/test/src/image-tests.el +++ b/test/src/image-tests.el @@ -239,7 +239,6 @@ (ert-deftest image-tests-init-image-library () (skip-unless (fboundp 'init-image-library)) (should (init-image-library 'pbm)) ; built-in - (should (init-image-library 'xpm)) ; built-in (should-not (init-image-library 'invalid-image-type))) ;;; image-tests.el ends here diff --git a/test/src/thread-tests.el b/test/src/thread-tests.el index 52eace7e9d..f1a8baedad 100644 --- a/test/src/thread-tests.el +++ b/test/src/thread-tests.el @@ -389,6 +389,7 @@ (should (equal (thread-last-error) '(error "Die, die, die!"))))) (ert-deftest threads-test-bug33073 () + (skip-unless (fboundp 'make-thread)) (let ((th (make-thread 'ignore))) (should-not (equal th main-thread)))) commit 1a923e5ac642a914e8c789f95733dda5d64c4f14 Author: Stefan Kangas Date: Tue Dec 21 15:56:33 2021 +0100 Silence additional byte-compiler warning in test * test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el: Silence byte-compiler. diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el index e881e46a2d..bc89f23b58 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el @@ -271,6 +271,7 @@ (defclass E (E-base1 E-base2) () :method-invocation-order :breadth-first) (with-suppressed-warnings ((obsolete defmethod) + (obsolete defgeneric) (obsolete next-method-p) (obsolete call-next-method)) (defmethod eitest-F ((_p E)) commit 73e862237d1db167d4f5712f95f68b8b17816ea9 Author: Michael Albinus Date: Tue Dec 21 15:15:16 2021 +0100 Add `permission-denied' error to Tramp * lisp/net/tramp-compat.el (tramp-permission-denied): New defconst. (tramp-compat-permission-denied): New defsubst. * lisp/net/tramp.el (tramp-handle-access-file): * lisp/net/tramp-archive.el (tramp-archive-handle-copy-file): Use it. diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index b44a4e86aa..bba94f2743 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -575,9 +575,8 @@ offered." preserve-uid-gid preserve-extended-attributes) "Like `copy-file' for file archives." (when (tramp-archive-file-name-p newname) - (tramp-error - (tramp-archive-dissect-file-name newname) 'file-error - "Permission denied: %s" newname)) + (tramp-compat-permission-denied + (tramp-archive-dissect-file-name newname) newname)) (copy-file (tramp-archive-gvfs-file-name filename) newname ok-if-already-exists keep-date preserve-uid-gid preserve-extended-attributes)) diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 627ff1edae..1936d2af1a 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -272,6 +272,17 @@ CONDITION can also be a list of error conditions." (car components)) (cdr components))))))) +;; `permission-denied' is introduced in Emacs 29.1. +(defconst tramp-permission-denied + (if (get 'permission-denied 'error-conditions) 'permission-denied 'file-error) + "The error symbol for the `permission-denied' error.") + +(defsubst tramp-compat-permission-denied (vec file) + "Emit the `permission-denied' error." + (if (get 'permission-denied 'error-conditions) + (tramp-error vec tramp-permission-denied file) + (tramp-error vec tramp-permission-denied "Permission denied: %s" file))) + (dolist (elt (all-completions "tramp-compat-" obarray 'functionp)) (put (intern elt) 'tramp-suppress-trace t)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 940e25e04f..7dc3dd79ba 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3363,8 +3363,8 @@ User is always nil." (if (file-directory-p filename) #'file-accessible-directory-p #'file-readable-p) filename) - (tramp-error - v 'file-error (format "%s: Permission denied, %s" string filename))) + (tramp-compat-permission-denied + v (format "%s: Permission denied, %s" string filename))) (tramp-error v 'file-missing (format "%s: No such file or directory, %s" string filename))))) commit 264589cdf762d015c8ecd102afb7eb61dc0ad65b Author: Po Lu Date: Tue Dec 21 19:25:26 2021 +0800 Fix xg_event_is_scrollbar for grab-related events on XI2 * src/gtkutil.c (xg_event_is_for_scrollbar): Don't return true if event coordinates are outside the frame on XInput 2. diff --git a/src/gtkutil.c b/src/gtkutil.c index 7370a795c0..0f1c110364 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -4805,7 +4805,13 @@ xg_event_is_for_scrollbar (struct frame *f, const EVENT *event) #else gwin = gdk_display_get_window_at_pointer (gdpy, NULL, NULL); #endif +#ifndef HAVE_XINPUT2 retval = gwin != gtk_widget_get_window (f->output_data.xp->edit_widget); +#else + retval = (gwin + && (gwin + != gtk_widget_get_window (f->output_data.xp->edit_widget))); +#endif #ifdef HAVE_XINPUT2 GtkWidget *grab = gtk_grab_get_current (); if (event->type == GenericEvent commit cf6dc1838af4b3d0604d0848e1ac0d4fbd9c3dbc Author: Stefan Kangas Date: Tue Dec 21 11:19:04 2021 +0100 ; Fix spelling; be consistent with "key binding" (Bug#52674) diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index ead0f699bb..90e7bdbf3e 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -474,8 +474,8 @@ insert a curved quote even when Electric Quote is disabled or inactive, you can type @kbd{C-x 8 [} for @t{‘}, @kbd{C-x 8 ]} for @t{’}, @kbd{C-x 8 @{} for @t{“}, and @kbd{C-x 8 @}} for @t{”}. @xref{Inserting Text}. Note that the value of -@code{electric-quote-chars} does not affect these keybindings, they -are not keybindings of @code{electric-quote-mode} but bound in +@code{electric-quote-chars} does not affect these key bindings, they +are not key bindings of @code{electric-quote-mode} but bound in @code{global-map}. @node Filling diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 27c754133f..8b833f412c 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -605,7 +605,7 @@ selects the window immediately to the right of the currently selected one, and similarly for the left, up, and down counterparts. @code{windmove-default-keybindings} binds these commands to @kbd{S-right} etc.; doing so disables shift selection for those keys -(@pxref{Shift Selection}). In the same way as keybindings can be +(@pxref{Shift Selection}). In the same way as key bindings can be defined for commands that select windows directionally, you can use @code{windmove-display-default-keybindings} to define keybindings for commands that specify in what direction to display the window for the @@ -613,7 +613,7 @@ buffer that the next command is going to display. Also there is @code{windmove-delete-default-keybindings} to define keybindings for commands that delete windows directionally, and @code{windmove-swap-states-default-keybindings} that defines -keybindings for commands that swap the window contents of the selected +key bindings for commands that swap the window contents of the selected window with the window in the specified direction. The command @kbd{M-x compare-windows} lets you compare the text diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 43f1c2ddd5..04269404e4 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -688,7 +688,7 @@ Your @file{.emacs} File * Text and Auto-fill:: Automatically wrap lines. * Mail Aliases:: Use abbreviations for email addresses. * Indent Tabs Mode:: Don't use tabs with @TeX{} -* Keybindings:: Create some personal keybindings. +* Key Bindings:: Create some personal key bindings. * Keymaps:: More about key binding. * Loading Files:: Load (i.e., evaluate) files automatically. * Autoload:: Make functions available. @@ -3358,7 +3358,7 @@ Both the examples just mentioned work identically to move point forward three sentences. (Since @code{multiply-by-seven} is not bound to a key, it could not be used as an example of key binding.) -(@xref{Keybindings, , Some Keybindings}, to learn how to bind a command +(@xref{Key Bindings, , Some Key Bindings}, to learn how to bind a command to a key.) A @dfn{prefix argument} is passed to an interactive function by typing the @@ -13662,7 +13662,7 @@ syntax table determines which characters these are." @end ifinfo @need 1000 -If you wish, you can also install this keybinding by evaluating it: +If you wish, you can also install this key binding by evaluating it: @smallexample (global-set-key "\C-c=" '@value{COUNT-WORDS}) @@ -14614,7 +14614,7 @@ almost the same code as for the recursive version of @need 800 @noindent -Let's re-use @kbd{C-c =} as a convenient keybinding: +Let's re-use @kbd{C-c =} as a convenient key binding: @smallexample (global-set-key "\C-c=" 'count-words-defun) @@ -14622,7 +14622,7 @@ Let's re-use @kbd{C-c =} as a convenient keybinding: Now we can try out @code{count-words-defun}: install both @code{count-words-in-defun} and @code{count-words-defun}, and set the -keybinding. Then copy the following to an Emacs Lisp buffer (like, +key binding. Then copy the following to an Emacs Lisp buffer (like, for instance, @file{*scratch*}), place the cursor within the definition, and use the @kbd{C-c =} command. @@ -15964,7 +15964,7 @@ placing point somewhere in the buffer, typing @kbd{M-:}, typing the and then typing @key{RET}. This causes Emacs to evaluate the expression in the minibuffer, but to use as the value of point the position of point in the @file{*scratch*} buffer. (@kbd{M-:} is the -keybinding for @code{eval-expression}. Also, @code{nil} does not +key binding for @code{eval-expression}. Also, @code{nil} does not appear in the @file{*scratch*} buffer since the expression is evaluated in the minibuffer.) @@ -16531,7 +16531,7 @@ expressions in Emacs Lisp you can change or extend Emacs. * Text and Auto-fill:: Automatically wrap lines. * Mail Aliases:: Use abbreviations for email addresses. * Indent Tabs Mode:: Don't use tabs with @TeX{} -* Keybindings:: Create some personal keybindings. +* Key Bindings:: Create some personal key bindings. * Keymaps:: More about key binding. * Loading Files:: Load (i.e., evaluate) files automatically. * Autoload:: Make functions available. @@ -17075,10 +17075,10 @@ Files'' in @cite{The GNU Emacs Manual}. @end iftex @need 1700 -@node Keybindings -@section Some Keybindings +@node Key Bindings +@section Some Key Bindings -Now for some personal keybindings: +Now for some personal key bindings: @smallexample @group @@ -17100,10 +17100,10 @@ This also shows how to set a key globally, for all modes. @cindex Key setting globally @findex global-set-key The command is @code{global-set-key}. It is followed by the -keybinding. In a @file{.emacs} file, the keybinding is written as +key binding. In a @file{.emacs} file, the keybinding is written as shown: @code{\C-c} stands for Control-C, which means to press the control key and the @kbd{c} key at the same time. The @code{w} means -to press the @kbd{w} key. The keybinding is surrounded by double +to press the @kbd{w} key. The key binding is surrounded by double quotation marks. In documentation, you would write this as @w{@kbd{C-c w}}. (If you were binding a @key{META} key, such as @kbd{M-c}, rather than a @key{CTRL} key, you would write @@ -17117,26 +17117,26 @@ would first try to evaluate the symbol to determine its value. These three things, the double quotation marks, the backslash before the @samp{C}, and the single-quote are necessary parts of -keybinding that I tend to forget. Fortunately, I have come to +key binding that I tend to forget. Fortunately, I have come to remember that I should look at my existing @file{.emacs} file, and adapt what is there. -As for the keybinding itself: @kbd{C-c w}. This combines the prefix +As for the key binding itself: @kbd{C-c w}. This combines the prefix key, @kbd{C-c}, with a single character, in this case, @kbd{w}. This set of keys, @kbd{C-c} followed by a single character, is strictly reserved for individuals' own use. (I call these @dfn{own} keys, since these are for my own use.) You should always be able to create such a -keybinding for your own use without stomping on someone else's -keybinding. If you ever write an extension to Emacs, please avoid +key binding for your own use without stomping on someone else's +key binding. If you ever write an extension to Emacs, please avoid taking any of these keys for public use. Create a key like @kbd{C-c C-w} instead. Otherwise, we will run out of own keys. @need 1250 -Here is another keybinding, with a comment: +Here is another key binding, with a comment: @smallexample @group -;;; Keybinding for 'occur' +;;; Key binding for 'occur' ; I use occur a lot, so let's bind it to a key: (global-set-key "\C-co" 'occur) @end group @@ -17196,8 +17196,8 @@ but moves point into that window. @cindex Rebinding keys Emacs uses @dfn{keymaps} to record which keys call which commands. -When you use @code{global-set-key} to set the keybinding for a single -command in all parts of Emacs, you are specifying the keybinding in +When you use @code{global-set-key} to set the key binding for a single +command in all parts of Emacs, you are specifying the key binding in @code{current-global-map}. Specific modes, such as C mode or Text mode, have their own keymaps; @@ -17452,7 +17452,7 @@ Here is the definition: @end smallexample @need 1250 -Now for the keybinding. +Now for the key binding. Function keys as well as mouse button events and non-@sc{ascii} characters are written within square brackets, without quotation @@ -17757,7 +17757,7 @@ Some systems bind keys unpleasantly. Sometimes, for example, the @key{CTRL} key appears in an awkward spot rather than at the far left of the home row. -Usually, when people fix these sorts of keybindings, they do not +Usually, when people fix these sorts of key bindings, they do not change their @file{~/.emacs} file. Instead, they bind the proper keys on their consoles with the @code{loadkeys} or @code{install-keymap} commands in their boot script and then include @code{xmodmap} commands diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index edf1d6e83f..adde65e970 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -706,7 +706,7 @@ active keymaps, except for the global keymap. Secondly, the terminal-local variable @code{overriding-terminal-local-map} specifies a keymap that takes precedence over @emph{all} other keymaps (including @code{overriding-local-map}); this is normally used for -modal/transient keybindings (the function @code{set-transient-map} +modal/transient key bindings (the function @code{set-transient-map} provides a convenient interface for this). @xref{Controlling Active Maps}, for details. @@ -1969,7 +1969,7 @@ redefines @kbd{C-x C-\} to move down a line. redefines the first (leftmost) mouse button, entered with the Meta key, to set point where you click. -@cindex non-@acronym{ASCII} text in keybindings +@cindex non-@acronym{ASCII} text in key bindings Be careful when using non-@acronym{ASCII} text characters in Lisp specifications of keys to bind. If these are read as multibyte text, as they usually will be in a Lisp file (@pxref{Loading Non-ASCII}), you diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index ee119445e5..e4cd940ab2 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -482,7 +482,7 @@ automatically. However, if this does make a difference, you can force a particular Lisp file to be interpreted as unibyte by writing @samp{coding: raw-text} in a local variables section. With that designator, the file will unconditionally be interpreted as -unibyte. This can matter when making keybindings to +unibyte. This can matter when making key bindings to non-@acronym{ASCII} characters written as @code{?v@var{literal}}. @node Autoload diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 296ce20169..63b02a3292 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -2854,7 +2854,7 @@ Display some help, then ask again. @defvar multi-query-replace-map This variable holds a keymap that extends @code{query-replace-map} by -providing additional keybindings that are useful in multi-buffer +providing additional key bindings that are useful in multi-buffer replacements. The additional bindings are: @table @code diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi index 5e9c3d7eef..1d8235a348 100644 --- a/doc/misc/ede.texi +++ b/doc/misc/ede.texi @@ -99,7 +99,7 @@ learn and adopt GNU ways of doing things. @chapter @ede{} Project Concepts @ede{} is a generic interface for managing projects. It specifies a -single set of menus and keybindings, while supporting multiple ways to +single set of menus and key bindings, while supporting multiple ways to express a project via a build system. In the subsequent chapters, we will describe the different project @@ -144,7 +144,7 @@ init file: Activating @ede{} adds a menu named @samp{Development} to the menu bar. This menu provides several menu items for high-level @ede{} -commands. These menu items, and their corresponding keybindings, are +commands. These menu items, and their corresponding key bindings, are independent of the type of project you are actually working on. @node Quick Start @@ -271,7 +271,7 @@ Projects. You can create targets either from a buffer, or from a @code{dired} directory buffer. Note: If for some reason a directory list buffer, or file does not have the -@samp{Project} menu item, or if @ede{} keybindings don't work, just +@samp{Project} menu item, or if @ede{} key bindings don't work, just use @kbd{M-x revert-buffer @key{RET}} to force a refresh. Sometimes creating a new project doesn't restart buffers correctly. @@ -1059,7 +1059,7 @@ examples. @menu * Development Overview:: * Detecting a Project:: -* User interface methods:: Methods associated with keybindings +* User interface methods:: Methods associated with key bindings * Base project methods:: The most basic methods on @ede{} objects. * Sourcecode objects:: Defining new sourcecode classes. * Compiler and Linker objects:: Defining new compilers and linkers. diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi index a5b5251d6e..1a4c43f022 100644 --- a/doc/misc/efaq-w32.texi +++ b/doc/misc/efaq-w32.texi @@ -687,9 +687,9 @@ question also. @node CUA @subsection Standard Windows key bindings @findex cua-mode -@cindex CUA keybindings +@cindex CUA key bindings @cindex shift key, selecting with -@cindex standard Windows keybindings +@cindex standard Windows key bindings @cindex paste with C-v @cindex cut with C-x @cindex copy with C-c @@ -697,7 +697,7 @@ question also. @cindex C-x to cut @cindex C-v to paste -The keybindings of Emacs predate modern GUIs, and the keys that were +The key bindings of Emacs predate modern GUIs, and the keys that were chosen by later GUIs for cut and copy were given important functions as extended keymaps in Emacs. CUA mode attempts to let both bindings co-exist by defining C-x and C-c as @code{kill-region} and diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 74b5fb442e..49b6ab515f 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -4499,7 +4499,7 @@ command or better use it as a prefix key. For example: (gnus-group-jump-to-group "nndraft:drafts"))) @end lisp -On keys reserved for users in Emacs and on keybindings in general +On keys reserved for users in Emacs and on key bindings in general @xref{Keymaps, Keymaps, , emacs, The Emacs Editor}. @item ^ @@ -13477,7 +13477,7 @@ Also @pxref{Formatting Variables}. @subsection Server Commands @cindex server commands -The following keybinding are available in the server buffer. Be aware +The following key binding are available in the server buffer. Be aware that some of the commands will only work on servers that you've added through this interface (with @kbd{a}), not with servers you've defined in your init files. diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 3cd53c71da..0e35f20a77 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -2670,7 +2670,7 @@ As a special case, any error message in the output will be displayed @node Debugging IDL Programs @section Debugging IDL Programs @cindex Debugging -@cindex Keybindings for debugging +@cindex Key bindings for debugging @cindex Toolbar Programs can be compiled, run, and debugged directly from the source diff --git a/doc/misc/ido.texi b/doc/misc/ido.texi index 1c960940a0..d71ebad4bc 100644 --- a/doc/misc/ido.texi +++ b/doc/misc/ido.texi @@ -476,13 +476,13 @@ M-x customize-variable @key{RET} ido-xxxxx @key{RET} @end example @vindex ido-setup-hook -To modify the keybindings, use the @code{ido-setup-hook}. For example: +To modify the key bindings, use the @code{ido-setup-hook}. For example: @example (add-hook 'ido-setup-hook 'ido-my-keys) (defun ido-my-keys () - "Add my keybindings for Ido." + "Add my key bindings for Ido." (define-key ido-completion-map " " 'ido-next-match)) @end example diff --git a/doc/misc/octave-mode.texi b/doc/misc/octave-mode.texi index e330606015..d6b669a292 100644 --- a/doc/misc/octave-mode.texi +++ b/doc/misc/octave-mode.texi @@ -240,7 +240,7 @@ entering Octave commands at the prompt. The buffer is in Inferior Octave mode, which is derived from the standard Comint mode, a major mode for interacting with an inferior interpreter. See the documentation for @code{comint-mode} for more details, and use -@kbd{C-h b} to find out about available special keybindings. +@kbd{C-h b} to find out about available special key bindings. You can also communicate with an inferior Octave process from within files with Octave code (i.e., buffers in Octave mode), using the diff --git a/doc/misc/remember.texi b/doc/misc/remember.texi index 91e67a8798..1ba80eedfc 100644 --- a/doc/misc/remember.texi +++ b/doc/misc/remember.texi @@ -313,7 +313,7 @@ Save (if it is modified) and bury the current buffer. @node Keystrokes @chapter Keystroke Reference -@file{remember.el} defines the following keybindings by default: +@file{remember.el} defines the following key bindings by default: @table @kbd diff --git a/doc/misc/sem-user.texi b/doc/misc/sem-user.texi index 70a19484e8..22df24c98c 100644 --- a/doc/misc/sem-user.texi +++ b/doc/misc/sem-user.texi @@ -145,7 +145,7 @@ this means moving to the parent of the current tag. @item C-c , @key{SPC} Display a list of possible completions for the symbol at point (@code{semantic-complete-analyze-inline}). This also activates a -special set of keybindings for choosing a completion: @key{RET} +special set of key bindings for choosing a completion: @key{RET} accepts the current completion, @kbd{M-n} and @kbd{M-p} cycle through possible completions, @key{TAB} completes as far as possible and then cycles, and @kbd{C-g} or any other key aborts the completion. @@ -655,7 +655,7 @@ usual summary if the text at point has one of these faces. Semantic Idle Completions mode is a minor mode for performing @dfn{code completions} during idle time. The completions are -displayed inline, with keybindings that allow you to cycle through +displayed inline, with key bindings that allow you to cycle through different alternatives. Semantic Idle Completions mode performs completion based on the @@ -681,7 +681,7 @@ besselj [1 of 6 matches] @end example @noindent -While the completion is being displayed, the following keybindings +While the completion is being displayed, the following key bindings take effect: @table @kbd @@ -785,7 +785,7 @@ Most of the other commands documented in this section call This command is bound to @kbd{C-c , @key{SPC}} when Semantic mode is enabled (@pxref{Semantic mode user commands}). It displays a list of possible completions for the symbol at point, and activates a special -set of keybindings for choosing a completion. +set of key bindings for choosing a completion. You can type @key{RET} to accept the current completion, @kbd{M-n} and @kbd{M-p} to cycle through the possible completions, @key{TAB} to @@ -1122,7 +1122,7 @@ that @code{grep} is much slower than the others. The commands to display symbol references are @kbd{C-c , g} (@code{semantic-symref-symbol} and @kbd{C-c , G} -(@code{semantic-symref}). These keybindings are available whenever +(@code{semantic-symref}). These key bindings are available whenever Semantic mode is enabled (@pxref{Semantic mode user commands}). @deffn Command semantic-symref-symbol sym diff --git a/doc/misc/speedbar.texi b/doc/misc/speedbar.texi index 70d4b05416..1d1c65c778 100644 --- a/doc/misc/speedbar.texi +++ b/doc/misc/speedbar.texi @@ -1218,4 +1218,3 @@ Two good values are @code{nil} and @code{statictag}. @bye @c LocalWords: speedbar's xref slowbar kbd subsubsection -@c LocalWords: keybindings diff --git a/doc/misc/srecode.texi b/doc/misc/srecode.texi index 1f7473c151..16a348e0f8 100644 --- a/doc/misc/srecode.texi +++ b/doc/misc/srecode.texi @@ -293,14 +293,14 @@ If the variable @code{srecode-takeover-INS-key} is set, then the key The most important key is bound to @code{srecode-insert} which is @kbd{C-c / /}, or @kbd{@key{INSERT} @key{INSERT}}. @ref{Quick Start}. -Major keybindings are: +Major key bindings are: @table @kbd @item C-c / / Insert a template whose name is typed into the minibuffer. @item C-c / Reserved for direct binding of simple templates to keys using a -keybinding command in the template file. +key binding command in the template file. @item C-c / Reserved for template applications (Such as comment or get/set inserter.) @item C-c / E diff --git a/doc/misc/vhdl-mode.texi b/doc/misc/vhdl-mode.texi index 7022582db5..baa27179f8 100644 --- a/doc/misc/vhdl-mode.texi +++ b/doc/misc/vhdl-mode.texi @@ -928,7 +928,7 @@ If you want to customize indentation, here you go: (setq tab-width 8 ;; this will make sure spaces are used instead of tabs indent-tabs-mode nil) - ;; keybindings for VHDL are put in vhdl-mode-map + ;; key bindings for VHDL are put in vhdl-mode-map (define-key vhdl-mode-map "\C-m" 'newline-and-indent) ) commit e56dd354c751ee67d0012a0209b769246207d74c Author: Mattias Engdegård Date: Tue Dec 21 10:51:58 2021 +0100 Don't produce multibyte strings by accident in sasl-scram-rfc * lisp/net/sasl-scram-rfc.el (sasl-scram--client-final-message): The XOR of two unibyte strings should be a unibyte string. This code previously worked by accident because of an overly tolerant base64 encoder (bug#52670), but now causes a test failure. diff --git a/lisp/net/sasl-scram-rfc.el b/lisp/net/sasl-scram-rfc.el index 91d76663ef..c079369199 100644 --- a/lisp/net/sasl-scram-rfc.el +++ b/lisp/net/sasl-scram-rfc.el @@ -90,6 +90,8 @@ (sasl-mechanism-name (sasl-client-mechanism client)) (sasl-client-name client)))) (salt (base64-decode-string salt-base64)) + (string-xor (lambda (a b) + (apply #'unibyte-string (cl-mapcar #'logxor a b)))) (salted-password ;; Hi(str, salt, i): (let ((digest (concat salt (string 0 0 0 1))) @@ -98,7 +100,7 @@ (setq digest (funcall hmac-fun digest password)) (setq xored (if (null xored) digest - (cl-map 'string 'logxor xored digest)))))) + (funcall string-xor xored digest)))))) (client-key (funcall hmac-fun "Client Key" salted-password)) (stored-key (decode-hex-string (funcall hash-fun client-key))) @@ -108,7 +110,7 @@ step-data "," client-final-message-without-proof)) (client-signature (funcall hmac-fun (encode-coding-string auth-message 'utf-8) stored-key)) - (client-proof (cl-map 'string 'logxor client-key client-signature)) + (client-proof (funcall string-xor client-key client-signature)) (client-final-message (concat client-final-message-without-proof "," "p=" (base64-encode-string client-proof))))