commit 3a855c5dac1b5cc42ee57cebed0323d591b54c68 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Tue Dec 28 15:30:31 2021 +0800 Document a problem with IBus and the C-. key * etc/PROBLEMS: Document an IBus emoji panel problem. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 07ae98885d..69ab6ccb74 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1236,6 +1236,15 @@ A workaround is to not use 'klipper'/'clipit'. Upgrading 'klipper' to the one coming with KDE 3.3 or later might solve the problem; if it doesn't, set 'select-active-regions' to 'only' or nil. +*** Emacs doesn't receive the key "C-.", displaying an input field instead. + +This is caused by the IBus Emoji input panel, which is usually bound +to "C-.". You can disable that panel by running the following +command: + + $ gsettings set org.freedesktop.ibus.panel.emoji hotkey "[]" + + ** Window-manager and toolkit-related problems *** Emacs built with GTK+ toolkit produces corrupted display on HiDPI screen commit 208ae993bac6f011f178befbeeb8104c0f63499f Author: Po Lu Date: Tue Dec 28 14:05:32 2021 +0800 Add support for pinch events to NS * lisp/face-remap.el (text-scale-pinch): Remove mistaken assumption that angle is always 1.0 at the beginning of a sequence. * src/nsterm.c (- magnifyWithEvent): New function. diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 67123ac7f8..3440f4c941 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -417,8 +417,7 @@ a top-level keymap, `text-scale-increase' or (with-selected-window window (when (and (zerop dx) (zerop dy) - (zerop angle) - (equal scale 1.0)) + (zerop angle)) (setq text-scale--pinch-start-scale (if text-scale-mode text-scale-mode-amount 0))) (text-scale-set diff --git a/src/nsterm.m b/src/nsterm.m index 591e28f20b..f79e271a98 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6821,6 +6821,42 @@ - (void)otherMouseDragged: (NSEvent *)e [self mouseMoved: e]; } +#ifdef NS_IMPL_COCOA +- (void) magnifyWithEvent: (NSEvent *) event +{ + NSPoint pt = [self convertPoint: [event locationInWindow] fromView: nil]; + static CGFloat last_scale; + + NSTRACE ("[EmacsView magnifyWithEvent]"); + if (emacs_event) + { + emacs_event->kind = PINCH_EVENT; + emacs_event->modifiers = EV_MODIFIERS (event); + XSETINT (emacs_event->x, lrint (pt.x)); + XSETINT (emacs_event->y, lrint (pt.y)); + XSETFRAME (emacs_event->frame_or_window, emacsframe); + + if ([event phase] == NSEventPhaseBegan) + { + last_scale = 1.0 + [event magnification]; + emacs_event->arg = list4 (make_float (0.0), + make_float (0.0), + make_float (last_scale), + make_float (0.0)); + } + else + /* Report a tiny change so that Lisp code doesn't think this + is the beginning of an event sequence. This is the best we + can do because NS doesn't report pinch events in as much + detail as XInput 2 or GTK+ do. */ + emacs_event->arg = list4 (make_float (0.01), + make_float (0.0), + make_float (last_scale += [event magnification]), + make_float (0.0)); + EV_TRAILER (event); + } +} +#endif - (BOOL)windowShouldClose: (id)sender { commit 036e88ce2f35b805f37e5f3b4948c7d8e7355b2c Merge: b6b2f797d9 c0815aca18 Author: Stefan Kangas Date: Tue Dec 28 06:30:38 2021 +0100 Merge from origin/emacs-28 c0815aca18 Fix typos in in 'reset-language-environment' ea65de7577 eshell-complete-parse-arguments: don't use string-match on... commit b6b2f797d9df3e5562b946d5f4c690f8967c1b88 Author: Po Lu Date: Tue Dec 28 10:46:58 2021 +0800 Fix menu placement on multiple-display setups when using lwlib * lwlib/xlwmenu.c (fit_to_screen): (pop_up_menu): Adjust menu position based on dimensions of the current monitor's workarea. (bug#52809) * src/xfns.c (x_get_monitor_attributes): Stop testing for the RandR extension here. (xlw_monitor_dimensions_at_pos_1): (xlw_monitor_dimensions_at_pos): New functions. * src/xterm.c (x_term_init): Query for the RandR extension when connecting to a display. * src/xterm.h (xlw_monitor_dimensions_at_pos): New prototype. diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index a0a10d13db..a065c53310 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -1390,27 +1390,40 @@ fit_to_screen (XlwMenuWidget mw, window_state *previous_ws, Boolean horizontal_p) { - unsigned int screen_width = WidthOfScreen (XtScreen (mw)); - unsigned int screen_height = HeightOfScreen (XtScreen (mw)); + int screen_width, screen_height; + int screen_x, screen_y; + +#ifdef emacs + xlw_monitor_dimensions_at_pos (XtDisplay (mw), XtScreen (mw), + ws->x, ws->y, &screen_x, &screen_y, + &screen_width, &screen_height); +#else + screen_width = WidthOfScreen (XtScreen (mw)); + screen_height = HeightOfScreen (XtScreen (mw)); + screen_x = 0; + screen_y = 0; +#endif /* 1 if we are unable to avoid an overlap between this menu and the parent menu in the X dimension. */ int horizontal_overlap = 0; - if (ws->x < 0) + if (ws->x < screen_x) ws->x = 0; - else if (ws->x + ws->width > screen_width) + else if (ws->x + ws->width > screen_x + screen_width) { if (!horizontal_p) /* The addition of shadow-thickness for a sub-menu's position is to reflect a similar adjustment when the menu is displayed to the right of the invoking menu-item; it makes the sub-menu look more `attached' to the menu-item. */ - ws->x = previous_ws->x - ws->width + mw->menu.shadow_thickness; + ws->x = screen_x + (previous_ws->x + - ws->width + + mw->menu.shadow_thickness); else - ws->x = screen_width - ws->width; - if (ws->x < 0) + ws->x = screen_x + (screen_width - ws->width); + if (ws->x < screen_x) { - ws->x = 0; + ws->x = screen_x; horizontal_overlap = 1; } } @@ -1427,16 +1440,16 @@ fit_to_screen (XlwMenuWidget mw, ws->y = previous_ws->y - ws->height; } - if (ws->y < 0) - ws->y = 0; - else if (ws->y + ws->height > screen_height) + if (ws->y < screen_y) + ws->y = screen_y; + else if (ws->y + ws->height > screen_y + screen_height) { if (horizontal_p) - ws->y = previous_ws->y - ws->height; + ws->y = screen_y + (previous_ws->y - ws->height); else - ws->y = screen_height - ws->height; - if (ws->y < 0) - ws->y = 0; + ws->y = screen_y + (screen_height - ws->height); + if (ws->y < screen_y) + ws->y = screen_y; } } @@ -2626,7 +2639,21 @@ pop_up_menu (XlwMenuWidget mw, XButtonPressedEvent *event) int borderwidth = mw->menu.shadow_thickness; Screen* screen = XtScreen (mw); Display *display = XtDisplay (mw); + int screen_x; + int screen_y; + int screen_w; + int screen_h; +#ifdef emacs + xlw_monitor_dimensions_at_pos (display, screen, x, y, + &screen_x, &screen_y, + &screen_w, &screen_h); +#else + screen_x = 0; + screen_y = 0; + screen_w = WidthOfScreen (screen); + screen_h = HeightOfScreen (screen); +#endif next_release_must_exit = 0; mw->menu.inside_entry = NULL; @@ -2640,14 +2667,14 @@ pop_up_menu (XlwMenuWidget mw, XButtonPressedEvent *event) x -= borderwidth; y -= borderwidth; - if (x < borderwidth) - x = borderwidth; - if (x + w + 2 * borderwidth > WidthOfScreen (screen)) - x = WidthOfScreen (screen) - w - 2 * borderwidth; - if (y < borderwidth) - y = borderwidth; - if (y + h + 2 * borderwidth> HeightOfScreen (screen)) - y = HeightOfScreen (screen) - h - 2 * borderwidth; + if (x < screen_x + borderwidth) + x = screen_x + borderwidth; + if (x + w + 2 * borderwidth > screen_x + screen_w) + x = (screen_x + screen_w) - w - 2 * borderwidth; + if (y < screen_y + borderwidth) + y = screen_y + borderwidth; + if (y + h + 2 * borderwidth > screen_y + screen_h) + y = (screen_y + screen_h) - h - 2 * borderwidth; mw->menu.popped_up = True; if (XtIsShell (XtParent ((Widget)mw))) diff --git a/src/xfns.c b/src/xfns.c index ad77ebc8f4..8dc383ddfa 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5041,17 +5041,9 @@ x_get_monitor_attributes (struct x_display_info *dpyinfo) (void) dpy; /* Suppress unused variable warning. */ #ifdef HAVE_XRANDR - int xrr_event_base, xrr_error_base; - bool xrr_ok = false; - xrr_ok = XRRQueryExtension (dpy, &xrr_event_base, &xrr_error_base); - if (xrr_ok) - { - XRRQueryVersion (dpy, &dpyinfo->xrandr_major_version, - &dpyinfo->xrandr_minor_version); - xrr_ok = ((dpyinfo->xrandr_major_version == 1 - && dpyinfo->xrandr_minor_version >= 2) - || dpyinfo->xrandr_major_version > 1); - } + bool xrr_ok = ((dpyinfo->xrandr_major_version == 1 + && dpyinfo->xrandr_minor_version >= 2) + || dpyinfo->xrandr_major_version > 1); if (xrr_ok) attributes_list = x_get_monitor_attributes_xrandr (dpyinfo); @@ -5076,6 +5068,129 @@ x_get_monitor_attributes (struct x_display_info *dpyinfo) #endif /* !USE_GTK */ +#ifdef USE_LUCID +/* This is used by the Lucid menu widget, but it's defined here so we + can make use of a great deal of existing code. */ +static void +xlw_monitor_dimensions_at_pos_1 (struct x_display_info *dpyinfo, + Screen *screen, int src_x, int src_y, + int *x, int *y, int *width, int *height) +{ + Lisp_Object attrs, tem, val; +#ifdef HAVE_XRANDR +#if RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 5) + int num_rr_monitors; + XRRMonitorInfo *rr_monitors; + + /* If RandR 1.5 or later is available, use that instead, as some + video drivers don't report correct dimensions via other versions + of RandR. */ + if (dpyinfo->xrandr_major_version > 1 + || (dpyinfo->xrandr_major_version == 1 + && dpyinfo->xrandr_minor_version >= 5)) + { + rr_monitors = XRRGetMonitors (dpyinfo->display, + RootWindowOfScreen (screen), + True, &num_rr_monitors); + if (!rr_monitors) + goto fallback; + + for (int i = 0; i < num_rr_monitors; ++i) + { + if (rr_monitors[i].x <= src_x + && src_x < (rr_monitors[i].x + + rr_monitors[i].width) + && rr_monitors[i].y <= src_y + && src_y < (rr_monitors[i].y + + rr_monitors[i].height)) + { + *x = rr_monitors[i].x; + *y = rr_monitors[i].y; + *width = rr_monitors[i].width; + *height = rr_monitors[i].height; + + XRRFreeMonitors (rr_monitors); + return; + } + } + XRRFreeMonitors (rr_monitors); + } + + fallback: +#endif +#endif + + attrs = x_get_monitor_attributes (dpyinfo); + + for (tem = attrs; CONSP (tem); tem = XCDR (tem)) + { + int sx, sy, swidth, sheight; + val = assq_no_quit (Qgeometry, XCAR (tem)); + if (!NILP (val)) + { + sx = XFIXNUM (XCAR (XCDR (val))); + sy = XFIXNUM (XCAR (XCDR (XCDR (val)))); + swidth = XFIXNUM (XCAR (XCDR (XCDR (XCDR (val))))); + sheight = XFIXNUM (XCAR (XCDR (XCDR (XCDR (XCDR (val)))))); + + if (sx <= src_x && src_x < (sx + swidth) + && sy <= src_y && src_y < (sy + swidth)) + { + *x = sx; + *y = sy; + *width = swidth; + *height = sheight; + return; + } + } + } + + *x = 0; + *y = 0; + *width = WidthOfScreen (screen); + *height = HeightOfScreen (screen); +} + +void +xlw_monitor_dimensions_at_pos (Display *dpy, Screen *screen, int src_x, + int src_y, int *x, int *y, int *width, int *height) +{ + struct x_display_info *dpyinfo = x_display_info_for_display (dpy); + XRectangle rect, workarea, intersection; + int dim_x, dim_y, dim_w, dim_h; + + if (!dpyinfo) + emacs_abort (); + + block_input (); + xlw_monitor_dimensions_at_pos_1 (dpyinfo, screen, src_x, src_y, + &dim_x, &dim_y, &dim_w, &dim_h); + rect.x = dim_x; + rect.y = dim_y; + rect.width = dim_w; + rect.height = dim_h; + + if (!x_get_net_workarea (dpyinfo, &workarea)) + memset (&workarea, 0, sizeof workarea); + unblock_input (); + + if (!gui_intersect_rectangles (&rect, &workarea, &intersection)) + { + *x = 0; + *y = 0; + *width = 0; + *height = 0; + return; + } + + *x = intersection.x; + *y = intersection.y; + *width = intersection.width; + *height = intersection.height; +} +#endif + + DEFUN ("x-display-monitor-attributes-list", Fx_display_monitor_attributes_list, Sx_display_monitor_attributes_list, 0, 1, 0, diff --git a/src/xterm.c b/src/xterm.c index 698c1eba8b..3fdf214c3d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -46,6 +46,10 @@ along with GNU Emacs. If not, see . */ #include #endif +#ifdef HAVE_XRANDR +#include +#endif + /* Load sys/types.h if not already loaded. In some systems loading it twice is suicidal. */ #ifndef makedev @@ -14803,6 +14807,17 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) dpyinfo->xi2_version = minor; #endif +#ifdef HAVE_XRANDR + int xrr_event_base, xrr_error_base; + bool xrr_ok = false; + xrr_ok = XRRQueryExtension (dpy, &xrr_event_base, &xrr_error_base); + if (xrr_ok) + { + XRRQueryVersion (dpy, &dpyinfo->xrandr_major_version, + &dpyinfo->xrandr_minor_version); + } +#endif + #ifdef HAVE_XKB dpyinfo->xkb_desc = XkbGetMap (dpyinfo->display, XkbAllComponentsMask, diff --git a/src/xterm.h b/src/xterm.h index d9ace002d5..5615a55d6b 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1240,6 +1240,10 @@ extern void x_change_tool_bar_height (struct frame *, int); extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); extern void x_set_scroll_bar_default_width (struct frame *); extern void x_set_scroll_bar_default_height (struct frame *); +#ifdef USE_LUCID +extern void xlw_monitor_dimensions_at_pos (Display *, Screen *, int, int, + int *, int *, int *, int *); +#endif /* Defined in xselect.c. */ commit 1a724cc2d2e7f08b9fcad569c8cacf126ad55791 Author: Stefan Monnier Date: Mon Dec 27 19:47:23 2021 -0500 Replace uniquify.el's advice with direct calls This fixes bug#1338. * src/buffer.c (Frename_buffer): Call `uniquify--rename-buffer-advice`. * lisp/files.el (create-file-buffer): Call`uniquify--create-file-buffer-advice`. * lisp/uniquify.el (uniquify--rename-buffer-advice) (uniquify--create-file-buffer-advice): Don't add them as advice any more. Adjust their calling convention accordingly. diff --git a/lisp/files.el b/lisp/files.el index 9ed63a60f8..81e91567d0 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2010,12 +2010,14 @@ otherwise a string <2> or <3> or ... is appended to get an unused name. Emacs treats buffers whose names begin with a space as internal buffers. To avoid confusion when visiting a file whose name begins with a space, this function prepends a \"|\" to the final result if necessary." - (let ((lastname (file-name-nondirectory filename))) - (if (string= lastname "") - (setq lastname filename)) - (generate-new-buffer (if (string-prefix-p " " lastname) - (concat "|" lastname) - lastname)))) + (let* ((lastname (file-name-nondirectory filename)) + (lastname (if (string= lastname "") + filename lastname)) + (buf (generate-new-buffer (if (string-prefix-p " " lastname) + (concat "|" lastname) + lastname)))) + (uniquify--create-file-buffer-advice buf filename) + buf)) (defcustom automount-dir-prefix (purecopy "^/tmp_mnt/") "Regexp to match the automounter prefix in a directory name." diff --git a/lisp/uniquify.el b/lisp/uniquify.el index ffb5ecc902..b9a4c3c683 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -476,34 +476,32 @@ For use on `kill-buffer-hook'." ;; rename-buffer and create-file-buffer. (Setting find-file-hook isn't ;; sufficient.) -(advice-add 'rename-buffer :around #'uniquify--rename-buffer-advice) -(defun uniquify--rename-buffer-advice (rb-fun newname &optional unique &rest args) +;; (advice-add 'rename-buffer :around #'uniquify--rename-buffer-advice) +(defun uniquify--rename-buffer-advice (newname &optional unique) + ;; BEWARE: This is called directly from `buffer.c'! "Uniquify buffer names with parts of directory name." - (let ((retval (apply rb-fun newname unique args))) (uniquify-maybe-rerationalize-w/o-cb) - (if (null unique) + (if (null unique) ;; Mark this buffer so it won't be renamed by uniquify. (setq uniquify-managed nil) (when uniquify-buffer-name-style ;; Rerationalize w.r.t the new name. (uniquify-rationalize-file-buffer-names - newname + newname (uniquify-buffer-file-name (current-buffer)) - (current-buffer)) - (setq retval (buffer-name (current-buffer))))) - retval)) + (current-buffer))))) -(advice-add 'create-file-buffer :around #'uniquify--create-file-buffer-advice) -(defun uniquify--create-file-buffer-advice (cfb-fun filename &rest args) +;; (advice-add 'create-file-buffer :around #'uniquify--create-file-buffer-advice) +(defun uniquify--create-file-buffer-advice (buf filename) + ;; BEWARE: This is called directly from `files.el'! "Uniquify buffer names with parts of directory name." - (let ((retval (apply cfb-fun filename args))) - (if uniquify-buffer-name-style - (let ((filename (expand-file-name (directory-file-name filename)))) - (uniquify-rationalize-file-buffer-names - (file-name-nondirectory filename) - (file-name-directory filename) retval))) - retval)) + (when uniquify-buffer-name-style + (let ((filename (expand-file-name (directory-file-name filename)))) + (uniquify-rationalize-file-buffer-names + (file-name-nondirectory filename) + (file-name-directory filename) + buf)))) (defun uniquify-unload-function () "Unload the uniquify library." @@ -513,8 +511,6 @@ For use on `kill-buffer-hook'." (set-buffer buf) (when uniquify-managed (push (cons buf (uniquify-item-base (car uniquify-managed))) buffers))) - (advice-remove 'rename-buffer #'uniquify--rename-buffer-advice) - (advice-remove 'create-file-buffer #'uniquify--create-file-buffer-advice) (dolist (buf buffers) (set-buffer (car buf)) (rename-buffer (cdr buf) t)))) diff --git a/src/buffer.c b/src/buffer.c index 9d8892a797..a2fd0a83bc 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1552,7 +1552,7 @@ This does not change the name of the visited file (if any). */) /* Catch redisplay's attention. Unless we do this, the mode lines for any windows displaying current_buffer will stay unchanged. */ - update_mode_lines = 11; + bset_update_mode_line (current_buffer); XSETBUFFER (buf, current_buffer); Fsetcar (Frassq (buf, Vbuffer_alist), newname); @@ -1562,6 +1562,9 @@ This does not change the name of the visited file (if any). */) run_buffer_list_update_hook (current_buffer); + call2 (intern ("uniquify--rename-buffer-advice"), + BVAR (current_buffer, name), unique); + /* Refetch since that last call may have done GC. */ return BVAR (current_buffer, name); } commit 0f9ec379eb8ae4ca228b87145edf04d6c8e88516 Author: Po Lu Date: Tue Dec 28 09:28:04 2021 +0800 Only rely on passive device grabs on XI2 * src/xterm.c (xi_grab_or_ungrab_device): Remove function. (handle_one_xevent): Stop setting non-passive grabs. diff --git a/src/xterm.c b/src/xterm.c index 9a4f5d39e2..698c1eba8b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -619,40 +619,6 @@ xi_find_touch_point (struct xi_device_t *device, int detail) #endif /* XI_TouchBegin */ -static void -xi_grab_or_ungrab_device (struct xi_device_t *device, - struct x_display_info *dpyinfo, - Window window) -{ - XIEventMask mask; - ptrdiff_t l = XIMaskLen (XI_LASTEVENT); - unsigned char *m; - mask.mask = m = alloca (l); - memset (m, 0, l); - mask.mask_len = l; - - XISetMask (m, XI_ButtonPress); - XISetMask (m, XI_ButtonRelease); - XISetMask (m, XI_Motion); - XISetMask (m, XI_Enter); - XISetMask (m, XI_Leave); - - if (device->grab -#if defined USE_MOTIF || defined USE_LUCID - && !popup_activated () -#endif - ) - { - XIGrabDevice (dpyinfo->display, device->device_id, window, - CurrentTime, None, GrabModeAsync, - GrabModeAsync, True, &mask); - } - else - { - XIUngrabDevice (dpyinfo->display, device->device_id, CurrentTime); - } -} - static void xi_reset_scroll_valuators_for_device_id (struct x_display_info *dpyinfo, int id) { @@ -10500,8 +10466,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, device->grab &= ~(1 << xev->detail); } - xi_grab_or_ungrab_device (device, dpyinfo, xev->event); - if (f) f->mouse_moved = false; commit fb9b7b70f55dd49d3019a9c69663076e942d857e Author: Stefan Kangas Date: Tue Dec 28 00:09:08 2021 +0100 Fix read-multiple-choice tests * lisp/emacs-lisp/rmc.el (rmc--add-key-description): Fix typo. * test/lisp/emacs-lisp/rmc-tests.el (test-rmc--add-key-description) (test-rmc--add-key-description/with-attributes) (test-rmc--add-key-description/non-graphical-display): Fix tests. diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 9d5fe40f9a..ed764f5350 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el @@ -41,7 +41,7 @@ (format "%s %s" (if graphical-terminal (propertize desc 'face 'read-multiple-choice-face) - (propertize desc 'face 'help-key-name)) + (propertize desc 'face 'help-key-binding)) name)) ;; The prompt character is in the name, so highlight ;; it on graphical terminals. diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el index 5a79c505ae..c1e838d051 100644 --- a/test/lisp/emacs-lisp/rmc-tests.el +++ b/test/lisp/emacs-lisp/rmc-tests.el @@ -34,9 +34,9 @@ (should (equal (rmc--add-key-description '(?y "yes")) '(?y . "yes"))) (should (equal (rmc--add-key-description '(?n "foo")) - '(?n . "[n] foo"))) + '(?n . "n foo"))) (should (equal (rmc--add-key-description '(?\s "foo bar")) - `(?\s . "[SPC] foo bar"))))) + `(?\s . "SPC foo bar"))))) (ert-deftest test-rmc--add-key-description/with-attributes () (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) t))) @@ -45,10 +45,10 @@ `(?y . ,(concat (propertize "y" 'face 'read-multiple-choice-face) "es")))) (should (equal-including-properties (rmc--add-key-description '(?n "foo")) - `(?n . ,(concat "[" (propertize "n" 'face 'read-multiple-choice-face) "] foo")))) + `(?n . ,(concat (propertize "n" 'face 'read-multiple-choice-face) " foo")))) (should (equal-including-properties (rmc--add-key-description '(?\s "foo bar")) - `(?\s . ,(concat "[" (propertize "SPC" 'face 'read-multiple-choice-face) "] foo bar")))))) + `(?\s . ,(concat (propertize "SPC" 'face 'read-multiple-choice-face) " foo bar")))))) (ert-deftest test-rmc--add-key-description/non-graphical-display () (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) nil))) @@ -57,7 +57,7 @@ '(?y . "[Y]es"))) (should (equal-including-properties (rmc--add-key-description '(?n "foo")) - '(?n . "[n] foo"))))) + `(?n . ,(concat (propertize "n" 'face 'help-key-binding) " foo")))))) (ert-deftest test-read-multiple-choice () (dolist (char '(?y ?n)) commit 13ef21e84a8c4af0cd9e7a5f9c56a359b1344fe9 Author: Stefan Monnier Date: Mon Dec 27 17:24:52 2021 -0500 Fix EIEIO tests to account for eieio-compat move * test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el: * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el: Require `eieio-compat` explicitly. * test/manual/cedet/tests/test.el (a-method, a-generic): * doc/misc/srecode.texi (Compound Dictionary Values): * doc/misc/ede.texi (ede-generic-project): Update sample code to use cl-generic syntax. diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi index 1d8235a348..1ed8ff2460 100644 --- a/doc/misc/ede.texi +++ b/doc/misc/ede.texi @@ -958,7 +958,7 @@ The example for Makefiles looks like this: ((buildfile :initform "Makefile")) "Generic Project for makefiles.") -(defmethod ede-generic-setup-configuration ((proj ede-generic-makefile-project) config) +(cl-defmethod ede-generic-setup-configuration ((proj ede-generic-makefile-project) config) "Set up a configuration for Make." (oset config build-command "make -k") (oset config debug-command "gdb ")) diff --git a/doc/misc/srecode.texi b/doc/misc/srecode.texi index 16a348e0f8..8e55ac2971 100644 --- a/doc/misc/srecode.texi +++ b/doc/misc/srecode.texi @@ -1070,9 +1070,9 @@ Here is an example of wrapping a semantic tag in a compound value: "Wrap up a collection of semantic tag information. This class will be used to derive dictionary values.") -(defmethod srecode-compound-toString((cp srecode-semantic-tag) - function - dictionary) +(cl-defmethod srecode-compound-toString ((cp srecode-semantic-tag) + function + dictionary) "Convert the compound dictionary value CP to a string. If FUNCTION is non-nil, then FUNCTION is somehow applied to an aspect of the compound value." diff --git a/etc/NEWS b/etc/NEWS index e0920e84e2..01e1a8e940 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -87,6 +87,14 @@ time. * Incompatible changes in Emacs 29.1 +--- +** Support for old EIEIO functions not is autoloaded any more +You need to explicitly (require 'eieio-compat) if you need to use +the functions `defmethod` and `defgeneric` (which have been made +obsolete in Emacs-25 with `cl-defmethod` and `cl-defgeneric`). +Similarly files that were compiled with an old EIEIO (Emacs<25), +will usually need (require 'eieio-compat). + --- ** 'C-x 8 .' has been moved to 'C-x 8 . .'. This is to open up the 'C-x 8 .' map to bind further characters there. 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 bc89f23b58..a5349b9558 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el @@ -55,6 +55,7 @@ ;;; Code: (require 'eieio) +(require 'eieio-compat) (require 'ert) (defvar eieio-test-method-order-list nil diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el index 3ed00f49d1..abb12e6833 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el @@ -27,6 +27,7 @@ (require 'ert) (require 'eieio) (require 'eieio-base) +(require 'eieio-compat) (require 'eieio-opt) (eval-when-compile (require 'cl-lib)) diff --git a/test/manual/cedet/tests/test.el b/test/manual/cedet/tests/test.el index 34c03619f8..246a856665 100644 --- a/test/manual/cedet/tests/test.el +++ b/test/manual/cedet/tests/test.el @@ -63,11 +63,11 @@ ;;; Methods ;; -(defmethod a-method ((obj some-class) &optional arg2) +(cl-defmethod a-method ((obj some-class) &optional arg2) "Doc String for a method." (call-next-method)) -(defgeneric a-generic (arg1 arg2) +(cl-defgeneric a-generic (arg1 arg2) "General description of a-generic.") ;;; Advice commit 0fb55c8776d75d08da626f84ca5570da7e95391e Author: Stefan Kangas Date: Mon Dec 27 02:44:27 2021 +0100 admin.el: Move etc/NEWS to etc/NEWS.NN in one commit This should preserve git history better for git blame, etc. * admin/admin.el (admin-git-command): New variable. (set-version): Move etc/NEWS to etc/NEWS.NN and prompt to commit it immediately. (Bug#52420) diff --git a/admin/admin.el b/admin/admin.el index ad4208beef..c1bdb13df9 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -88,6 +88,9 @@ Optional argument DATE is the release date, default today." (kill-buffer) (message "No need to update `%s'" file))) +(defvar admin-git-command (executable-find "git") + "The `git' program to use.") + (defun set-version (root version) "Set Emacs version to VERSION in relevant files under ROOT. Root must be the root of an Emacs source tree." @@ -96,6 +99,8 @@ Root must be the root of an Emacs source tree." (read-string "Version number: " emacs-version))) (unless (file-exists-p (expand-file-name "src/emacs.c" root)) (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) + (unless admin-git-command + (user-error "Could not find git; please install git and move NEWS manually")) (message "Setting version numbers...") ;; There's also a "version 3" (standing for GPLv3) at the end of ;; `README', but since `set-version-in-file' only replaces the first @@ -157,7 +162,13 @@ Root must be the root of an Emacs source tree." Documentation changes might not have been completed!")))) (when (and majorbump (not (file-exists-p oldnewsfile))) - (rename-file newsfile oldnewsfile) + (call-process admin-git-command nil nil nil + "mv" newsfile oldnewsfile) + (when (y-or-n-p "Commit move of NEWS file?") + (call-process admin-git-command nil nil nil + "commit" "-m" (format "; Move etc/%s to etc/%s" + (file-name-nondirectory newsfile) + (file-name-nondirectory oldnewsfile)))) (find-file oldnewsfile) ; to prompt you to commit it (copy-file oldnewsfile newsfile) (with-temp-buffer commit 85cb4f419b2e7c3b53b42d50d4c0c588931d02c6 Author: Stefan Kangas Date: Mon Dec 27 20:30:41 2021 +0100 disabled-command: Explain what SPC means again * lisp/novice.el (disabled-command-function): Explain what SPC means again, an explanation that was lost in a recent change. diff --git a/lisp/novice.el b/lisp/novice.el index 0cf54df160..65e48a2149 100644 --- a/lisp/novice.el +++ b/lisp/novice.el @@ -88,7 +88,7 @@ You can now type: '((?y "yes") (?n "no") (?! "yes; enable for session") - (?\s "yes; once")) + (?\s "(space bar) yes; once")) help-string "*Disabled Command*")))) (pcase char commit e2a7e5f4097bb128481df781d457c10934f69a0e Author: Stefan Kangas Date: Mon Dec 27 20:25:50 2021 +0100 read-multiple-choice: Improve key formatting * lisp/emacs-lisp/rmc.el (rmc--add-key-description): Improve formatting of key missing in the description. Use face help-key-name on terminals that can't display underline. diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 522d395eba..9d5fe40f9a 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el @@ -38,10 +38,10 @@ ;; Not in the name string, or a special character. ((or (not pos) (member desc '("ESC" "TAB" "RET" "DEL" "SPC"))) - (format "[%s] %s" + (format "%s %s" (if graphical-terminal (propertize desc 'face 'read-multiple-choice-face) - desc) + (propertize desc 'face 'help-key-name)) name)) ;; The prompt character is in the name, so highlight ;; it on graphical terminals. commit 1f792c2bc1bf12c254dc896e42eadda4be5d5cc3 Author: Juri Linkov Date: Mon Dec 27 21:14:00 2021 +0200 * etc/NEWS: Mention completion-wrap-movement. diff --git a/etc/NEWS b/etc/NEWS index 773c32a93f..e0920e84e2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -297,13 +297,8 @@ case keys. This command increases (or decreases) the number of empty lines before point. -** The *Completions* buffer can now be automatically selected. -To enable this behavior, customize the option 'completion-auto-select' -to t. Then pressing TAB will switch to the *Completions* buffer when -it pops up that buffer. - --- -*** Improved mouse behavior with auto-scrolling modes. +** Improved mouse behavior with auto-scrolling modes. When clicking inside the 'scroll-margin' or 'hscroll-margin' region the point is now moved only when releasing the mouse button. This no longer results in a bogus selection, unless the mouse has been @@ -347,6 +342,18 @@ received. * Changes in Specialized Modes and Packages in Emacs 29.1 +** Minibuffer and Completions + +*** The *Completions* buffer can now be automatically selected. +To enable this behavior, customize the option 'completion-auto-select' +to t. Then pressing TAB will switch to the *Completions* buffer when +it pops up that buffer. + +*** New user option 'completion-wrap-movement'. +When non-nil, the commands 'next-completion' and 'previous-completion' +automatically wrap around on reaching the beginning or the end of +the *Completions* buffer. + ** Isearch and Replace +++ commit d7416e301218024dda92ce5638a625c915a18e51 Author: Juri Linkov Date: Mon Dec 27 21:05:19 2021 +0200 * doc/emacs/search.texi (Lax Search): Add char-fold-include. diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index fbbb1f6e68..c3b3d9a0b1 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1448,9 +1448,13 @@ letter @code{a} as well as all the other variants like @code{@'a}. @vindex char-fold-include @vindex char-fold-exclude +@vindex char-fold-override You can add new foldings using the customizable variable @code{char-fold-include}, or remove the existing ones using the -customizable variable @code{char-fold-exclude}. +customizable variable @code{char-fold-exclude}. Also you can +customize @code{char-fold-override} to @code{t} to disable default +character equivalences, so you can add only your own equivalences +using @code{char-fold-include}. @node Replace @section Replacement Commands diff --git a/etc/NEWS b/etc/NEWS index feaa7b425d..773c32a93f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -349,7 +349,8 @@ received. ** Isearch and Replace -*** New user option 'char-fold-override' omits the default character-folding. ++++ +*** New user option 'char-fold-override' disables default character equivalences. ** New minor mode 'glyphless-display-mode'. This allows an easy way to toggle seeing all glyphless characters in commit 65cd66c7d7a2e120d533ef26baf499d6ee4e44f0 Author: Juri Linkov Date: Mon Dec 27 20:54:18 2021 +0200 * lisp/tab-bar.el (tab-bar-history-mode-map): New defvar-keymap. diff --git a/etc/NEWS b/etc/NEWS index cfea513cca..feaa7b425d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -248,6 +248,11 @@ height use 'window-height' in combination with 'body-lines'. --- *** 'C-x t RET' creates a new tab when the provided tab name doesn't exist. +--- +*** New keymap 'tab-bar-history-mode-map'. +By default, it contains 'C-c ' and 'C-c ' to browse +the history of tab window configurations back and forward. + ** Better detection of text suspiciously reordered on display. The function 'bidi-find-overridden-directionality' has been extended to detect reordering effects produced by embeddings and isolates diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 07aa0f2d56..7dcd0bdc7b 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1884,6 +1884,10 @@ This navigates forward in the history of window configurations." (goto-char wc-point))) (message "No more tab forward history")))) +(defvar-keymap tab-bar-history-mode-map + "C-c " #'tab-bar-history-back + "C-c " #'tab-bar-history-forward) + (define-minor-mode tab-bar-history-mode "Toggle tab history mode for the tab bar. Tab history mode remembers window configurations used in every tab, commit 4ab5b89de84c8ae6254e11330b783a42e2c40121 Author: Michael Albinus Date: Mon Dec 27 19:53:00 2021 +0100 The temprary "session" collection might not exist in Secret Service * doc/misc/auth.texi (Secret Service API): * test/lisp/net/secrets-tests.el (secrets--test-delete-all-session-items) (secrets-test02-collections, secrets-test03-items) (secrets-test04-search): The temporary "session" collection might not exist. * lisp/net/secrets.el (secrets-struct-secret-content-type): Remove compatibility hack. (secrets-create-item): Adapt accordingly. diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi index 034004d1df..6602f9dc2e 100644 --- a/doc/misc/auth.texi +++ b/doc/misc/auth.texi @@ -370,6 +370,10 @@ items should not live longer than Emacs. The session collection can be specified either by the string @code{"session"}, or by @code{nil}, whenever a collection parameter is needed in the following functions. +However, not all Secret Service provider create this temporary +@code{"session"} collection, like KeePassXC. You shall check first +that this collection exists, before you use it. + @defun secrets-list-items collection Returns all the item labels of @var{collection} as a list. @end defun @@ -382,7 +386,7 @@ pairs set for the created item. The keys are keyword symbols, starting with a colon. Example: @example -;;; The session is "session", the label is "my item" +;;; The collection is "session", the label is "my item" ;;; and the secret (password) is "geheim". (secrets-create-item "session" "my item" "geheim" :method "sudo" :user "joe" :host "remote-host") diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el index 4217c219ad..25802f2c46 100644 --- a/lisp/net/secrets.el +++ b/lisp/net/secrets.el @@ -263,6 +263,7 @@ It returns t if not." ;; ;; +;; This is not guaranteed to exist. For example, KeePassXC does not offer this. (defconst secrets-session-collection-path "/org/freedesktop/secrets/collection/session" "The D-Bus temporary session collection object path.") @@ -311,43 +312,8 @@ It returns t if not." (defconst secrets-interface-item-type-generic "org.freedesktop.Secret.Generic" "The default item type we are using.") -;; We cannot use introspection, because some servers, like -;; mate-keyring-daemon, don't provide relevant data. Once the dust -;; has settled, we shall assume the new interface, and get rid of the test. -(defconst secrets-struct-secret-content-type - (ignore-errors - (let ((content-type "text/plain") - (path (cadr - (dbus-call-method - :session secrets-service secrets-path - secrets-interface-service - "OpenSession" "plain" '(:variant "")))) - result) - ;; Create a dummy item. - (setq result - (dbus-call-method - :session secrets-service secrets-session-collection-path - secrets-interface-collection "CreateItem" - ;; Properties. - `(:array - (:dict-entry ,(concat secrets-interface-item ".Label") - (:variant " "))) - ;; Secret. - `(:struct :object-path ,path - (:array :signature "y") - ,(dbus-string-to-byte-array " ") - :string ,content-type) - ;; Don't replace. - nil)) - ;; Remove it. - (dbus-call-method - :session secrets-service (car result) - secrets-interface-item "Delete") - ;; Result. - `(,content-type))) - "The content_type of a secret struct. -It must be wrapped as list, because we add it via `append'. This -is an interface introduced in 2011.") +(defconst secrets-struct-secret-content-type "text/plain" + "The content_type of a secret struct.") (defconst secrets-interface-session "org.freedesktop.Secret.Session" "A session tracks state between the service and a client application.") @@ -696,13 +662,10 @@ The object path of the created item is returned." `((:dict-entry ,(concat secrets-interface-item ".Attributes") (:variant ,(append '(:array) props)))))) ;; Secret. - (append - `(:struct :object-path ,secrets-session-path - (:array :signature "y") ;; No parameters. - ,(dbus-string-to-byte-array password)) - ;; We add the content_type. In backward compatibility - ;; mode, nil is appended, which means nothing. - secrets-struct-secret-content-type) + `(:struct :object-path ,secrets-session-path + (:array :signature "y") ;; No parameters. + ,(dbus-string-to-byte-array password) + ,secrets-struct-secret-content-type) ;; Do not replace. Replace does not seem to work. nil)) (secrets-prompt (cadr result)) diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el index b392c4d184..03d3e26faa 100644 --- a/test/lisp/net/secrets-tests.el +++ b/test/lisp/net/secrets-tests.el @@ -57,8 +57,11 @@ (defun secrets--test-delete-all-session-items () "Delete all items of collection \"session\" bound to this Emacs." - (dolist (item (secrets-list-items "session")) - (secrets-delete-item "session" item))) + ;; If the "session" collection does not exist, a `dbus-error' is + ;; fired, which we ignore. + (dbus-ignore-errors + (dolist (item (secrets-list-items "session")) + (secrets-delete-item "session" item)))) (ert-deftest secrets-test01-sessions () "Test opening / closing a secrets session." @@ -93,7 +96,7 @@ (unwind-protect (progn (should (secrets-open-session)) - (should (member "session" (secrets-list-collections))) + (skip-unless (member "session" (secrets-list-collections))) ;; Create a random collection. This asks for a password ;; outside our control, so we make it in the interactive case @@ -153,6 +156,7 @@ (unwind-protect (let (item-path) (should (secrets-open-session)) + (skip-unless (member "session" (secrets-list-collections))) ;; Cleanup. There could be items in the "session" collection. (secrets--test-delete-all-session-items) @@ -214,6 +218,7 @@ (unwind-protect (progn (should (secrets-open-session)) + (skip-unless (member "session" (secrets-list-collections))) ;; Cleanup. There could be items in the "session" collection. (secrets--test-delete-all-session-items) commit 01df347947c8785c7c21d5a2baa12de2ffde80dd Author: Michael Albinus Date: Mon Dec 27 19:51:58 2021 +0100 Use `permission-denied' in Tramp tests, and more * lisp/net/tramp-crypt.el (tramp-crypt-maybe-open-connection): Simplify code. * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-system-info): Adapt for "mtp" method. * test/lisp/net/tramp-tests.el (tramp-test18-file-attributes): Use `permission-denied' error. Simplify code. (tramp-test24-file-acl, tramp-test26-file-name-completion): Simplify code. diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index 4ff8e6bbf1..dd2ba23f0f 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -323,7 +323,7 @@ connection if a previous connection has died for some reason." tramp-crypt-encfs-config (tramp-crypt-get-remote-dir vec))) (local-config (tramp-crypt-config-file-name vec))) ;; There is no local encfs6 config file. - (when (not (file-exists-p local-config)) + (unless (file-exists-p local-config) (if (and tramp-crypt-save-encfs-config-remote (file-exists-p remote-config)) ;; Copy remote encfs6 config file if possible. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 6b0299aa09..292da5a166 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1524,8 +1524,10 @@ If FILE-SYSTEM is non-nil, return file system attributes." (when (or size free) (list (and size (string-to-number size)) (and free (string-to-number free)) - (and size used - (- (string-to-number size) (string-to-number used)))))))) + ;; "mtp" connections do not return "filesystem::used". + (or (and size used + (- (string-to-number size) (string-to-number used))) + (and free (string-to-number free)))))))) (defun tramp-gvfs-handle-make-directory (dir &optional parents) "Like `make-directory' for Tramp files." diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index f14d63af4c..7ba5a87076 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -3405,12 +3405,12 @@ This tests also `access-file', `file-readable-p', (when (tramp--test-supports-set-file-modes-p) (write-region "foo" nil tmp-name1) ;; A file is always accessible for user "root". - (when (not (zerop (file-attribute-user-id - (file-attributes tmp-name1)))) + (unless + (zerop (file-attribute-user-id (file-attributes tmp-name1))) (set-file-modes tmp-name1 0) (should-error (access-file tmp-name1 "error") - :type 'file-error) + :type tramp-permission-denied) (set-file-modes tmp-name1 #o777)) (delete-file tmp-name1)) (should-error @@ -4095,7 +4095,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should (file-acl tmp-name2)) (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) ;; Different permissions mean different ACLs. - (when (not (tramp--test-windows-nt-or-smb-p)) + (unless (tramp--test-windows-nt-or-smb-p) (set-file-modes tmp-name1 #o777) (set-file-modes tmp-name2 #o444) (should-not @@ -4297,7 +4297,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Method and host name in completion mode. This kind of completion ;; does not work on MS Windows. - (when (not (memq system-type '(cygwin windows-nt))) + (unless (memq system-type '(cygwin windows-nt)) (let ((method (file-remote-p tramp-test-temporary-file-directory 'method)) (host (file-remote-p tramp-test-temporary-file-directory 'host)) (orig-syntax tramp-syntax)) commit c0815aca18e210e1590e47b78a01e5dd63401775 (refs/remotes/origin/emacs-28) Author: Eli Zaretskii Date: Mon Dec 27 19:00:33 2021 +0200 Fix typos in in 'reset-language-environment' * lisp/international/mule-cmds.el (reset-language-environment): Fix a typo in 'windows-nt'. (Bug#52816) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index a0a6557c95..2b52d4bf86 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1873,7 +1873,7 @@ The default status is as follows: (set-default-coding-systems nil) (setq default-sendmail-coding-system 'utf-8) (setq default-file-name-coding-system (if (memq system-type - '(window-nt ms-dos)) + '(windows-nt ms-dos)) 'iso-latin-1-unix 'utf-8-unix)) ;; Preserve eol-type from existing default-process-coding-systems. @@ -1892,9 +1892,9 @@ The default status is as follows: (condition-case nil (coding-system-change-text-conversion (cdr default-process-coding-system) - (if (memq system-type '(window-nt ms-dos)) 'iso-latin-1 'utf-8)) + (if (memq system-type '(windows-nt ms-dos)) 'iso-latin-1 'utf-8)) (coding-system-error - (if (memq system-type '(window-nt ms-dos)) 'iso-latin-1 'utf-8))))) + (if (memq system-type '(windows-nt ms-dos)) 'iso-latin-1 'utf-8))))) (setq default-process-coding-system (cons output-coding input-coding))) commit 8df3a71c526c28b17926f7b56860f9798ab6d933 Author: Stefan Kangas Date: Mon Dec 27 16:24:18 2021 +0100 Doc fix; fix terminology in key binding functions * lisp/keymap.el (keymap-set, key-valid-p): * lisp/subr.el (define-keymap): Doc fix; improve terminology. diff --git a/lisp/keymap.el b/lisp/keymap.el index fd91689f88..734cbe89cd 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -38,7 +38,7 @@ (byte-compile-warn "Invalid `kbd' syntax: %S" key)))) (defun keymap-set (keymap key definition) - "Set key sequence KEY to DEFINITION in KEYMAP. + "Set KEY to DEFINITION in KEYMAP. KEY is a string that satisfies `key-valid-p'. DEFINITION is anything that can be a key's definition: @@ -295,9 +295,9 @@ See `kbd' for a descripion of KEYS." res)))) (defun key-valid-p (keys) - "Say whether KEYS is a valid `kbd' sequence. -A `kbd' sequence is a string consisting of one and more key -strokes. The key strokes are separated by a space character. + "Say whether KEYS is a valid key. +A key is a string consisting of one or more key strokes. +The key strokes are separated by a space character. Each key stroke is either a single character, or the name of an event, surrounded by angle brackets. In addition, any key stroke diff --git a/lisp/subr.el b/lisp/subr.el index b77afaca94..29f375884b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6549,7 +6549,7 @@ not a list, return a one-element list containing OBJECT." form) (defun define-keymap (&rest definitions) - "Create a new keymap and define KEY/DEFINITION pairs as key sequences. + "Create a new keymap and define KEY/DEFINITION pairs as key bindings. The new keymap is returned. Options can be given as keywords before the KEY/DEFINITION commit ea65de757766fa4cb5a090012e2f6a0aeef0b9f8 Author: Óscar Fuentes Date: Mon Dec 27 16:01:09 2021 +0100 eshell-complete-parse-arguments: don't use string-match on a list When there is more than one candidate for completion, `val' is a list. Fixes bug#52794. * lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments): protect use of string-match with stringp. diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index 4fd0afbeb8..96ec031fba 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el @@ -382,7 +382,7 @@ to writing a completion function." (setq val (number-to-string val))) ;; expand .../ etc that only eshell understands to ;; standard ../../ - ((string-match "\\.\\.\\.+/" val) + ((and (stringp val)) (string-match "\\.\\.\\.+/" val) (setq val (eshell-expand-multiple-dots val)))) (or val ""))) args) commit caa1699264e583d9703dd47e6162c6386775915f Author: Po Lu Date: Mon Dec 27 17:55:23 2021 +0800 Fix precision scrolling inside terminal buffers * lisp/term.el (term-goto-process-mark-maybe): Don't move point to process mark if the event is a vertical wheel event. diff --git a/lisp/term.el b/lisp/term.el index e0a2f0a9a4..5961350ff9 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -3300,13 +3300,16 @@ Called as a buffer-local `post-command-hook' function in `term-char-mode' to prevent commands from putting the buffer into an inconsistent state by unexpectedly moving point. -Mouse events are ignored so that mouse selection is unimpeded. +Mouse and wheel events are ignored so that mouse selection and +mouse wheel scrolling is unimpeded. Only acts when the pre-command position of point was equal to the process mark, and the `term-char-mode-point-at-process-mark' option is enabled. See `term-set-goto-process-mark'." (when term-goto-process-mark - (unless (mouse-event-p last-command-event) + (unless (or (mouse-event-p last-command-event) + (memq (event-basic-type last-command-event) + '(wheel-down wheel-up))) (goto-char (term-process-mark))))) (defun term-process-mark ()