commit 4b1ec3956117a0ed30f5df3bd19d71fb9ba51a48 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Fri Aug 5 13:21:29 2022 +0800 Improve multi-pointer X support * etc/TODO: Document that MPX support still needs work. * src/xterm.c (xi_handle_interaction): New function. (handle_one_xevent): Call it in the appropriate places. diff --git a/etc/TODO b/etc/TODO index 4d0bfd1c2a..bd846dd898 100644 --- a/etc/TODO +++ b/etc/TODO @@ -1746,6 +1746,19 @@ for vc-rcs-update-changelog. A two-char comment-starter whose two chars are symbol constituents will not be noticed if it appears within a word. +** Multi-pointer X does not work very well +Emacs is reasonably usable under a multi-pointer X (MPX) environment, +if you turn off tooltips and mouse highlight, and don't use anything +that calls `mouse-position'. Otherwise, tooltips are shown next to +the wrong pointer, mouse highlight simply goes haywire, and +`mouse-position' returns information for the wrong pointer. + +This could be easily fixed in principle, but I cannot find a stable +enough environment under which the fix can be tested. + +The MPX code has not been tested under X toolkit or GTK+ 2.x builds +and is not expected to work there. + This file is part of GNU Emacs. diff --git a/src/xterm.c b/src/xterm.c index ebd27aea06..4bbcfb0e59 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12616,6 +12616,36 @@ xi_handle_delete_frame (struct x_display_info *dpyinfo, } } +/* Handle an interaction by DEVICE on frame F. TIME is the time of + the interaction; if F isn't currently the global focus frame, but + is the focus of DEVICE, make it the focus frame. */ + +static void +xi_handle_interaction (struct x_display_info *dpyinfo, + struct frame *f, struct xi_device_t *device, + Time time) +{ + bool change; + + change = false; + + if (device->focus_frame == f) + { + device->focus_frame_time = time; + change = true; + } + + if (device->focus_implicit_frame == f) + { + device->focus_implicit_time = time; + change = true; + } + + /* If F isn't currently focused, update the focus state. */ + if (change && f != dpyinfo->x_focus_frame) + xi_handle_focus_change (dpyinfo); +} + #endif /* The focus may have changed. Figure out if it is a real focus change, @@ -21285,6 +21315,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, } } + if (f) + { + /* If the user interacts with a frame that's focused + on another device, but not the current focus + frame, make it the focus frame. */ + if (device) + xi_handle_interaction (dpyinfo, f, device, + xev->time); + } + #ifdef USE_GTK if (!f) { @@ -21566,6 +21606,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, f = x_any_window_to_frame (dpyinfo, xev->event); + if (f) + { + /* If the user interacts with a frame that's focused + on another device, but not the current focus + frame, make it the focus frame. */ + if (device) + xi_handle_interaction (dpyinfo, f, device, + xev->time); + } + XKeyPressedEvent xkey; memset (&xkey, 0, sizeof xkey); commit c7b0eafd7221b2b4a565448e19bf1b6704137a2e Merge: 0dbe0fd410 f484da5fcb Author: Stefan Kangas Date: Fri Aug 5 06:30:27 2022 +0200 Merge from origin/emacs-28 f484da5fcb * doc/lispref/loading.texi (Autoload by Prefix): Fix typo. commit 0dbe0fd4104f4a58908324c1ead365461a4daa16 Author: Po Lu Date: Fri Aug 5 10:18:18 2022 +0800 Improve input extension focus handling with multiple master devices * src/xterm.c (x_cache_xi_devices): Initialize device fields to 0. (xi_handle_focus_change, xi_focus_handle_for_device) (xi_handle_delete_frame): New functions; store focus information per-device instead. (x_detect_focus_change): Handle GenericEvents that way instead. (handle_one_xevent): Don't cache XI devices on DeviceChanged. (x_free_frame_resources): Clear any frame focus information. * src/xterm.h (struct xi_device_t): New fields for focus tracking. Add comments describing fields. diff --git a/src/xterm.c b/src/xterm.c index 2a453099ee..ebd27aea06 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5394,7 +5394,7 @@ xi_populate_device_from_info (struct xi_device_t *xi_device, static void x_cache_xi_devices (struct x_display_info *dpyinfo) { - int ndevices, actual_devices; + int ndevices, actual_devices, i; XIDeviceInfo *infos; actual_devices = 0; @@ -5411,9 +5411,9 @@ x_cache_xi_devices (struct x_display_info *dpyinfo) return; } - dpyinfo->devices = xmalloc (sizeof *dpyinfo->devices * ndevices); + dpyinfo->devices = xzalloc (sizeof *dpyinfo->devices * ndevices); - for (int i = 0; i < ndevices; ++i) + for (i = 0; i < ndevices; ++i) { if (infos[i].enabled) xi_populate_device_from_info (&dpyinfo->devices[actual_devices++], @@ -12446,6 +12446,178 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, return unbind_to (base, Qnil); } +#ifdef HAVE_XINPUT2 + +/* Since the input extension assigns a keyboard focus to each master + device, there is no longer a 1:1 correspondence between the + selected frame and the focus frame immediately after the keyboard + focus is switched to a given frame. This situation is handled by + keeping track of each master device's focus frame, the time of the + last interaction with that frame, and always keeping the focus on + the most recently selected frame. */ + +static void +xi_handle_focus_change (struct x_display_info *dpyinfo) +{ + struct input_event ie; + struct frame *focus, *new; + struct xi_device_t *device, *source; + ptrdiff_t i; + Time time; +#ifdef USE_GTK + struct x_output *output; + GtkWidget *widget; +#endif + + focus = dpyinfo->x_focus_frame; + new = NULL; + time = 0; + + for (i = 0; i < dpyinfo->num_devices; ++i) + { + device = &dpyinfo->devices[i]; + + if (device->focus_frame + && device->focus_frame_time > time) + { + new = device->focus_frame; + time = device->focus_frame_time; + source = device; + } + + if (device->focus_implicit_frame + && device->focus_implicit_time > time) + { + new = device->focus_implicit_frame; + time = device->focus_implicit_time; + source = device; + } + } + + if (new != focus && focus) + { +#ifdef HAVE_X_I18N + if (FRAME_XIC (focus)) + XUnsetICFocus (FRAME_XIC (focus)); +#endif + +#ifdef USE_GTK + output = FRAME_X_OUTPUT (focus); + + if (x_gtk_use_native_input) + { + gtk_im_context_focus_out (output->im_context); + gtk_im_context_set_client_window (output->im_context, + NULL); + } +#endif + + EVENT_INIT (ie); + ie.kind = FOCUS_OUT_EVENT; + XSETFRAME (ie.frame_or_window, focus); + + kbd_buffer_store_event (&ie); + } + + if (new != focus && new) + { + +#ifdef HAVE_X_I18N + if (FRAME_XIC (new)) + XSetICFocus (FRAME_XIC (new)); +#endif + +#ifdef USE_GTK + output = FRAME_X_OUTPUT (new); + + if (x_gtk_use_native_input) + { + widget = FRAME_GTK_OUTER_WIDGET (new); + + gtk_im_context_focus_in (output->im_context); + gtk_im_context_set_client_window (output->im_context, + gtk_widget_get_window (widget)); + } +#endif + + EVENT_INIT (ie); + ie.kind = FOCUS_IN_EVENT; + ie.device = source->name; + XSETFRAME (ie.frame_or_window, new); + + kbd_buffer_store_event (&ie); + } + + x_new_focus_frame (dpyinfo, new); +} + +static void +xi_focus_handle_for_device (struct x_display_info *dpyinfo, + struct frame *mentioned_frame, + XIEvent *base_event) +{ + struct xi_device_t *device; + XIEnterEvent *event; + + /* XILeaveEvent, XIFocusInEvent, etc are just synonyms for + XIEnterEvent. */ + event = (XIEnterEvent *) base_event; + device = xi_device_from_id (dpyinfo, event->deviceid); + + if (!device) + return; + + switch (event->evtype) + { + case XI_FocusIn: + device->focus_frame = mentioned_frame; + device->focus_frame_time = event->time; + break; + + case XI_FocusOut: + device->focus_frame = NULL; + break; + + case XI_Enter: + if (!event->focus) + break; + + device->focus_implicit_frame = mentioned_frame; + device->focus_implicit_time = event->time; + break; + + case XI_Leave: + if (!event->focus) + break; + + device->focus_implicit_frame = NULL; + break; + } + + xi_handle_focus_change (dpyinfo); +} + +static void +xi_handle_delete_frame (struct x_display_info *dpyinfo, + struct frame *f) +{ + struct xi_device_t *device; + ptrdiff_t i; + + for (i = 0; i < dpyinfo->num_devices; ++i) + { + device = &dpyinfo->devices[i]; + + if (device->focus_frame == f) + device->focus_frame = NULL; + + if (device->focus_implicit_frame == f) + device->focus_implicit_frame = NULL; + } +} + +#endif + /* The focus may have changed. Figure out if it is a real focus change, by checking both FocusIn/Out and Enter/LeaveNotify events. @@ -12478,33 +12650,9 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame, #ifdef HAVE_XINPUT2 case GenericEvent: - { - XIEvent *xi_event = event->xcookie.data; - XIEnterEvent *enter_or_focus = event->xcookie.data; - - struct frame *focus_frame = dpyinfo->x_focus_event_frame; - int focus_state - = focus_frame ? focus_frame->output_data.x->focus_state : 0; - - if (xi_event->evtype == XI_FocusIn - || xi_event->evtype == XI_FocusOut) - x_focus_changed ((xi_event->evtype == XI_FocusIn - ? FocusIn : FocusOut), - ((enter_or_focus->detail - == XINotifyPointer) - ? FOCUS_IMPLICIT : FOCUS_EXPLICIT), - dpyinfo, frame, bufp); - else if ((xi_event->evtype == XI_Enter - || xi_event->evtype == XI_Leave) - && (enter_or_focus->detail != XINotifyInferior) - && enter_or_focus->focus - && !(focus_state & FOCUS_EXPLICIT)) - x_focus_changed ((xi_event->evtype == XI_Enter - ? FocusIn : FocusOut), - FOCUS_IMPLICIT, - dpyinfo, frame, bufp); - break; - } + xi_focus_handle_for_device (dpyinfo, frame, + event->xcookie.data); + break; #endif case FocusIn: @@ -21912,7 +22060,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (n_disabled) { ndevices = 0; - devices = xmalloc (sizeof *devices * dpyinfo->num_devices); + devices = xzalloc (sizeof *devices * dpyinfo->num_devices); for (i = 0; i < dpyinfo->num_devices; ++i) { @@ -21992,7 +22140,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (n_disabled) { ndevices = 0; - devices = xmalloc (sizeof *devices * dpyinfo->num_devices); + devices = xzalloc (sizeof *devices * dpyinfo->num_devices); for (i = 0; i < dpyinfo->num_devices; ++i) { @@ -22027,6 +22175,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, dpyinfo->num_devices = ndevices; } + /* Now that the device hierarchy has been changed, + recompute focus. */ + xi_handle_focus_change (dpyinfo); + goto XI_OTHER; } @@ -22044,17 +22196,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, device = xi_device_from_id (dpyinfo, device_changed->deviceid); - if (!device) - { - /* An existing device might have been enabled. */ - x_cache_xi_devices (dpyinfo); - - /* Now try to find the device again, in case it was - just enabled. */ - device = xi_device_from_id (dpyinfo, device_changed->deviceid); - } - - /* If it wasn't enabled, then stop handling this event. */ + /* If the device isn't enabled, then stop handling this + event. A HierarchyChanged event will be sent if it + is enabled afterwards. */ if (!device) goto XI_OTHER; @@ -26219,6 +26363,11 @@ x_free_frame_resources (struct frame *f) block_input (); +#ifdef HAVE_XINPUT2 + /* Remove any record of this frame being focused. */ + xi_handle_delete_frame (dpyinfo, f); +#endif + /* If a display connection is dead, don't try sending more commands to the X server. */ if (dpyinfo->display) diff --git a/src/xterm.h b/src/xterm.h index c1a944d3cd..7be0f2ede6 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -238,23 +238,50 @@ struct xi_touch_point_t struct xi_device_t { + /* The numerical ID of this device. */ int device_id; + #ifdef HAVE_XINPUT2_1 + /* The number of scroll valuators in `valuators'. */ int scroll_valuator_count; #endif + + /* Whether or not the device is grabbed and its use. */ int grab, use; + #ifdef HAVE_XINPUT2_2 + /* Whether or not this device is a direct touch device. */ bool direct_p; #endif #ifdef HAVE_XINPUT2_1 + /* An array of scroll valuators Emacs knows about. */ struct xi_scroll_valuator_t *valuators; #endif + #ifdef HAVE_XINPUT2_2 + /* An array of in-progress touchscreen events. */ struct xi_touch_point_t *touchpoints; #endif + /* The name of this device. */ Lisp_Object name; + + /* The time at which `focus_frame' became the keyboard focus (only + applies to master devices). */ + Time focus_frame_time; + + /* The frame that is currently this device's keyboard focus, or + NULL. */ + struct frame *focus_frame; + + /* The time at which `focus_frame' became the implicit keyboard + focus. */ + Time focus_implicit_time; + + /* The frame that is currently this device's implicit keyboard + focus, or NULL. */ + struct frame *focus_implicit_frame; }; #endif @@ -482,7 +509,10 @@ struct x_display_info /* The last frame mentioned in a FocusIn or FocusOut event. This is separate from x_focus_frame, because whether or not LeaveNotify events cause us to lose focus depends on whether or not we have - received a FocusIn event for it. */ + received a FocusIn event for it. + + This field is not used when the input extension is being + utilized. */ struct frame *x_focus_event_frame; /* The frame which currently has the visual highlight, and should get @@ -1101,7 +1131,9 @@ struct x_output /* Keep track of focus. May be EXPLICIT if we received a FocusIn for this frame, or IMPLICIT if we received an EnterNotify. - FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */ + FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. + + Not used when the input extension is being utilized. */ int focus_state; /* The offset we need to add to compensate for type A WMs. */ commit 8ea7506d724903008910bc47e88212da55549ede Author: Stefan Kangas Date: Thu Aug 4 23:35:46 2022 +0200 Prefer defvar-keymap in mail/*.el * lisp/mail/mspools.el (mspools-mode-map): * lisp/mail/rmailedit.el (rmail-edit-map): * lisp/mail/rmailsum.el (rmail-summary-edit-map): * lisp/mail/supercite.el (sc-T-keymap, sc-mode-map) (sc-electric-mode-map, sc-minibuffer-local-completion-map) (sc-minibuffer-local-map): Prefer defvar-keymap. diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el index 4dcde0d354..2ab4fa411a 100644 --- a/lisp/mail/mspools.el +++ b/lisp/mail/mspools.el @@ -164,17 +164,13 @@ your primary spool is. If this fails, set it to something like (defvar mspools-buffer "*spools*" "Name of buffer for displaying spool info.") -(defvar mspools-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-c\C-c" #'mspools-visit-spool) - (define-key map "\C-m" #'mspools-visit-spool) - (define-key map " " #'mspools-visit-spool) - (define-key map "n" #'next-line) - (define-key map "p" #'previous-line) - map) - "Keymap for the *spools* buffer.") - -;;; Code +(defvar-keymap mspools-mode-map + :doc "Keymap for the *spools* buffer." + "C-c C-c" #'mspools-visit-spool + "RET" #'mspools-visit-spool + "SPC" #'mspools-visit-spool + "n" #'next-line + "p" #'previous-line) ;;; VM Specific code (if mspools-using-vm diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el index 79bd02fd67..553fac26f9 100644 --- a/lisp/mail/rmailedit.el +++ b/lisp/mail/rmailedit.el @@ -34,13 +34,10 @@ :group 'rmail-edit) -(defvar rmail-edit-map - (let ((map (make-sparse-keymap))) - ;; Make a keymap that inherits text-mode-map. - (set-keymap-parent map text-mode-map) - (define-key map "\C-c\C-c" #'rmail-cease-edit) - (define-key map "\C-c\C-]" #'rmail-abort-edit) - map)) +(defvar-keymap rmail-edit-map + :parent text-mode-map + "C-c C-c" #'rmail-cease-edit + "C-c C-]" #'rmail-abort-edit) (declare-function rmail-summary-disable "rmailsum" ()) diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index b23fbc3f60..cc76df718c 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -1480,11 +1480,10 @@ argument says to read a file name and use that file as the inbox." (declare-function rmail-output-read-file-name "rmailout" ()) (declare-function mail-send-and-exit "sendmail" (&optional arg)) -(defvar rmail-summary-edit-map - (let ((map (nconc (make-sparse-keymap) text-mode-map))) - (define-key map "\C-c\C-c" #'rmail-cease-edit) - (define-key map "\C-c\C-]" #'rmail-abort-edit) - map)) +(defvar-keymap rmail-summary-edit-map + :parent text-mode-map + "C-c C-c" #'rmail-cease-edit + "C-c C-]" #'rmail-abort-edit) (defun rmail-summary-edit-current-message () "Edit the contents of this message." diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index 3f8a940382..98f46a3af5 100644 --- a/lisp/mail/supercite.el +++ b/lisp/mail/supercite.el @@ -520,75 +520,67 @@ string." ;; ====================================================================== ;; supercite keymaps -(defvar sc-T-keymap - (let ((map (make-sparse-keymap))) - (define-key map "a" #'sc-S-preferred-attribution-list) - (define-key map "b" #'sc-T-mail-nuke-blank-lines) - (define-key map "c" #'sc-T-confirm-always) - (define-key map "d" #'sc-T-downcase) - (define-key map "e" #'sc-T-electric-references) - (define-key map "f" #'sc-T-auto-fill-region) - (define-key map "h" #'sc-T-describe) - (define-key map "l" #'sc-S-cite-region-limit) - (define-key map "n" #'sc-S-mail-nuke-mail-headers) - (define-key map "N" #'sc-S-mail-header-nuke-list) - (define-key map "o" #'sc-T-electric-circular) - (define-key map "p" #'sc-S-preferred-header-style) - (define-key map "s" #'sc-T-nested-citation) - (define-key map "u" #'sc-T-use-only-preferences) - (define-key map "w" #'sc-T-fixup-whitespace) - (define-key map "?" #'sc-T-describe) - map) - "Keymap for sub-keymap of setting and toggling functions.") - -(defvar sc-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "c" #'sc-cite-region) - (define-key map "f" #'sc-mail-field-query) - (define-key map "g" #'sc-mail-process-headers) - (define-key map "h" #'sc-describe) - (define-key map "i" #'sc-insert-citation) - (define-key map "o" #'sc-open-line) - (define-key map "r" #'sc-recite-region) - (define-key map "\C-p" #'sc-raw-mode-toggle) - (define-key map "u" #'sc-uncite-region) - (define-key map "w" #'sc-insert-reference) - (define-key map "\C-t" sc-T-keymap) - (define-key map "?" #'sc-describe) - map) - "Keymap for Supercite quasi-mode.") - -(defvar sc-electric-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "p" #'sc-eref-prev) - (define-key map "n" #'sc-eref-next) - (define-key map "s" #'sc-eref-setn) - (define-key map "j" #'sc-eref-jump) - (define-key map "x" #'sc-eref-abort) - (define-key map "q" #'sc-eref-abort) - (define-key map "\r" #'sc-eref-exit) - (define-key map "\n" #'sc-eref-exit) - (define-key map "g" #'sc-eref-goto) - (define-key map "?" #'describe-mode) - (define-key map "\C-h" #'describe-mode) - (define-key map [f1] #'describe-mode) - (define-key map [help] #'describe-mode) - map) - "Keymap for `sc-electric-mode' electric references mode.") - - -(defvar sc-minibuffer-local-completion-map - (let ((map (copy-keymap minibuffer-local-completion-map))) - (define-key map "\C-t" #'sc-toggle-fn) - (define-key map " " #'self-insert-command) - map) - "Keymap for minibuffer confirmation of attribution strings.") - -(defvar sc-minibuffer-local-map - (let ((map (copy-keymap minibuffer-local-map))) - (define-key map "\C-t" #'sc-toggle-fn) - map) - "Keymap for minibuffer confirmation of attribution strings.") +(defvar-keymap sc-T-keymap + :doc "Keymap for sub-keymap of setting and toggling functions." + "a" #'sc-S-preferred-attribution-list + "b" #'sc-T-mail-nuke-blank-lines + "c" #'sc-T-confirm-always + "d" #'sc-T-downcase + "e" #'sc-T-electric-references + "f" #'sc-T-auto-fill-region + "h" #'sc-T-describe + "l" #'sc-S-cite-region-limit + "n" #'sc-S-mail-nuke-mail-headers + "N" #'sc-S-mail-header-nuke-list + "o" #'sc-T-electric-circular + "p" #'sc-S-preferred-header-style + "s" #'sc-T-nested-citation + "u" #'sc-T-use-only-preferences + "w" #'sc-T-fixup-whitespace + "?" #'sc-T-describe) + +(defvar-keymap sc-mode-map + :doc "Keymap for Supercite quasi-mode." + "c" #'sc-cite-region + "f" #'sc-mail-field-query + "g" #'sc-mail-process-headers + "h" #'sc-describe + "i" #'sc-insert-citation + "o" #'sc-open-line + "r" #'sc-recite-region + "C-p" #'sc-raw-mode-toggle + "u" #'sc-uncite-region + "w" #'sc-insert-reference + "C-t" sc-T-keymap + "?" #'sc-describe) + +(defvar-keymap sc-electric-mode-map + :doc "Keymap for `sc-electric-mode' electric references mode." + "p" #'sc-eref-prev + "n" #'sc-eref-next + "s" #'sc-eref-setn + "j" #'sc-eref-jump + "x" #'sc-eref-abort + "q" #'sc-eref-abort + "RET" #'sc-eref-exit + "C-j" #'sc-eref-exit + "g" #'sc-eref-goto + "?" #'describe-mode + "C-h" #'describe-mode + "" #'describe-mode + "" #'describe-mode) + + +(defvar-keymap sc-minibuffer-local-completion-map + :doc "Keymap for minibuffer confirmation of attribution strings." + :parent minibuffer-local-completion-map + "C-t" #'sc-toggle-fn + "SPC" #'self-insert-command) + +(defvar-keymap sc-minibuffer-local-map + :doc "Keymap for minibuffer confirmation of attribution strings." + :parent minibuffer-local-map + "C-t" #'sc-toggle-fn) ;; ====================================================================== commit 1c736c8c591979a9edaf350fa7d841d39f35ea58 Author: Stefan Kangas Date: Thu Aug 4 23:19:10 2022 +0200 Whitespace fix in gdb-mi.el * lisp/progmodes/gdb-mi.el (gdb-memory-next-page) (gdb-memory-prev-page): Change tab after "defvar" to space, to avoid potential bugs in tooling. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 940710f7c5..9c2c640525 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -126,9 +126,9 @@ Possible value: main, $rsp, x+3.") "Address of memory display.") (defvar-local gdb-memory-last-address nil "Last successfully accessed memory address.") -(defvar gdb-memory-next-page nil +(defvar gdb-memory-next-page nil "Address of next memory page for program memory buffer.") -(defvar gdb-memory-prev-page nil +(defvar gdb-memory-prev-page nil "Address of previous memory page for program memory buffer.") (defvar-local gdb--memory-display-warning nil "Display warning on memory header if t. commit d73a104dd349fdf8de5ababa9ae53ea807b00bfb Author: Stefan Kangas Date: Thu Aug 4 22:58:59 2022 +0200 Be more lax when picking up prefixes for loaddefs * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--compute-prefixes): Allow tabs and spaces before symbol name, so that "(defvar\tfoo-bar nil)" is properly picked up. Before this change, such a definition would be wrongly picked up as the symbol "nil". diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 52ec5ef680..afba9f8fbc 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -456,7 +456,7 @@ don't include." (let ((prefs nil)) ;; Avoid (defvar ) by requiring a trailing space. (while (re-search-forward - "^(\\(def[^ ]+\\) ['(]*\\([^' ()\"\n]+\\)[\n \t]" nil t) + "^(\\(def[^ \t]+\\)[ \t]+['(]*\\([^' ()\"\n]+\\)[\n \t]" nil t) (unless (member (match-string 1) autoload-ignored-definitions) (let ((name (match-string-no-properties 2))) (when (save-excursion commit 0b5dccc8b2f36d6d012cf792113de4a3b7b15334 Author: Andreas Schwab Date: Thu Aug 4 22:21:45 2022 +0200 * lisp/Makefile.in (distclean): Also remove loaddefs.elc. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index c11d9bbec9..fc05d39d2a 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -460,7 +460,7 @@ bootstrap-clean: rm -f $(AUTOGENEL) distclean: - -rm -f ./Makefile $(lisp)/loaddefs.el + -rm -f ./Makefile $(lisp)/loaddefs.el $(lisp)/loaddefs.elc maintainer-clean: distclean bootstrap-clean rm -f TAGS commit 5a79bb2aed617f5b0ecf8e20ec958682e72fcc75 Merge: b335e1a046 a95c5baa6a Author: Gregory Heytings Date: Thu Aug 4 21:19:36 2022 +0200 Merge branch 'feature/long-lines-improvements' commit b335e1a0469105bb55b9741ae3106dc0a6023ce2 Author: Peder O. Klingenberg Date: Thu Aug 4 20:27:56 2022 +0200 * lisp/org/org.el: Fix load of compiled or compressed org-loaddefs * lisp/org/org.el (eq): Fix load of compiled or compressed org-loaddefs (bug#56982). diff --git a/lisp/org/org.el b/lisp/org/org.el index e62ee3203b..8bb69e98ce 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -82,8 +82,8 @@ (or (eq this-command 'eval-buffer) (condition-case nil (load (concat (file-name-directory load-file-name) - "org-loaddefs.el") - nil t t t) + "org-loaddefs") + nil t nil t) (error (message "WARNING: No org-loaddefs.el file could be found from where org.el is loaded.") (sit-for 3) commit a08dd087e9460322cc39aa387a8bb2bf70ec1abd Author: Michael Albinus Date: Thu Aug 4 19:27:49 2022 +0200 Adapt Tramp for backward compatibility * lisp/net/tramp-compat.el (tramp-compat-auth-source-netrc-parse-all): New defalias. * lisp/net/tramp.el (tramp-parse-netrc): Use it. (Bug#56976) diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index e813533270..b83f9f0724 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -320,6 +320,16 @@ CONDITION can also be a list of error conditions." (lambda (string1 string2) (eq t (compare-strings string1 nil nil string2 nil nil t))))) +;; Function `auth-source-netrc-parse-all' is new in Emacs 29.1. +;; `netrc-parse' has been obsoleted in parallel. +(defalias 'tramp-compat-auth-source-netrc-parse-all + (if (fboundp 'auth-source-netrc-parse-all) + #'auth-source-netrc-parse-all + (lambda (&optional file) + (declare-function netrc-parse "netrc") + (autoload 'netrc-parse "netrc") + (netrc-parse 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 a35b9baaa8..dcc8c632f9 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3340,13 +3340,11 @@ Host is always \"localhost\"." (defun tramp-parse-netrc (filename) "Return a list of (user host) tuples allowed to access. User may be nil." - ;; The declaration is not sufficient at runtime, because netrc.el is - ;; not autoloaded. (mapcar (lambda (item) (and (assoc "machine" item) `(,(cdr (assoc "login" item)) ,(cdr (assoc "machine" item))))) - (auth-source-netrc-parse-all filename))) + (tramp-compat-auth-source-netrc-parse-all filename))) (defun tramp-parse-putty (registry-or-dirname) "Return a list of (user host) tuples allowed to access. commit 9b5c54a49df931116d85fdfb0b482b1a1074eaf5 Author: Lars Ingebrigtsen Date: Thu Aug 4 19:10:20 2022 +0200 Ensure that updated loaddefs files are byte-compiled * lisp/Makefile.in: Add autoloads as an ordering-only dependency to compile-main so that newly updated loaddefs files are byte-compiled. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 7c1f872939..c11d9bbec9 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -348,7 +348,11 @@ endif # Compile all the Elisp files that need it. Beware: it approximates # 'no-byte-compile', so watch out for false-positives! -compile-main: gen-lisp compile-clean main-first + +# The "autoloads" target has to run first, because it may generate new +# loaddefs files. But don't depend on it, because that might trigger +# unnecessary rebuilds. +compile-main: gen-lisp compile-clean main-first | autoloads @(cd $(lisp) && \ els=`echo "${SUBDIRS_REL} " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ for el in $$els; do \ commit e3edbf577b49bbff0527cd6f3242a98916947875 Author: Michael Albinus Date: Thu Aug 4 18:12:25 2022 +0200 Fix last Tramp change, especially for bug#56963 * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): Add missing space. * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): Use "cat", "echo -n" isn't portable. (Bug#56963) * lisp/net/tramp.el (tramp-file-name-unify): Unquote file name in time. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 1d35f2b2ff..ef0cc2d66c 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -521,7 +521,7 @@ Emacs dired can't find files." ;; file is created. Do it directly. (if (and (stringp start) (string-empty-p start)) (tramp-adb-send-command-and-check - v (format "echo -n \"\">%s" (tramp-shell-quote-argument localname))) + v (format "echo -n \"\" >%s" (tramp-shell-quote-argument localname))) (let ((tmpfile (tramp-compat-make-temp-file filename))) (when (and append (file-exists-p filename)) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index d88e388cd5..9e5347252a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3340,7 +3340,9 @@ implementation will be used." ;; file is created. Do it directly. (if (and (stringp start) (string-empty-p start)) (tramp-send-command - v (format "echo -n \"\">%s" (tramp-shell-quote-argument localname))) + v (format "cat <%s >%s" + (tramp-get-remote-null-device v) + (tramp-shell-quote-argument localname))) ;; Short track: if we are on the local host, we can run directly. (if (and (tramp-local-host-p v) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0446e5754a..a35b9baaa8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1487,21 +1487,21 @@ If nil, return `tramp-default-port'." (put #'tramp-file-name-port-or-default 'tramp-suppress-trace t) ;;;###tramp-autoload -(defun tramp-file-name-unify (vec &optional file) +(defun tramp-file-name-unify (vec &optional localname) "Unify VEC by removing localname and hop from `tramp-file-name' structure. -If FILE is a string, set it as localname. +If LOCALNAME is a string, set it as localname. Objects returned by this function compare `equal' if they refer to the same connection. Make a copy in order to avoid side effects." (when (tramp-file-name-p vec) (setq vec (copy-tramp-file-name vec)) (setf (tramp-file-name-localname vec) - (and (stringp file) + (and (stringp localname) ;; FIXME: This is a sanity check. When this error ;; doesn't happen for a while, it can be removed. - (or (file-name-absolute-p file) + (or (file-name-absolute-p localname) (tramp-error - vec 'file-error "File `%s' must be absolute" file)) - (directory-file-name (tramp-compat-file-name-unquote file))) + vec 'file-error "File `%s' must be absolute" localname)) + (tramp-compat-file-name-unquote (directory-file-name localname))) (tramp-file-name-hop vec) nil)) vec) commit bccb3abef7d627cfa1c5170cb0d30d0450284ec3 Author: Lars Ingebrigtsen Date: Thu Aug 4 17:46:14 2022 +0200 Suppress compilation warnings in netrc.el * lisp/obsolete/netrc.el (netrc-machine-user-or-password) (netrc-credentials): Suppress some warnings. diff --git a/lisp/obsolete/netrc.el b/lisp/obsolete/netrc.el index 9d3ae31514..f664a77a9b 100644 --- a/lisp/obsolete/netrc.el +++ b/lisp/obsolete/netrc.el @@ -164,7 +164,8 @@ default ports DEFAULTS to `netrc-machine'. MODE can be \"login\" or \"password\", suitable for passing to `netrc-get'." (let ((authinfo-list (if (stringp authinfo-file-or-list) - (netrc-parse authinfo-file-or-list) + (with-suppressed-warnings ((obsolete netrc-parse)) + (netrc-parse authinfo-file-or-list)) authinfo-file-or-list)) (ports (or ports '(nil))) (defaults (or defaults '(nil))) @@ -227,7 +228,8 @@ MODE can be \"login\" or \"password\", suitable for passing to "Return a user name/password pair. Port specifications will be prioritized in the order they are listed in the PORTS list." - (let ((list (netrc-parse)) + (let ((list (with-suppressed-warnings ((obsolete netrc-parse)) + (netrc-parse))) found) (if (not ports) (setq found (netrc-machine list machine)) commit 5d5ab3cacdaf56210038957873bd74883016e4e5 Author: Stefan Kangas Date: Thu Aug 4 17:35:20 2022 +0200 Document obsoletion of netrc-parse better * lisp/obsolete/netrc.el (netrc-parse): Add 'obsolete' declaration pointing to 'auth-source-netrc-parse-all' for documentation purposes. diff --git a/lisp/obsolete/netrc.el b/lisp/obsolete/netrc.el index e01c9daad6..9d3ae31514 100644 --- a/lisp/obsolete/netrc.el +++ b/lisp/obsolete/netrc.el @@ -53,6 +53,7 @@ (defun netrc-parse (&optional file) "Parse FILE and return a list of all entries in the file." + (declare (obsolete auth-source-netrc-parse-all "29.1")) (interactive "fFile to Parse: ") (unless file (setq file netrc-file)) commit 806f2d0294f7f9a132bd227c2d32ac9e2745009d Author: Stefan Kangas Date: Thu Aug 4 17:26:19 2022 +0200 Clean up output of make-command-summary slightly * lisp/makesum.el (make-command-summary): Don't print today's date or status messages. diff --git a/lisp/makesum.el b/lisp/makesum.el index 4084358ca9..4272ce23f8 100644 --- a/lisp/makesum.el +++ b/lisp/makesum.el @@ -32,7 +32,6 @@ "Make a summary of current key bindings in the buffer *Summary*. Previous contents of that buffer are killed first." (interactive) - (message "Making command summary...") ;; This puts a description of bindings in a buffer called *Help*. (save-window-excursion (describe-bindings)) @@ -68,8 +67,7 @@ Previous contents of that buffer are killed first." (forward-line -1) (point))))) (goto-char (point-min)) - (insert "Emacs command summary, " (substring (current-time-string) 0 10) - ".\n") + (insert "Emacs command summary\n") ;; Delete "key binding" and underlining of dashes. (delete-region (point) (progn (forward-line 2) (point))) (forward-line 1) ;Skip blank line @@ -79,8 +77,7 @@ Previous contents of that buffer are killed first." (goto-char (point-max))) (double-column beg (point)) (forward-line 1))) - (goto-char (point-min))))) - (message "Making command summary...done")) + (goto-char (point-min)))))) (defun double-column (start end) "Reformat buffer contents from START to END into two columns." commit cdaddc4d72730805365d83f9f8aea9f50ecf5fce Author: Lars Ingebrigtsen Date: Thu Aug 4 17:33:34 2022 +0200 Move netrc tests to auth-source-tests.el diff --git a/test/lisp/net/netrc-resources/authinfo b/test/lisp/auth-source-resources/authinfo similarity index 100% rename from test/lisp/net/netrc-resources/authinfo rename to test/lisp/auth-source-resources/authinfo diff --git a/test/lisp/net/netrc-resources/netrc-folding b/test/lisp/auth-source-resources/netrc-folding similarity index 100% rename from test/lisp/net/netrc-resources/netrc-folding rename to test/lisp/auth-source-resources/netrc-folding diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el index 41f8b6d8c9..a76e4fb0d2 100644 --- a/test/lisp/auth-source-tests.el +++ b/test/lisp/auth-source-tests.el @@ -27,7 +27,7 @@ ;;; Code: (require 'ert) -(eval-when-compile (require 'ert-x)) +(require 'ert-x) (require 'cl-lib) (require 'auth-source) (require 'secrets) @@ -410,5 +410,29 @@ machine c1 port c2 user c3 password c4\n" ;; this is actually the same as `auth-source-search'. (should (equal found expected))))) +(ert-deftest test-netrc-credentials () + (let ((data (auth-source-netrc-parse-all (ert-resource-file "authinfo")))) + (should data) + (let ((imap (seq-find (lambda (elem) + (equal (cdr (assoc "machine" elem)) + "imap.example.org")) + data))) + (should (equal (cdr (assoc "login" imap)) "jrh@example.org")) + (should (equal (cdr (assoc "password" imap)) "*foobar*"))) + (let ((imap (seq-find (lambda (elem) + (equal (cdr (assoc "machine" elem)) + "ftp.example.org")) + data))) + (should (equal (cdr (assoc "login" imap)) "jrh")) + (should (equal (cdr (assoc "password" imap)) "*baz*"))))) + +(ert-deftest test-netrc-credentials-2 () + (let ((data (auth-source-netrc-parse-all + (ert-resource-file "netrc-folding")))) + (should + (equal data + '((("machine" . "XM") ("login" . "XL") ("password" . "XP")) + (("machine" . "YM") ("login" . "YL") ("password" . "YP"))))))) + (provide 'auth-source-tests) ;;; auth-source-tests.el ends here diff --git a/test/lisp/net/netrc-resources/services b/test/lisp/net/netrc-resources/services deleted file mode 100644 index fd8a0348df..0000000000 --- a/test/lisp/net/netrc-resources/services +++ /dev/null @@ -1,6 +0,0 @@ -tcpmux 1/tcp # TCP port service multiplexer -smtp 25/tcp mail -http 80/tcp www # WorldWideWeb HTTP -kerberos 88/tcp kerberos5 krb5 kerberos-sec # Kerberos v5 -kerberos 88/udp kerberos5 krb5 kerberos-sec # Kerberos v5 -rtmp 1/ddp # Routing Table Maintenance Protocol diff --git a/test/lisp/net/netrc-tests.el b/test/lisp/net/netrc-tests.el deleted file mode 100644 index 8e83f405bc..0000000000 --- a/test/lisp/net/netrc-tests.el +++ /dev/null @@ -1,60 +0,0 @@ -;;; netrc-tests.el --- Tests for netrc.el -*- lexical-binding:t -*- - -;; Copyright (C) 2020-2022 Free Software Foundation, Inc. - -;; Author: Stefan Kangas - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Code: - -(require 'ert) -(require 'ert-x) -(require 'netrc) - -(ert-deftest test-netrc-parse-services () - (let ((netrc-services-file (ert-resource-file "services"))) - (should (equal (netrc-parse-services) - '(("tcpmux" 1 tcp) - ("smtp" 25 tcp) - ("http" 80 tcp) - ("kerberos" 88 tcp) - ("kerberos" 88 udp) - ("rtmp" 1 ddp)))))) - -(ert-deftest test-netrc-find-service-name () - (let ((netrc-services-file (ert-resource-file "services"))) - (should (equal (netrc-find-service-name 25) "smtp")) - (should (equal (netrc-find-service-name 88 'udp) "kerberos")) - (should-not (netrc-find-service-name 12345)))) - -(ert-deftest test-netrc-credentials () - (let ((netrc-file (ert-resource-file "authinfo"))) - (should (equal (netrc-credentials "imap.example.org") - '("jrh@example.org" "*foobar*"))) - (should (equal (netrc-credentials "ftp.example.org") - '("jrh" "*baz*"))))) - -(ert-deftest test-netrc-credentials-2 () - (let ((netrc-file (ert-resource-file "netrc-folding"))) - (should - (equal (netrc-parse netrc-file) - '((("machine" . "XM") ("login" . "XL") ("password" . "XP")) - (("machine" . "YM")) (("login" . "YL")) (("password" . "YP"))))))) - -(provide 'netrc-tests) - -;;; netrc-tests.el ends here commit 8810330f30ca1b251534106f9de7d5190c0cf633 Author: Lars Ingebrigtsen Date: Thu Aug 4 17:14:23 2022 +0200 Add obsolete-since header to netrc.el * lisp/obsolete/netrc.el: Add obsolete-since header (bug#56976). diff --git a/etc/NEWS b/etc/NEWS index 314fa870ed..2fb83e1923 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -356,6 +356,11 @@ Use something like 'M-x shell RET ssh RET' instead. ** The autoload.el library is now obsolete. It is superseded by the loaddefs-gen.el library. +--- +** The netrc.el library is now obsolete. +Use the 'auth-source-netrc-parse-all' function in auth-source.el +instead. + --- ** The url-dired.el library is now obsolete. diff --git a/lisp/obsolete/netrc.el b/lisp/obsolete/netrc.el index 2f38e22178..e01c9daad6 100644 --- a/lisp/obsolete/netrc.el +++ b/lisp/obsolete/netrc.el @@ -4,6 +4,9 @@ ;; Author: Lars Magne Ingebrigtsen ;; Keywords: news +;; Obsolete-since: 29.1 +;; +;; Instead of using `netrc-parse', use `auth-source-netrc-parse-all'. ;; ;; Modularized by Ted Zlatanov ;; when it was part of Gnus. commit 4483de6a4cf07beec86efb831b1ba93bab56eabe Author: Lars Ingebrigtsen Date: Thu Aug 4 17:12:05 2022 +0200 Move netrc.el to lisp/obsolete/ diff --git a/lisp/net/netrc.el b/lisp/obsolete/netrc.el similarity index 100% rename from lisp/net/netrc.el rename to lisp/obsolete/netrc.el commit 3bc7b5f412c52c099f0a16ab4d7bdf000293c164 Author: Lars Ingebrigtsen Date: Thu Aug 4 17:09:46 2022 +0200 Use auth-source in tramp-parse-netrc * lisp/auth-source.el (auth-source-netrc-parse-all): Autoload. * lisp/net/tramp.el (tramp-parse-netrc): Don't use netrc-parse, because it's going to be made obsolete (bug#56976). diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 48f9517683..f198362f10 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -909,6 +909,7 @@ Remove trailing \": \"." (defun auth-source--aget (alist key) (cdr (assoc key alist))) +;;;###autoload (defun auth-source-netrc-parse-all (file) "Parse FILE and return all entries." (auth-source-netrc-parse :file file :allow-null t)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index aac63882ce..0446e5754a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3342,12 +3342,11 @@ Host is always \"localhost\"." User may be nil." ;; The declaration is not sufficient at runtime, because netrc.el is ;; not autoloaded. - (autoload 'netrc-parse "netrc") (mapcar (lambda (item) (and (assoc "machine" item) `(,(cdr (assoc "login" item)) ,(cdr (assoc "machine" item))))) - (netrc-parse filename))) + (auth-source-netrc-parse-all filename))) (defun tramp-parse-putty (registry-or-dirname) "Return a list of (user host) tuples allowed to access. commit 22a2ad13f50f4a5f8e28ce93730d665a33964b80 Author: Lars Ingebrigtsen Date: Thu Aug 4 17:06:07 2022 +0200 Add obsolete-since line to autoload.el and adjust comments * lisp/obsolete/autoload.el: Add obsolete-since line. diff --git a/etc/NEWS b/etc/NEWS index ef3e1f0a55..314fa870ed 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -352,6 +352,10 @@ Use something like 'M-x shell RET ssh RET' instead. --- ** The url-about.el library is now obsolete. +--- +** The autoload.el library is now obsolete. +It is superseded by the loaddefs-gen.el library. + --- ** The url-dired.el library is now obsolete. diff --git a/lisp/obsolete/autoload.el b/lisp/obsolete/autoload.el index 6ad8e81363..a56f31629e 100644 --- a/lisp/obsolete/autoload.el +++ b/lisp/obsolete/autoload.el @@ -5,6 +5,7 @@ ;; Author: Roland McGrath ;; Keywords: maint ;; Package: emacs +;; Obsolete-since: 29.1 ;; This file is part of GNU Emacs. @@ -28,8 +29,7 @@ ;; Lisp source files in various useful ways. To learn more, read the ;; source; if you're going to use this, you'd better be able to. -;; The functions in this file have been largely superseded by -;; loaddefs-gen.el. +;; The functions in this file have been superseded by loaddefs-gen.el. ;;; Code: commit aa9eaac68e1a80c49932efbd3c62c53a812031ed Author: Lars Ingebrigtsen Date: Thu Aug 4 17:03:59 2022 +0200 Move autoload.el to lisp/obsolete/ diff --git a/lisp/emacs-lisp/autoload.el b/lisp/obsolete/autoload.el similarity index 100% rename from lisp/emacs-lisp/autoload.el rename to lisp/obsolete/autoload.el commit c4ce09c058c4097ad1f291ffcd766dc538908ed0 Author: Lars Ingebrigtsen Date: Thu Aug 4 17:03:14 2022 +0200 Adjust autoload require in cus-dep.el * lisp/cus-dep.el (loaddefs-gen): Don't require autoload, because none of the functions are used. diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index 47d2cac3be..bb07a0694a 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -37,7 +37,7 @@ ldefs-boot\\|cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)" "Regexp matching file names not to scan for `custom-make-dependencies'.") -(require 'autoload) +(require 'loaddefs-gen) ;; Hack workaround for bug#14384. ;; Define defcustom-mh as an alias for defcustom, etc. commit ac710e6a23f80fbb7c6a7e56fe2405ca357d0445 Author: Lars Ingebrigtsen Date: Thu Aug 4 16:55:21 2022 +0200 Don't require netrc in nnimap.el * lisp/gnus/nnimap.el (netrc): Don't require, since it's not used. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 746109f26f..17bbfda08f 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -34,7 +34,6 @@ (require 'gnus-util) (require 'gnus) (require 'nnoo) -(require 'netrc) (require 'utf7) (require 'nnmail) commit d92c11845a28f017d86471b523a3270e3345c707 Author: Lars Ingebrigtsen Date: Thu Aug 4 16:50:06 2022 +0200 Add new function auth-source-netrc-parse-all * lisp/auth-source.el (auth-source-netrc-parse-all): New function (bug#56976). (auth-source-netrc-parse): Partially revert behaviour in previous change -- require :allow-null to match. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 55dbaab3ee..48f9517683 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -909,10 +909,16 @@ Remove trailing \": \"." (defun auth-source--aget (alist key) (cdr (assoc key alist))) +(defun auth-source-netrc-parse-all (file) + "Parse FILE and return all entries." + (auth-source-netrc-parse :file file :allow-null t)) + ;; (auth-source-netrc-parse :file "~/.authinfo.gpg") (cl-defun auth-source-netrc-parse (&key file max host user port require - &allow-other-keys) - "Parse FILE and return a list of all entries in the file. + allow-null &allow-other-keys) + "Parse FILE and return a list of matching entries in the file. +If ALLOW-NULL, allow nil values of HOST, USER and PORT to match. + Note that the MAX parameter is used so we can exit the parse early." (if (listp file) ;; We got already parsed contents; just return it. @@ -928,7 +934,7 @@ Note that the MAX parameter is used so we can exit the parse early." (check (lambda (alist) (and alist (or - (null host) + (and allow-null (null host)) (auth-source-search-collection host (or @@ -936,7 +942,7 @@ Note that the MAX parameter is used so we can exit the parse early." (auth-source--aget alist "host") t))) (or - (null user) + (and allow-null (null user)) (auth-source-search-collection user (or @@ -945,7 +951,7 @@ Note that the MAX parameter is used so we can exit the parse early." (auth-source--aget alist "user") t))) (or - (null port) + (and allow-null (null port)) (auth-source-search-collection port (or commit f038695085d872124cbb87f2a0382d572014c540 Author: Lars Ingebrigtsen Date: Thu Aug 4 16:41:39 2022 +0200 Minor cleanups in autoload.el/loaddefs-gen.el * lisp/subr.el (package--builtin-versions): Adjust comments. * lisp/emacs-lisp/loaddefs-gen.el (no-update-autoloads): Moved here from autoload.el. * lisp/emacs-lisp/loaddefs-gen.el: Removed now that it's no longer used. * lisp/emacs-lisp/package.el (package-autoload-ensure-default-file): Don't warn about soon-to-be obsolete functon. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index eed88b6faf..6ad8e81363 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -267,12 +267,6 @@ if `autoload-timestamps' is non-nil, otherwise a fixed fake time is inserted)." (hack-local-variables)) (current-buffer))) -(defalias 'autoload-insert-section-header - #'loaddefs-generate--insert-section-header) - -(defvar no-update-autoloads nil - "File local variable to prevent scanning this file for autoload cookies.") - (defalias 'autoload-file-load-name #'loaddefs-generate--file-load-name) (defun generate-file-autoloads (file) diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 1bb58c102c..52ec5ef680 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -50,6 +50,9 @@ prefix, that will not be registered. But all other prefixes will be included.") (put 'autoload-compute-prefixes 'safe-local-variable #'booleanp) +(defvar no-update-autoloads nil + "File local variable to prevent scanning this file for autoload cookies.") + (defvar autoload-ignored-definitions '("define-obsolete-function-alias" "define-obsolete-variable-alias" @@ -493,27 +496,6 @@ If COMPILE, don't include a \"don't compile\" cookie." :inhibit-provide (not feature)) (buffer-string)))) -(defun loaddefs-generate--insert-section-header (outbuf autoloads - load-name file time) - "Insert into buffer OUTBUF the section-header line for FILE. -The header line lists the file name, its \"load name\", its autoloads, -and the time the FILE was last updated (the time is inserted only -if `autoload-timestamps' is non-nil, otherwise a fixed fake time is inserted)." - (insert "\f\n;;;### ") - (prin1 `(autoloads ,autoloads ,load-name ,file ,time) - outbuf) - (terpri outbuf) - ;; Break that line at spaces, to avoid very long lines. - ;; Make each sub-line into a comment. - (with-current-buffer outbuf - (save-excursion - (forward-line -1) - (while (not (eolp)) - (move-to-column 64) - (skip-chars-forward "^ \n") - (or (eolp) - (insert "\n" ";;;;;; ")))))) - ;;;###autoload (defun loaddefs-generate (dir output-file &optional excluded-files extra-data include-package-version diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 482de52f85..d2959f7728 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1024,7 +1024,9 @@ untar into a directory named DIR; otherwise, signal an error." (unless (file-exists-p file) (require 'autoload) (let ((coding-system-for-write 'utf-8-emacs-unix)) - (write-region (autoload-rubric file "package" nil) nil file nil 'silent))) + (with-suppressed-warnings ((obsolete autoload-rubric)) + (write-region (autoload-rubric file "package" nil) + nil file nil 'silent)))) file) (defvar autoload-timestamps) diff --git a/lisp/subr.el b/lisp/subr.el index 1b59db0604..2603b5ad25 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6638,7 +6638,7 @@ Also, \"-GIT\", \"-CVS\" and \"-NNN\" are treated as snapshot versions." (version-list-= (version-to-list v1) (version-to-list v2))) (defvar package--builtin-versions - ;; Mostly populated by loaddefs.el via autoload-builtin-package-versions. + ;; Mostly populated by loaddefs.el. (purecopy `((emacs . ,(version-to-list emacs-version)))) "Alist giving the version of each versioned builtin package. I.e. each element of the list is of the form (NAME . VERSION) where commit d15b67b108a72bbd0216b3eb3bd4e4dd0d1d7968 Author: Lars Ingebrigtsen Date: Thu Aug 4 16:29:47 2022 +0200 Minor checkdoc.el clean up * lisp/emacs-lisp/checkdoc.el (generate-autoload-cookie): This is no longer used, so remove reference. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 94ade5928f..ac589b82f8 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2360,8 +2360,6 @@ News agents may remove it" ;;; Comment checking engine ;; -(defvar generate-autoload-cookie) - (defun checkdoc-file-comments-engine () "Return a message list if this file does not match the Emacs standard. This checks for style only, such as the first line, Commentary:, commit 580976a82ce638c0502ab96e3c5e3a7919c7d871 Author: Lars Ingebrigtsen Date: Thu Aug 4 16:24:26 2022 +0200 Adjust admin/emacs for new autoloads * admin/emake: Adjust for new autoloads. diff --git a/admin/emake b/admin/emake index 6c778c85d4..9bebd34067 100755 --- a/admin/emake +++ b/admin/emake @@ -36,6 +36,7 @@ SCRAPE|\ INFO.*Scraping.*[.] ?\$|\ INFO.*Scraping.*done\$|\ GEN.*etc/DOC|\ +GEN.*autoloads|\ ^Waiting for git|\ ^Finding pointers|\ ^Using load-path|\ commit 262f57842adabe7ec1447be93b2bc7f8bcdd53b9 Author: Lars Ingebrigtsen Date: Thu Aug 4 16:09:48 2022 +0200 Allow auth-source-netrc-parse to return all lines * lisp/auth-source.el (auth-source-netrc-parse): If host/user/port is nil, don't require those to match. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index a36386101a..55dbaab3ee 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -925,27 +925,33 @@ Note that the MAX parameter is used so we can exit the parse early." (cached (cdr-safe (assoc file auth-source-netrc-cache))) (cached-mtime (plist-get cached :mtime)) (cached-secrets (plist-get cached :secret)) - (check (lambda(alist) + (check (lambda (alist) (and alist - (auth-source-search-collection - host - (or - (auth-source--aget alist "machine") - (auth-source--aget alist "host") - t)) - (auth-source-search-collection - user - (or - (auth-source--aget alist "login") - (auth-source--aget alist "account") - (auth-source--aget alist "user") - t)) - (auth-source-search-collection - port - (or - (auth-source--aget alist "port") - (auth-source--aget alist "protocol") - t)) + (or + (null host) + (auth-source-search-collection + host + (or + (auth-source--aget alist "machine") + (auth-source--aget alist "host") + t))) + (or + (null user) + (auth-source-search-collection + user + (or + (auth-source--aget alist "login") + (auth-source--aget alist "account") + (auth-source--aget alist "user") + t))) + (or + (null port) + (auth-source-search-collection + port + (or + (auth-source--aget alist "port") + (auth-source--aget alist "protocol") + t))) (or ;; the required list of keys is nil, or (null require) commit 0116c660c22eb8c13c0c6eddc8cf61db0c22ca7b Author: Lars Ingebrigtsen Date: Thu Aug 4 15:37:31 2022 +0200 Clean up nntp-send-authinfo after removing obsolete variable * lisp/gnus/nntp.el (netrc-parse, netrc-machine, netrc-get): Remove declarations. (nntp-send-authinfo): Now that `nntp-authinfo-file' is removed, don't parse the .authinfo file twice, but just rely on the auth-source functions (bug#56972). diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index b26afe6e78..29570fa8c9 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1133,11 +1133,6 @@ It will make innd servers spawn an nnrpd process to allow actual article reading." (nntp-send-command "^.*\n" "MODE READER")) -(declare-function netrc-parse "netrc" (&optional file)) -(declare-function netrc-machine "netrc" - (list machine &optional port defaultport)) -(declare-function netrc-get "netrc" (alist type)) - (defun nntp-send-authinfo (&optional send-if-force) "Send the AUTHINFO to the nntp server. It will look in the \"~/.authinfo\" file for matching entries. If @@ -1146,30 +1141,16 @@ and a password. If SEND-IF-FORCE, only send authinfo to the server if the .authinfo file has the FORCE token." - (require 'netrc) - (let* ((list (netrc-parse)) - (alist (netrc-machine list nntp-address "nntp")) - (auth-info + (let* ((auth-info (nth 0 (auth-source-search :max 1 :host (list nntp-address (nnoo-current-server 'nntp)) :port `("119" "nntp" ,(format "%s" nntp-port-number) "563" "nntps" "snews")))) (auth-user (plist-get auth-info :user)) - (auth-force (plist-get auth-info :force)) - (auth-passwd (auth-info-password auth-info)) - (force (or (netrc-get alist "force") - nntp-authinfo-force - auth-force)) - (user (or - ;; this is preferred to netrc-* - auth-user - (netrc-get alist "login") - nntp-authinfo-user)) - (passwd (or - ;; this is preferred to netrc-* - auth-passwd - (netrc-get alist "password")))) + (passwd (auth-info-password auth-info)) + (force (or nntp-authinfo-force (plist-get auth-info :force))) + (user (or auth-user nntp-authinfo-user))) (when (or (not send-if-force) force) (unless user commit 91298084965941f7e3d42d638eb52ebd2df5c509 Author: Lars Ingebrigtsen Date: Thu Aug 4 15:27:47 2022 +0200 Add define-keymap to autoload-ignored-definitions * lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions): Ignore `define-keymap', too (bug#56973). diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index e3408477b6..1bb58c102c 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -54,7 +54,7 @@ be included.") '("define-obsolete-function-alias" "define-obsolete-variable-alias" "define-category" - "define-key" "define-key-after" + "define-key" "define-key-after" "define-keymap" "defgroup" "defface" "defadvice" "def-edebug-spec" ;; Hmm... this is getting ugly: commit 385511f1a2492750106df0991229c90ea701d433 Author: Stefan Kangas Date: Thu Aug 4 14:55:08 2022 +0200 Add define-key-after to autoload-ignored-definitions * lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions): Add define-key-after and define-ibuffer-sorter. diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index c11eb3d7ab..e3408477b6 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -53,7 +53,8 @@ be included.") (defvar autoload-ignored-definitions '("define-obsolete-function-alias" "define-obsolete-variable-alias" - "define-category" "define-key" + "define-category" + "define-key" "define-key-after" "defgroup" "defface" "defadvice" "def-edebug-spec" ;; Hmm... this is getting ugly: @@ -64,7 +65,8 @@ be included.") "define-short-documentation-group" "def-edebug-elem-spec" "defvar-mode-local" - "define-ibuffer-column") + "define-ibuffer-column" + "define-ibuffer-sorter") "List of strings naming definitions to ignore for prefixes. More specifically those definitions will not be considered for the `register-definition-prefixes' call.") commit f484da5fcba2c362ef4511db9d11f825bcea16e4 (refs/remotes/origin/emacs-28) Author: Stefan Kangas Date: Thu Aug 4 14:58:08 2022 +0200 * doc/lispref/loading.texi (Autoload by Prefix): Fix typo. diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 18c22142fe..723b4dd20a 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -752,7 +752,7 @@ the corresponding list of files to load for it. Entries to this mapping are added by calls to @code{register-definition-prefixes} which are generated by @code{update-file-autoloads} (@pxref{Autoload}). Files which don't contain any definitions worth -loading (test files, for examples), should set +loading (test files, for example), should set @code{autoload-compute-prefixes} to @code{nil} as a file-local variable. commit 4d64c39fad481f2dc125aa4d207ab191bf697529 Author: Stefan Kangas Date: Thu Aug 4 14:48:44 2022 +0200 ; * lisp/org/ob-lilypond.el: Add FIXME. diff --git a/lisp/org/ob-lilypond.el b/lisp/org/ob-lilypond.el index 15538b5037..dd204d7f6b 100644 --- a/lisp/org/ob-lilypond.el +++ b/lisp/org/ob-lilypond.el @@ -36,6 +36,7 @@ (declare-function org-show-all "org" (&optional types)) +;; FIXME: Doesn't this rather belong in lilypond-mode.el? (defalias 'lilypond-mode 'LilyPond-mode) (add-to-list 'org-babel-tangle-lang-exts '("LilyPond" . "ly")) commit 7a7628df8e743e2e2bae890049a2849a62a507ab Author: Stefan Kangas Date: Thu Aug 4 14:45:42 2022 +0200 ; * lisp/progmodes/meta-mode.el: Delete some commented out code. diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 37dff599f2..30d37cf7ec 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -802,11 +802,6 @@ The environment marked is the one that contains point or follows point." (defvar meta-common-mode-map (let ((map (make-sparse-keymap))) - ;; Comment Paragraphs: - ;; (define-key map "\M-a" 'backward-sentence) - ;; (define-key map "\M-e" 'forward-sentence) - ;; (define-key map "\M-h" 'mark-paragraph) - ;; (define-key map "\M-q" 'fill-paragraph) ;; Navigation: (define-key map "\M-\C-a" 'meta-beginning-of-defun) (define-key map "\M-\C-e" 'meta-end-of-defun) @@ -823,10 +818,6 @@ The environment marked is the one that contains point or follows point." (define-key map "\C-c:" 'meta-uncomment-region) ;; Symbol Completion: (define-key map "\M-\t" 'completion-at-point) - ;; Shell Commands: - ;; (define-key map "\C-c\C-c" 'meta-command-file) - ;; (define-key map "\C-c\C-k" 'meta-kill-job) - ;; (define-key map "\C-c\C-l" 'meta-recenter-output) map) "Keymap used in Metafont or MetaPost mode.") @@ -851,10 +842,6 @@ The environment marked is the one that contains point or follows point." :active mark-active] "--" ["Complete Symbol" completion-at-point t] -; "--" -; ["Command on Buffer" meta-command-file t] -; ["Kill Job" meta-kill-job t] -; ["Recenter Output Buffer" meta-recenter-output-buffer t] )) commit 41a59fc6b5ca398db09d5620607f859b70d18994 Author: Stefan Kangas Date: Thu Aug 4 14:37:17 2022 +0200 Fix namespace problem in meta-mode.el * lisp/progmodes/meta-mode.el (meta-font-lock-match-declaration-item-and-skip-to-next): Rename from 'font-lock-match-meta-declaration-item-and-skip-to-next'. Retain old name as an obsolete alias. diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index f0fd23f3bc..37dff599f2 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -156,14 +156,14 @@ (cons (concat "\\<" type-keywords "\\>" "\\([ \t\f]+\\(\\sw+\\)\\)*") '((1 font-lock-type-face) - (font-lock-match-meta-declaration-item-and-skip-to-next + (meta-font-lock-match-declaration-item-and-skip-to-next (goto-char (match-end 1)) nil (1 font-lock-variable-name-face nil t)))) ;; argument declarations: expr, suffix, text, ... (cons (concat "\\<" args-keywords "\\>" "\\([ \t\f]+\\(\\sw+\\|\\s_+\\)\\)*") '((1 font-lock-type-face) - (font-lock-match-meta-declaration-item-and-skip-to-next + (meta-font-lock-match-declaration-item-and-skip-to-next (goto-char (match-end 1)) nil (1 font-lock-variable-name-face nil t)))) ;; special case of arguments: expr x of y @@ -193,8 +193,7 @@ )) "Default expressions to highlight in Metafont or MetaPost mode.") - -(defun font-lock-match-meta-declaration-item-and-skip-to-next (limit) +(defun meta-font-lock-match-declaration-item-and-skip-to-next (limit) ;; Match and move over Metafont/MetaPost declaration item after point. ;; ;; The expected syntax of an item is either "word" or "symbol", @@ -936,6 +935,10 @@ The environment marked is the one that contains point or follows point." (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list) (list "" 'ispell-complete-word)))) +(define-obsolete-function-alias + 'font-lock-match-meta-declaration-item-and-skip-to-next + #'meta-font-lock-match-declaration-item-and-skip-to-next "29.1") + (provide 'meta-mode) (run-hooks 'meta-mode-load-hook) commit e2eee46247ee9d2332844e5dcf787fb7e5f50067 Author: Stefan Kangas Date: Thu Aug 4 14:36:34 2022 +0200 Add more autoload-ignored-definitions * lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions): Add define-ibuffer-column. diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 8dd67ca993..c11eb3d7ab 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -63,7 +63,8 @@ be included.") "defun-rcirc-command" "define-short-documentation-group" "def-edebug-elem-spec" - "defvar-mode-local") + "defvar-mode-local" + "define-ibuffer-column") "List of strings naming definitions to ignore for prefixes. More specifically those definitions will not be considered for the `register-definition-prefixes' call.") commit 24e93505b97415cc9ef59afa4cc01c05c8693c9d Author: Philip Kaludercic Date: Thu Aug 4 14:20:58 2022 +0200 * eww.el (eww-browse): Raise error if there are no arguments diff --git a/lisp/net/eww.el b/lisp/net/eww.el index b7b2e08975..6ed0719eca 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -349,6 +349,8 @@ This can also be used on the command line directly: will start Emacs and browse the GNU web site." (interactive) + (unless command-line-args-left + (user-error "No URL given")) (eww (pop command-line-args-left))) commit a95c5baa6a556059a434b9973a4454d414c15928 (refs/remotes/origin/feature/long-lines-improvements) Author: Gregory Heytings Date: Thu Aug 4 11:57:27 2022 +0000 ; * src/keyboard.c (safe_run_hooks_maybe_narrowed): Fix broken merge. diff --git a/src/keyboard.c b/src/keyboard.c index a730dfe4fd..02e02448ff 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1907,9 +1907,9 @@ safe_run_hooks_maybe_narrowed (Lisp_Object hook, struct window *w) specbind (Qinhibit_quit, Qt); if (current_buffer->long_line_optimizations_p) - Fnarrow_to_region (make_fixnum (get_narrowed_begv (w, PT)), - make_fixnum (get_narrowed_zv (w, PT)), - Qt); + narrow_to_region_internal (make_fixnum (get_narrowed_begv (w, PT)), + make_fixnum (get_narrowed_zv (w, PT)), + true); run_hook_with_args (2, ((Lisp_Object []) {hook, hook}), safe_run_hook_funcall); unbind_to (count, Qnil); commit 9313551faed4e79691a781da4fdfeb791f80d4ea Author: Po Lu Date: Thu Aug 4 19:53:45 2022 +0800 ; * src/xterm.c (x_sync_init_fences): Fix number of fences announced. diff --git a/src/xterm.c b/src/xterm.c index 33e90603f8..2a453099ee 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6875,7 +6875,7 @@ x_sync_init_fences (struct frame *f) XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), dpyinfo->Xatom_net_wm_sync_fences, XA_CARDINAL, 32, PropModeReplace, - (unsigned char *) &output->sync_fences, 1); + (unsigned char *) &output->sync_fences, 2); } static void commit 7ac0e30701cd16072d8122919fff48ab5517864d Author: Stefan Kangas Date: Thu Aug 4 12:25:17 2022 +0200 * lisp/find-dired.el (lookfor-dired): Make obsolete. diff --git a/lisp/find-dired.el b/lisp/find-dired.el index fba5126133..be3d106912 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -1,7 +1,6 @@ ;;; find-dired.el --- run a `find' command and dired the output -*- lexical-binding: t -*- -;; Copyright (C) 1992, 1994-1995, 2000-2022 Free Software Foundation, -;; Inc. +;; Copyright (C) 1992-2022 Free Software Foundation, Inc. ;; Author: Roland McGrath , ;; Sebastian Kremer @@ -320,7 +319,7 @@ See `find-name-arg' to customize the arguments." ;; Date: 10 May 91 17:50:00 GMT ;; Organization: University of Waterloo -(defalias 'lookfor-dired 'find-grep-dired) +(define-obsolete-function-alias 'lookfor-dired #'find-grep-dired "29.1") ;;;###autoload (defun find-grep-dired (dir regexp) "Find files in DIR that contain matches for REGEXP and start Dired on output. commit e2b774e64a903e856356971c0fc3a3835d3883c1 Merge: 5e33712672 87ac0b945f Author: Gregory Heytings Date: Thu Aug 4 12:21:31 2022 +0200 Merge branch 'master' into feature/long-lines-improvements commit 759ccd7cba62e8414135c9e9a35576d15258ad5b Author: Stefan Kangas Date: Thu Aug 4 12:18:46 2022 +0200 Rename recently added macro to follow conventions * lisp/eshell/em-extpipe.el (eshell-extpipe--or-with-catch): Rename from 'em-extpipe--or-with-catch'. diff --git a/lisp/eshell/em-extpipe.el b/lisp/eshell/em-extpipe.el index 3db1dea595..7d81f27a18 100644 --- a/lisp/eshell/em-extpipe.el +++ b/lisp/eshell/em-extpipe.el @@ -49,7 +49,7 @@ (add-hook 'eshell-pre-rewrite-command-hook #'eshell-rewrite-external-pipeline -20 t)) -(defmacro em-extpipe--or-with-catch (&rest disjuncts) +(defmacro eshell-extpipe--or-with-catch (&rest disjuncts) "Evaluate DISJUNCTS like `or' but catch `eshell-incomplete'. If `eshell-incomplete' is thrown during the evaluation of a @@ -118,7 +118,7 @@ as though it were Eshell syntax." (if (re-search-forward pat next t) (throw 'found (match-beginning 1)) (goto-char next) - (while (em-extpipe--or-with-catch + (while (eshell-extpipe--or-with-catch (eshell-parse-lisp-argument) (eshell-parse-backslash) (eshell-parse-double-quote) commit bfdccfa141fa02f59a6b60fb92a1312feed823be Author: Stefan Kangas Date: Thu Aug 4 12:14:10 2022 +0200 Fix namespace problem in dired-aux.el * lisp/dired-aux.el (dired-minibuffer-default-add-shell-commands): Rename from 'minibuffer-default-add-dired-shell-commands'. Retain old name as an obsolete alias. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index bb24954386..c8de2669ea 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -760,7 +760,7 @@ with a prefix argument." (defvar dired-aux-files) -(defun minibuffer-default-add-dired-shell-commands () +(defun dired-minibuffer-default-add-shell-commands () "Return a list of all commands associated with current dired files. This function is used to add all related commands retrieved by `mailcap' to the end of the list of defaults just after the default value." @@ -787,7 +787,7 @@ offer a smarter default choice of shell command." (lambda () (setq-local dired-aux-files files) (setq-local minibuffer-default-add-function - #'minibuffer-default-add-dired-shell-commands)) + #'dired-minibuffer-default-add-shell-commands)) (setq prompt (format prompt (dired-mark-prompt arg files))) (if (functionp 'dired-guess-shell-command) (dired-mark-pop-up nil 'shell files @@ -3529,6 +3529,9 @@ in the Dired buffer." (setq model (vc-checkout-model backend only-files-list)))) (list backend files only-files-list state model))) +(define-obsolete-function-alias 'minibuffer-default-add-dired-shell-commands + #'dired-minibuffer-default-add-shell-commands "29.1") + (provide 'dired-aux) commit 87ac0b945f549008d56b42ba5582bbf468891a56 Author: Michael Albinus Date: Thu Aug 4 11:59:18 2022 +0200 Fix Tramp test * test/lisp/net/tramp-tests.el (tramp-test48-unload): Ignore autoload functions in `tramp-file-name' structure tests, since `tramp-file-name-handler' is also autoloaded. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 63ccd05a26..e2d4ed781b 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -7590,7 +7590,7 @@ Since it unloads Tramp, it shall be the last test to run." (should-not (cl--find-class 'tramp-file-name)) (mapatoms (lambda (x) - (and (functionp x) + (and (functionp x) (null (autoloadp (symbol-function x))) (string-match-p "tramp-file-name" (symbol-name x)) (ert-fail (format "Structure function `%s' still exists" x))))) commit f325b091c1589ec67347ac1ba82a1f82a7596093 Author: Stefan Kangas Date: Thu Aug 4 11:55:43 2022 +0200 ; * etc/NEWS: Announce obsoletion of url-about.el. diff --git a/etc/NEWS b/etc/NEWS index 7e8ed465eb..ef3e1f0a55 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -349,6 +349,9 @@ Use 'abbrev', 'skeleton' or 'tempo' instead. ** The rlogin.el library, and the 'rsh' command are now obsolete. Use something like 'M-x shell RET ssh RET' instead. +--- +** The url-about.el library is now obsolete. + --- ** The url-dired.el library is now obsolete. commit 5e33712672035473fd74e8da637b77dbf9a4eb31 Author: Eli Zaretskii Date: Thu Aug 4 12:47:32 2022 +0300 ; * src/composite.c (find_automatic_composition): Fix a typo. diff --git a/src/composite.c b/src/composite.c index 9e641722ca..a13839939b 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1606,7 +1606,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, ptrdiff_t backlim, slow. Pretend that the buffer is narrowed to make it fast. */ ptrdiff_t begv = get_closer_narrowed_begv (w, window_point (w)); if (pos > begv) - head = narrowed_begv; + head = begv; } tail = ZV; stop = GPT; commit 2aace68a0084f99d6ff2df005069b68b6d8e9899 Author: Stefan Kangas Date: Thu Aug 4 11:37:52 2022 +0200 Rename timep to type-break-timep * lisp/type-break.el (type-break-timep): Rename from 'timep'. Retain old name as an obsolete alias. diff --git a/lisp/type-break.el b/lisp/type-break.el index 320ccaf94a..bb6382cfe9 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el @@ -451,7 +451,7 @@ the variable of the same name." ;; file saving is left to auto-save )))))) -(defun timep (time) +(defun type-break-timep (time) "If TIME is a Lisp time value then return TIME, else return nil." (condition-case nil (and (float-time time) time) @@ -475,7 +475,7 @@ the variable of the same name." Return nil if the file is missing or if the time is not a Lisp time value." (let ((file (type-break-choose-file))) (if file - (timep ;; returns expected format, else nil + (type-break-timep ;; returns expected format, else nil (with-current-buffer (find-file-noselect file 'nowarn) (condition-case nil (save-excursion @@ -1143,6 +1143,8 @@ With optional non-nil ALL, force redisplay of all mode-lines." (and (get-buffer buffer-name) (kill-buffer buffer-name)))))) +(define-obsolete-function-alias 'timep 'type-break-timep "29.1") + (provide 'type-break) commit a53ee9928dd26f5745af8446cdfbedc229ca1e9a Author: Stefan Kangas Date: Thu Aug 4 11:32:26 2022 +0200 Fix namespace problem in mpc.el * lisp/mpc.el (mpc-tag-browser-tagtypes): Rename from 'tag-browser-tagtypes'. Retain old name as an obsolete alias. diff --git a/lisp/mpc.el b/lisp/mpc.el index 1464c36a91..ba95308bf6 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -1569,8 +1569,9 @@ when constructing the set of constraints." (mpc-tagbrowser-refresh) buf)))) -(defvar tag-browser-tagtypes - (lazy-completion-table tag-browser-tagtypes +(define-obsolete-variable-alias 'tag-browser-tagtypes 'mpc-tag-browser-tagtypes "29.1") +(defvar mpc-tag-browser-tagtypes + (lazy-completion-table mpc-tag-browser-tagtypes (lambda () (append '("Playlist" "Directory") (mpc-cmd-tagtypes))))) @@ -1581,7 +1582,7 @@ when constructing the set of constraints." (list (let ((completion-ignore-case t)) (intern - (completing-read "Tag: " tag-browser-tagtypes nil 'require-match))))) + (completing-read "Tag: " mpc-tag-browser-tagtypes nil 'require-match))))) (let* ((newbuf (mpc-tagbrowser-buf tag)) (win (get-buffer-window newbuf 0))) (if win (select-window win) commit 27b60ae061423c836d06a7a6349c6ab4397b2b41 Author: Stefan Kangas Date: Thu Aug 4 11:27:47 2022 +0200 Rename set-woman-file-regexp to woman-set-file-regexp * lisp/woman.el (woman-set-file-regexp): Rename from 'set-woman-file-regexp'. Retain old name as an obsolete alias. diff --git a/lisp/woman.el b/lisp/woman.el index d8743c7fac..23ce2218b5 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -781,7 +781,7 @@ Built automatically from the customizable user options (defvar woman-uncompressed-file-regexp) ; for the compiler (defvar woman-file-compression-regexp) ; for the compiler -(defun set-woman-file-regexp (symbol value) +(defun woman-set-file-regexp (symbol value) "Bind SYMBOL to VALUE and set `woman-file-regexp' as per user customizations. Used as :set cookie by Customize when customizing the user options `woman-uncompressed-file-regexp' and `woman-file-compression-regexp'." @@ -806,7 +806,7 @@ in the ncurses package include `toe.1m', `form.3x', etc. Note: an optional compression regexp will be appended, so this regexp MUST NOT end with any kind of string terminator such as $ or \\\\='." :type 'regexp - :set #'set-woman-file-regexp + :set #'woman-set-file-regexp :group 'woman-interface) (defcustom woman-file-compression-regexp @@ -822,7 +822,7 @@ Should begin with \\. and end with \\\\=' and MUST NOT be optional." ;; not loaded by default! :version "24.1" ; added xz :type 'regexp - :set #'set-woman-file-regexp + :set #'woman-set-file-regexp :group 'woman-interface) (defcustom woman-use-own-frame nil @@ -4580,11 +4580,11 @@ logging the message." (put 'woman-bookmark-jump 'bookmark-handler-type "WoMan") -;; Obsolete. - (defvar woman-version "0.551 (beta)" "WoMan version information.") (make-obsolete-variable 'woman-version 'emacs-version "28.1") +(define-obsolete-function-alias 'set-woman-file-regexp 'woman-set-file-regexp "29.1") + (provide 'woman) ;;; woman.el ends here commit bde0ccd2c2d29b818e27d90888da9e3cb36712aa Author: Stefan Kangas Date: Thu Aug 4 11:21:41 2022 +0200 Rename alphabetp to hangul-alphabetp * lisp/leim/quail/hangul.el (hangul-alphabetp): Rename from 'alphabetp'. Retain old name as an obsolete alias. diff --git a/lisp/leim/quail/hangul.el b/lisp/leim/quail/hangul.el index ef44e04a23..83fee1e04c 100644 --- a/lisp/leim/quail/hangul.el +++ b/lisp/leim/quail/hangul.el @@ -106,7 +106,7 @@ (declare (obsolete "use `(not (zerop ...))'." "29.1")) (not (zerop number))) -(defsubst alphabetp (char) +(defsubst hangul-alphabetp (char) (or (and (>= char ?A) (<= char ?Z)) (and (>= char ?a) (<= char ?z)))) @@ -389,7 +389,7 @@ When a Korean input method is off, convert the following hangul character." (defun hangul2-input-method (key) "2-Bulsik input method." - (if (or buffer-read-only (not (alphabetp key))) + (if (or buffer-read-only (not (hangul-alphabetp key))) (list key) (quail-setup-overlays nil) (let ((input-method-function nil) @@ -406,7 +406,7 @@ When a Korean input method is off, convert the following hangul character." (cond ((and (stringp seq) (= 1 (length seq)) (setq key (aref seq 0)) - (alphabetp key)) + (hangul-alphabetp key)) (hangul2-input-method-internal key)) ((commandp cmd) (call-interactively cmd)) @@ -547,6 +547,8 @@ HELP-TEXT is a text set in `hangul-input-method-help-text'." (with-output-to-temp-buffer "*Help*" (princ hangul-input-method-help-text))) +(define-obsolete-function-alias 'alphabetp 'hangul-alphabetp "29.1") + (provide 'hangul) ;; Local Variables: commit e2d9a218f4bd2a9e53422123280ca428c03abbc4 Author: Stefan Kangas Date: Thu Aug 4 10:54:22 2022 +0200 Make trivial convenience defsubst notzerop obsolete * lisp/leim/quail/hangul.el (notzerop): Make obsolete. Adjust callers. diff --git a/lisp/leim/quail/hangul.el b/lisp/leim/quail/hangul.el index 0ef5b2d5c7..ef44e04a23 100644 --- a/lisp/leim/quail/hangul.el +++ b/lisp/leim/quail/hangul.el @@ -103,6 +103,7 @@ (make-vector 6 0)) (defsubst notzerop (number) + (declare (obsolete "use `(not (zerop ...))'." "29.1")) (not (zerop number))) (defsubst alphabetp (char) @@ -191,10 +192,10 @@ and insert CHAR to new `hangul-queue'." (aset hangul-queue 0 char)) ((and (zerop (aref hangul-queue 1)) (zerop (aref hangul-queue 2)) - (notzerop (hangul-djamo 'cho (aref hangul-queue 0) char))) + (not (zerop (hangul-djamo 'cho (aref hangul-queue 0) char)))) (aset hangul-queue 1 char)) ((and (zerop (aref hangul-queue 4)) - (notzerop (aref hangul-queue 2)) + (not (zerop (aref hangul-queue 2))) (/= char 8) (/= char 19) (/= char 25) @@ -213,7 +214,7 @@ and insert CHAR to new `hangul-queue'." char))) (aset hangul-queue 4 char)) ((and (zerop (aref hangul-queue 5)) - (notzerop (hangul-djamo 'jong (aref hangul-queue 4) char)) + (not (zerop (hangul-djamo 'jong (aref hangul-queue 4) char))) (numberp (hangul-character (+ (aref hangul-queue 0) @@ -246,14 +247,14 @@ Other parts are the same as a `hangul2-input-method-jaum'." (aset hangul-queue 2 char)) ((and (zerop (aref hangul-queue 3)) (zerop (aref hangul-queue 4)) - (notzerop (hangul-djamo 'jung (aref hangul-queue 2) char))) + (not (zerop (hangul-djamo 'jung (aref hangul-queue 2) char)))) (aset hangul-queue 3 char))) (hangul-insert-character hangul-queue) (let ((next-char (vector 0 0 char 0 0 0))) - (cond ((notzerop (aref hangul-queue 5)) + (cond ((not (zerop (aref hangul-queue 5))) (aset next-char 0 (aref hangul-queue 5)) (aset hangul-queue 5 0)) - ((notzerop (aref hangul-queue 4)) + ((not (zerop (aref hangul-queue 4))) (aset next-char 0 (aref hangul-queue 4)) (aset hangul-queue 4 0))) (hangul-insert-character hangul-queue @@ -271,7 +272,7 @@ Other parts are the same as a `hangul2-input-method-jaum'." (aset hangul-queue 0 char)) ((and (zerop (aref hangul-queue 1)) (zerop (aref hangul-queue 2)) - (notzerop (hangul-djamo 'cho (aref hangul-queue 0) char))) + (not (zerop (hangul-djamo 'cho (aref hangul-queue 0) char)))) (aset hangul-queue 1 char))) (hangul-insert-character hangul-queue) (hangul-insert-character hangul-queue @@ -287,7 +288,7 @@ Other parts are the same as a `hangul3-input-method-cho'." (zerop (aref hangul-queue 4))) (aset hangul-queue 2 char)) ((and (zerop (aref hangul-queue 3)) - (notzerop (hangul-djamo 'jung (aref hangul-queue 2) char))) + (not (zerop (hangul-djamo 'jung (aref hangul-queue 2) char)))) (aset hangul-queue 3 char))) (hangul-insert-character hangul-queue) (hangul-insert-character hangul-queue @@ -300,8 +301,8 @@ This function processes a Hangul 3-Bulsik Jongseong. The Jongseong can be located in a Jongseong position. Other parts are the same as a `hangul3-input-method-cho'." (if (cond ((and (zerop (aref hangul-queue 4)) - (notzerop (aref hangul-queue 0)) - (notzerop (aref hangul-queue 2)) + (not (zerop (aref hangul-queue 0))) + (not (zerop (aref hangul-queue 2))) (numberp (hangul-character (+ (aref hangul-queue 0) @@ -317,7 +318,7 @@ Other parts are the same as a `hangul3-input-method-cho'." char))) (aset hangul-queue 4 char)) ((and (zerop (aref hangul-queue 5)) - (notzerop (hangul-djamo 'jong (aref hangul-queue 4) char)) + (not (zerop (hangul-djamo 'jong (aref hangul-queue 4) char))) (numberp (hangul-character (+ (aref hangul-queue 0) @@ -349,7 +350,7 @@ Other parts are the same as a `hangul3-input-method-cho'." (while (and (> i 0) (zerop (aref hangul-queue i))) (setq i (1- i))) (aset hangul-queue i 0)) - (if (notzerop (apply #'+ (append hangul-queue nil))) + (if (not (zerop (apply #'+ (append hangul-queue nil)))) (hangul-insert-character hangul-queue) (delete-char -1))) commit f39a220c95c2a38e70c6d8098593da75893dbf8b Author: Lars Ingebrigtsen Date: Thu Aug 4 11:27:13 2022 +0200 Regenerate ldefs-boot.el diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 8dbd8f9903..85985399db 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -1825,7 +1825,7 @@ The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG)" t nil) -(register-definition-prefixes "battery" '("battery-" "my-")) +(register-definition-prefixes "battery" '("battery-")) ;;; Generated autoloads from emacs-lisp/benchmark.el @@ -2865,7 +2865,7 @@ and corresponding effects. ;;; Generated autoloads from cedet/semantic/bovine/c.el -(register-definition-prefixes "semantic/bovine/c" '("c-mode" "semantic")) +(register-definition-prefixes "semantic/bovine/c" '("semantic")) ;;; Generated autoloads from calendar/cal-bahai.el @@ -4566,7 +4566,7 @@ it is disabled. ;;; Generated autoloads from emacs-lisp/cl-macs.el -(register-definition-prefixes "cl-macs" '("cl-" "foo" "function-form")) +(register-definition-prefixes "cl-macs" '("cl-")) ;;; Generated autoloads from emacs-lisp/cl-print.el @@ -5558,7 +5558,7 @@ Run `perldoc' on WORD. (fn WORD)" t nil) (autoload 'cperl-perldoc-at-point "cperl-mode" "\ Run a `perldoc' on the word around point." t nil) -(register-definition-prefixes "cperl-mode" '("cperl-" "pod2man-program")) +(register-definition-prefixes "cperl-mode" '("cperl-")) ;;; Generated autoloads from progmodes/cpp.el @@ -6289,12 +6289,12 @@ Create a new data-debug buffer with NAME. ;;; Generated autoloads from cedet/semantic/db-ebrowse.el -(register-definition-prefixes "semantic/db-ebrowse" '("c++-mode" "semanticdb-")) +(register-definition-prefixes "semantic/db-ebrowse" '("semanticdb-")) ;;; Generated autoloads from cedet/semantic/db-el.el -(register-definition-prefixes "semantic/db-el" '("emacs-lisp-mode" "semanticdb-")) +(register-definition-prefixes "semantic/db-el" '("semanticdb-")) ;;; Generated autoloads from cedet/semantic/db-file.el @@ -6314,7 +6314,7 @@ Create a new data-debug buffer with NAME. ;;; Generated autoloads from cedet/semantic/db-javascript.el -(register-definition-prefixes "semantic/db-javascript" '("javascript-mode" "semanticdb-")) +(register-definition-prefixes "semantic/db-javascript" '("semanticdb-")) ;;; Generated autoloads from cedet/semantic/db-mode.el @@ -7917,7 +7917,7 @@ it is disabled. (autoload 'doctor "doctor" "\ Switch to *doctor* buffer and start giving psychotherapy." t nil) -(register-definition-prefixes "doctor" '("doc" "make-doctor-variables")) +(register-definition-prefixes "doctor" '("doc")) ;;; Generated autoloads from cedet/srecode/document.el @@ -8632,7 +8632,7 @@ already is one.)" t nil) Toggle edebugging of all definitions." t nil) (autoload 'edebug-all-forms "edebug" "\ Toggle edebugging of all forms." t nil) -(register-definition-prefixes "edebug" '("arglist" "backquote-form" "def-declarations" "edebug" "function-form" "interactive" "lambda-" "name" "nested-backquote-form")) +(register-definition-prefixes "edebug" '("edebug")) ;;; Generated autoloads from vc/ediff.el @@ -9164,7 +9164,7 @@ Describe CTR if it is a class constructor. ;;; Generated autoloads from cedet/semantic/bovine/el.el -(register-definition-prefixes "semantic/bovine/el" '("emacs-lisp-mode" "semantic-")) +(register-definition-prefixes "semantic/bovine/el" '("semantic-")) ;;; Generated autoloads from emacs-lisp/eldoc.el @@ -9417,7 +9417,7 @@ displayed." t nil) ;;; Generated autoloads from eshell/em-unix.el -(register-definition-prefixes "em-unix" '("eshell" "nil-blank-string")) +(register-definition-prefixes "em-unix" '("eshell")) ;;; Generated autoloads from eshell/em-xtra.el @@ -11073,7 +11073,7 @@ Display the bookmarks." t nil) Default bookmark handler for EWW buffers. (fn BOOKMARK)" nil nil) -(register-definition-prefixes "eww" '("erc--download-directory" "eww-")) +(register-definition-prefixes "eww" '("eww-")) ;;; Generated autoloads from progmodes/executable.el @@ -19325,7 +19325,7 @@ Mairix will be called asynchronously unless ;;; Generated autoloads from cedet/semantic/bovine/make.el -(register-definition-prefixes "semantic/bovine/make" '("makefile-mode" "semantic-")) +(register-definition-prefixes "semantic/bovine/make" '("semantic-")) ;;; Generated autoloads from cedet/ede/make.el @@ -27825,7 +27825,7 @@ If SAME-WINDOW, don't pop to a new window. (fn GROUP &optional FUNCTION SAME-WINDOW)" t nil) (defalias 'shortdoc #'shortdoc-display-group) -(register-definition-prefixes "shortdoc" '("alist" "buffer" "file" "hash-table" "keymaps" "list" "number" "overlay" "process" "regexp" "sequence" "shortdoc-" "string" "text-properties" "vector")) +(register-definition-prefixes "shortdoc" '("shortdoc-")) ;;; Generated autoloads from net/shr.el @@ -32308,11 +32308,6 @@ how long to wait for a response before giving up. (fn URL &optional SILENT INHIBIT-COOKIES TIMEOUT)" nil nil) (register-definition-prefixes "url" '("url-")) - -;;; Generated autoloads from url/url-about.el - -(register-definition-prefixes "url-about" '("url-")) - ;;; Generated autoloads from url/url-auth.el commit 459b1b8fbc8fda5c136cb52b9a28ca2c3f321691 Author: Lars Ingebrigtsen Date: Thu Aug 4 11:27:03 2022 +0200 Add more autoload-ignored-definitions defs * lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions): Add more definition forms that shouldn't trigger prefix registration (bug#56970). diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 00b3bac53c..8dd67ca993 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -60,7 +60,10 @@ be included.") "define-widget" "define-erc-module" "define-erc-response-handler" - "defun-rcirc-command") + "defun-rcirc-command" + "define-short-documentation-group" + "def-edebug-elem-spec" + "defvar-mode-local") "List of strings naming definitions to ignore for prefixes. More specifically those definitions will not be considered for the `register-definition-prefixes' call.") commit 51b9d7d67297d8d406f5da424ec88ae184e87a04 Author: Lars Ingebrigtsen Date: Thu Aug 4 11:14:18 2022 +0200 url-about.el: Add obsolete-since * lisp/obsolete/url-about.el: Add obsolete-since. diff --git a/lisp/obsolete/url-about.el b/lisp/obsolete/url-about.el index a50986d511..608df3f2a5 100644 --- a/lisp/obsolete/url-about.el +++ b/lisp/obsolete/url-about.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2001-2022 Free Software Foundation, Inc. ;; Keywords: comm, data, processes, hypermedia +;; Obsolete-since: 29.1 ;; This file is part of GNU Emacs. ;; commit 4f3a33c90f0652363b1fd4c7870f95d9a02ae7e2 Author: Lars Ingebrigtsen Date: Thu Aug 4 11:13:48 2022 +0200 Make url-about.el obsolete (bug#56885) diff --git a/lisp/url/url-about.el b/lisp/obsolete/url-about.el similarity index 100% rename from lisp/url/url-about.el rename to lisp/obsolete/url-about.el commit 8348ace63a9c2cd039cad855784e2c352c3bb789 Author: Lars Ingebrigtsen Date: Thu Aug 4 11:09:40 2022 +0200 Revert "Fix about:protocols in EWW" This reverts commit b49c1740105dd3715315aa433674c95f44aaeac4. We're making this obsolete instead. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 0ee5ebff81..b7b2e08975 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -450,9 +450,6 @@ For more information, see Info node `(eww) Top'." ;; Don't mangle file: URLs at all. ((string-match-p "\\`ftp://" url) (user-error "FTP is not supported")) - ((string-match-p "\\`about:" url) - ;; Treat this as an about: url. (bug#56885) - url) (t ;; Anything that starts with something that vaguely looks ;; like a protocol designator is interpreted as a full URL. diff --git a/lisp/url/url-about.el b/lisp/url/url-about.el index ee94fde8b4..a50986d511 100644 --- a/lisp/url/url-about.el +++ b/lisp/url/url-about.el @@ -93,7 +93,7 @@ (if (fboundp func) (progn (set-buffer (generate-new-buffer " *about-data*")) - (insert "Content-type: text/html\n\n") + (insert "Content-type: text/plain\n\n") (funcall func url) (current-buffer)) (error "URL does not know about `%s'" item)))) diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index e2d28974b6..125f8436f6 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -237,32 +237,28 @@ request.") (if (not (url-p url-current-lastloc)) (setq url-current-lastloc (url-generic-parse-url url-current-lastloc))) (let ((referer (copy-sequence url-current-lastloc))) - ;; In the case of `url-about', there is actually no host. - (if (url-host referer) - (progn - (setf (url-host referer) (puny-encode-domain (url-host referer))) - (let ((referer-string (url-recreate-url referer))) - (when (and (not (memq url-privacy-level '(low high paranoid))) - (not (and (listp url-privacy-level) - (memq 'lastloc url-privacy-level)))) - ;; url-privacy-level allows referer. But url-lastloc-privacy-level - ;; may restrict who we send it to. - (cl-case url-lastloc-privacy-level - (host-match - (let ((referer-host (url-host referer)) - (url-host (url-host url))) - (when (string= referer-host url-host) - referer-string))) - (domain-match - (let ((referer-domain (url-domain referer)) - (url-domain (url-domain url))) - (when (and referer-domain - url-domain - (string= referer-domain url-domain)) - referer-string))) - (otherwise - referer-string))))) - nil)))) + (setf (url-host referer) (puny-encode-domain (url-host referer))) + (let ((referer-string (url-recreate-url referer))) + (when (and (not (memq url-privacy-level '(low high paranoid))) + (not (and (listp url-privacy-level) + (memq 'lastloc url-privacy-level)))) + ;; url-privacy-level allows referer. But url-lastloc-privacy-level + ;; may restrict who we send it to. + (cl-case url-lastloc-privacy-level + (host-match + (let ((referer-host (url-host referer)) + (url-host (url-host url))) + (when (string= referer-host url-host) + referer-string))) + (domain-match + (let ((referer-domain (url-domain referer)) + (url-domain (url-domain url))) + (when (and referer-domain + url-domain + (string= referer-domain url-domain)) + referer-string))) + (otherwise + referer-string))))))) ;; Building an HTTP request (defun url-http-user-agent-string () commit 82b602dc2f52775a4082d24d64380867da051350 Author: Gregory Heytings Date: Thu Aug 4 09:01:55 2022 +0000 Improve Bidi with long lines. * src/composite.c (composition_compute_stop_pos): Use an 'endpos' that is not too far away. (find_automatic_composition): Use a 'head' that is not too far away. Also make sure that this code path is not taken when long line optimizations are disabled. * src/dispextern.h (struct composition_it): Add a field that points to the parent iterator. * src/xdisp.c (init_iterator): Set it. diff --git a/src/composite.c b/src/composite.c index e721fe8c81..9e641722ca 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1021,7 +1021,11 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos, /* But we don't know where to stop the searching. */ endpos = NILP (string) ? BEGV - 1 : -1; /* Usually we don't reach ENDPOS because we stop searching - at an uncomposable character (NL, LRE, etc). */ + at an uncomposable character (NL, LRE, etc). In buffers + with long lines, however, NL might be far away, so + pretend that the buffer is smaller. */ + if (current_buffer->long_line_optimizations_p) + endpos = get_closer_narrowed_begv (cmp_it->parent_it->w, charpos); } } cmp_it->id = -1; @@ -1580,7 +1584,6 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, ptrdiff_t backlim, Lisp_Object window; struct window *w; bool need_adjustment = 0; - ptrdiff_t narrowed_begv; window = Fget_buffer_window (Fcurrent_buffer (), Qnil); if (NILP (window)) @@ -1597,11 +1600,14 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, ptrdiff_t backlim, } else head = backlim; - /* In buffers with very long lines, this function becomes very - slow. Pretend that the buffer is narrowed to make it fast. */ - narrowed_begv = get_narrowed_begv (w, window_point (w)); - if (pos > narrowed_begv) - head = narrowed_begv; + if (current_buffer->long_line_optimizations_p) + { + /* In buffers with very long lines, this function becomes very + slow. Pretend that the buffer is narrowed to make it fast. */ + ptrdiff_t begv = get_closer_narrowed_begv (w, window_point (w)); + if (pos > begv) + head = narrowed_begv; + } tail = ZV; stop = GPT; cur.pos_byte = CHAR_TO_BYTE (cur.pos); diff --git a/src/dispextern.h b/src/dispextern.h index 037e02ff58..12ba927261 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -2287,6 +2287,8 @@ struct composition_it reverse order, and thus the grapheme clusters must be rendered from the last to the first. */ bool reversed_p; + /* Parent iterator. */ + struct it *parent_it; /** The following members contain information about the current grapheme cluster. */ diff --git a/src/xdisp.c b/src/xdisp.c index 7d62c7823e..12f56227e4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3229,6 +3229,7 @@ init_iterator (struct it *it, struct window *w, it->f = XFRAME (w->frame); it->cmp_it.id = -1; + it->cmp_it.parent_it = it; if (max_redisplay_ticks > 0) update_redisplay_ticks (0, w); commit 3ec2fdc9a1c2162242c30788a932427198c27de2 Author: Lars Ingebrigtsen Date: Thu Aug 4 11:04:51 2022 +0200 Fix eww--download-directory naming * lisp/net/eww.el (eww--download-directory): (eww-download-directory): Rename function that was mistakenly named "erc--" (bug#56969). diff --git a/lisp/net/eww.el b/lisp/net/eww.el index beb8e0c45d..0ee5ebff81 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -64,7 +64,7 @@ The action to be taken can be further customized via :version "28.1" :type 'regexp) -(defun erc--download-directory () +(defun eww--download-directory () "Return the name of the download directory. If ~/Downloads/ exists, that will be used, and if not, the DOWNLOAD XDG user directory will be returned. If that's @@ -75,7 +75,7 @@ undefined, ~/Downloads/ is returned anyway." (file-name-as-directory dir)) "~/Downloads/")) -(defcustom eww-download-directory 'erc--download-directory +(defcustom eww-download-directory 'eww--download-directory "Directory where files will downloaded. This should either be a directory name or a function (called with no parameters) that returns a directory name." commit 4c1bc8315d8e677e4eeb2760d7a5ab7b7553359b Author: Lars Ingebrigtsen Date: Thu Aug 4 11:02:49 2022 +0200 Fix up some prefix registration problems in doc strings * lisp/uniquify.el (uniquify-buffer-name-style): * lisp/org/ob-core.el (org-src-sha): * lisp/emacs-lisp/cl-macs.el (cl--optimize): * lisp/battery.el (battery-update-functions): Avoid triggering the `register-definition-prefixes' in doc strings (bug#56968). diff --git a/lisp/battery.el b/lisp/battery.el index 3cff3167a6..93f4070e4b 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -255,14 +255,14 @@ of the following information may or may not be available: For instance, to play an alarm when the battery power dips below 10%, you could use a function like the following: -(defvar my-prev-battery nil) -(defun my-battery-alarm (data) - (when (and my-prev-battery - (equal (alist-get ?L data) \"off-line\") - (< (string-to-number (alist-get ?p data)) 10) - (>= (string-to-number (alist-get ?p my-prev-battery)) 10)) - (play-sound-file \"~/alarm.wav\" 5)) - (setq my-prev-battery data))" + (defvar my-prev-battery nil) + (defun my-battery-alarm (data) + (when (and my-prev-battery + (equal (alist-get ?L data) \"off-line\") + (< (string-to-number (alist-get ?p data)) 10) + (>= (string-to-number (alist-get ?p my-prev-battery)) 10)) + (play-sound-file \"~/alarm.wav\" 5)) + (setq my-prev-battery data))" :version "29.1" :type '(repeat function)) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 12917c99e1..eefaa36b91 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2563,9 +2563,9 @@ values. For compatibility, (cl-values A B C) is a synonym for (list A B C). (defun cl--optimize (f _args &rest qualities) "Serve `cl-optimize' in function declarations. Example: -(defun foo (x) - (declare (cl-optimize (speed 3) (safety 0))) - x)" + (defun foo (x) + (declare (cl-optimize (speed 3) (safety 0))) + x)" ;; FIXME this should make use of `cl--declare-stack' but I suspect ;; this mechanism should be reviewed first. (cl-loop for (qly val) in qualities diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 3d159ed38a..3b114703cd 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -488,13 +488,13 @@ arguments, imagine you'd like to set the file name output of a latex source block to a sha1 of its contents. We could achieve this with: -(defun org-src-sha () - (let ((elem (org-element-at-point))) - (concat (sha1 (org-element-property :value elem)) \".svg\"))) + (defun org-src-sha () + (let ((elem (org-element-at-point))) + (concat (sha1 (org-element-property :value elem)) \".svg\"))) -(setq org-babel-default-header-args:latex - `((:results . \"file link replace\") - (:file . (lambda () (org-src-sha))))) + (setq org-babel-default-header-args:latex + `((:results . \"file link replace\") + (:file . (lambda () (org-src-sha))))) Because the closure is evaluated with point at the source block, the call to `org-element-at-point' above will always retrieve diff --git a/lisp/uniquify.el b/lisp/uniquify.el index b75b47c03c..74655e299a 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -109,8 +109,8 @@ BASE and EXTRA-STRINGS where BASE is a string and EXTRA-STRINGS is a list of strings. For example the current implementation for post-forward-angle-brackets could be: -(defun my-post-forward-angle-brackets (base extra-string) - (concat base \"<\" (mapconcat #\\='identity extra-string \"/\") \">\")) + (defun my-post-forward-angle-brackets (base extra-string) + (concat base \"<\" (mapconcat #\\='identity extra-string \"/\") \">\")) The \"mumble\" part may be stripped as well, depending on the setting of `uniquify-strip-common-suffix'. For more options that commit f025005e8619ab42b43dad5dd470dbbbcdc75041 Author: Lars Ingebrigtsen Date: Thu Aug 4 09:45:50 2022 +0200 Fix double-encoding attachment headers in single-part rfc2047 * lisp/mail/rfc2047.el (rfc2047-header-encoding-alist): Don't double-encode Content-Disposition in mails with no other body (bug#56906). diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el index bb0d646346..67874d508b 100644 --- a/lisp/mail/rfc2047.el +++ b/lisp/mail/rfc2047.el @@ -45,6 +45,9 @@ '(("Newsgroups" . nil) ("Followup-To" . nil) ("Message-ID" . nil) + ;; This header must be pre-encoded by the MTA, so avoid + ;; double-encoding it. + ("Content-Disposition" . default) ("\\(Resent-\\)?\\(From\\|Cc\\|To\\|Bcc\\|\\(In-\\)?Reply-To\\|Sender\ \\|Mail-Followup-To\\|Mail-Copies-To\\|Approved\\|Disposition-Notification-To\\)" . address-mime) (t . mime)) commit 33611906e8e122a51489fbb9716e47062bc34cdb Author: Stefan Kangas Date: Thu Aug 4 09:48:48 2022 +0200 Rename make-doctor-variables to doctor-make-variables * lisp/play/doctor.el (doctor-make-variables): Rename from 'make-doctor-variables'. Retain old name as an obsolete function alias. diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el index fbff0b1bbb..f87068e113 100644 --- a/lisp/play/doctor.el +++ b/lisp/play/doctor.el @@ -1,7 +1,6 @@ ;;; doctor.el --- psychological help for frustrated users -*- lexical-binding: t -*- -;; Copyright (C) 1985, 1987, 1994, 1996, 2000-2022 Free Software -;; Foundation, Inc. +;; Copyright (C) 1985-2022 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org ;; Keywords: games @@ -136,14 +135,14 @@ Like Text mode with Auto Fill mode except that RET when point is after a newline, or LFD at any time, reads the sentence before point, and prints the Doctor's answer." :interactive nil - (make-doctor-variables) + (doctor-make-variables) (turn-on-auto-fill) (doctor-type '(i am the psychotherapist \. (doc$ doctor--please) (doc$ doctor--describe) your (doc$ doctor--problems) \. each time you are finished talking\, type \R\E\T twice \.)) (insert "\n")) -(defun make-doctor-variables () +(defun doctor-make-variables () (setq-local doctor--typos (mapcar (lambda (x) (put (car x) 'doctor-correction (cadr x)) @@ -1620,6 +1619,8 @@ Hack on previous word, setting global variable DOCTOR-OWNER to correct result." (defun doctor-chat () (doctor-type (doc$ doctor--chatlst))) +(define-obsolete-function-alias 'make-doctor-variables #'doctor-make-variables "29.1") + (provide 'doctor) ;;; doctor.el ends here commit 7471781dda49b927b4282fae24a4daab962c3266 Author: Stefan Kangas Date: Thu Aug 4 09:40:40 2022 +0200 Rename nil-blank-string to eshell-nil-blank-string * lisp/eshell/em-unix.el (eshell-nil-blank-string): Rename from 'nil-blank-string'. Retain old name as an obsolete function alias. diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 3967817b0e..68276b22d9 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -968,7 +968,7 @@ Show wall-clock time elapsed during execution of COMMAND.") (if eshell-diff-window-config (set-window-configuration eshell-diff-window-config))) -(defun nil-blank-string (string) +(defun eshell-nil-blank-string (string) "Return STRING, or nil if STRING contains only blank characters." (cond ((string-match "[^[:blank:]]" string) string) @@ -999,7 +999,7 @@ Show wall-clock time elapsed during execution of COMMAND.") (condition-case nil (diff-no-select old new - (nil-blank-string (eshell-flatten-and-stringify args))) + (eshell-nil-blank-string (eshell-flatten-and-stringify args))) (error (throw 'eshell-replace-command (eshell-parse-command "*diff" orig-args)))) @@ -1049,6 +1049,8 @@ Show wall-clock time elapsed during execution of COMMAND.") (put 'eshell/occur 'eshell-no-numeric-conversions t) +(define-obsolete-function-alias 'nil-blank-string #'eshell-nil-blank-string "29.1") + (provide 'em-unix) ;; Local Variables: commit d056bb0d9937790916e79a55f35307b58769573b Author: Stefan Kangas Date: Thu Aug 4 09:37:19 2022 +0200 Rename pod2man-program to cperl-pod2man-program * lisp/progmodes/cperl-mode.el (cperl-pod2man-program): Rename from 'pod2man-program'. Retain old name as an obsolete variable alias. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ab70d574c5..c6235d9013 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -8415,10 +8415,12 @@ the appropriate statement modifier." (interactive) (cperl-perldoc (cperl-word-at-point))) -(defcustom pod2man-program "pod2man" +(define-obsolete-variable-alias 'pod2man-program 'cperl-pod2man-program "29.1") +(defcustom cperl-pod2man-program "pod2man" "File name for `pod2man'." :type 'file - :group 'cperl) + :group 'cperl + :version "29.1") ;; By Nick Roberts (with changes) (defun cperl-pod-to-manpage () @@ -8437,7 +8439,6 @@ the appropriate statement modifier." (format (cperl-pod2man-build-command) pod2man-args)) 'Man-bgproc-sentinel))))) -;; Updated version by him too (defun cperl-build-manpage () "Create a virtual manpage in Emacs from the POD in the file." (interactive) commit b49c1740105dd3715315aa433674c95f44aaeac4 Author: Po Lu Date: Thu Aug 4 15:52:03 2022 +0800 Fix about:protocols in EWW * lisp/net/eww.el (eww--dwim-expand-url): Handle `about: ' URLs. (bug#56885) * lisp/url/url-about.el (url-about): Return correct content type for HTML data. * lisp/url/url-http.el (url-http--get-referer): Refrain from looking for a referrer if the lastloc had no host. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 4dbd5de2ef..beb8e0c45d 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -450,6 +450,9 @@ For more information, see Info node `(eww) Top'." ;; Don't mangle file: URLs at all. ((string-match-p "\\`ftp://" url) (user-error "FTP is not supported")) + ((string-match-p "\\`about:" url) + ;; Treat this as an about: url. (bug#56885) + url) (t ;; Anything that starts with something that vaguely looks ;; like a protocol designator is interpreted as a full URL. diff --git a/lisp/url/url-about.el b/lisp/url/url-about.el index a50986d511..ee94fde8b4 100644 --- a/lisp/url/url-about.el +++ b/lisp/url/url-about.el @@ -93,7 +93,7 @@ (if (fboundp func) (progn (set-buffer (generate-new-buffer " *about-data*")) - (insert "Content-type: text/plain\n\n") + (insert "Content-type: text/html\n\n") (funcall func url) (current-buffer)) (error "URL does not know about `%s'" item)))) diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 125f8436f6..e2d28974b6 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -237,28 +237,32 @@ request.") (if (not (url-p url-current-lastloc)) (setq url-current-lastloc (url-generic-parse-url url-current-lastloc))) (let ((referer (copy-sequence url-current-lastloc))) - (setf (url-host referer) (puny-encode-domain (url-host referer))) - (let ((referer-string (url-recreate-url referer))) - (when (and (not (memq url-privacy-level '(low high paranoid))) - (not (and (listp url-privacy-level) - (memq 'lastloc url-privacy-level)))) - ;; url-privacy-level allows referer. But url-lastloc-privacy-level - ;; may restrict who we send it to. - (cl-case url-lastloc-privacy-level - (host-match - (let ((referer-host (url-host referer)) - (url-host (url-host url))) - (when (string= referer-host url-host) - referer-string))) - (domain-match - (let ((referer-domain (url-domain referer)) - (url-domain (url-domain url))) - (when (and referer-domain - url-domain - (string= referer-domain url-domain)) - referer-string))) - (otherwise - referer-string))))))) + ;; In the case of `url-about', there is actually no host. + (if (url-host referer) + (progn + (setf (url-host referer) (puny-encode-domain (url-host referer))) + (let ((referer-string (url-recreate-url referer))) + (when (and (not (memq url-privacy-level '(low high paranoid))) + (not (and (listp url-privacy-level) + (memq 'lastloc url-privacy-level)))) + ;; url-privacy-level allows referer. But url-lastloc-privacy-level + ;; may restrict who we send it to. + (cl-case url-lastloc-privacy-level + (host-match + (let ((referer-host (url-host referer)) + (url-host (url-host url))) + (when (string= referer-host url-host) + referer-string))) + (domain-match + (let ((referer-domain (url-domain referer)) + (url-domain (url-domain url))) + (when (and referer-domain + url-domain + (string= referer-domain url-domain)) + referer-string))) + (otherwise + referer-string))))) + nil)))) ;; Building an HTTP request (defun url-http-user-agent-string () commit 78129dcf53ab2b1ce49eab28dba89dea9f687284 Author: Po Lu Date: Thu Aug 4 15:37:54 2022 +0800 Correctly implement refresh synchronization fences * configure.ac (HAVE_XSYNC): Also check for XSyncTriggerFence. * src/xfns.c (Fx_create_frame): Create fences. * src/xterm.c (x_atom_refs): New atom. (x_sync_trigger_fence, x_sync_init_fences, x_sync_free_fences): New functions. (x_sync_update_finish): Trigger the appropriate fence. (x_free_frame_resources): Free fences. * src/xterm.h (struct x_display_info): New atom `_NET_WM_SYNC_FENCES'. (struct x_output): New field `sync_fences'. diff --git a/configure.ac b/configure.ac index 87c126ecbb..1a264275bd 100644 --- a/configure.ac +++ b/configure.ac @@ -4675,6 +4675,10 @@ if test "${HAVE_X11}" = "yes"; then AC_DEFINE([HAVE_XSYNC], [1], [Define to 1 if the X Synchronization Extension is available.]) XSYNC_LIBS="-lXext" + OLDLIBS="$LIBS" + LIBS="-lXext $LIBS" # Set this temporarily for AC_CHECK_FUNC + AC_CHECK_FUNCS([XSyncTriggerFence]) # Check for version 3.1 + LIBS="$OLDLIBS" fi fi AC_SUBST([XSYNC_LIBS]) diff --git a/src/xfns.c b/src/xfns.c index 614a5b3455..672097c0d8 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5157,6 +5157,10 @@ This function is an internal primitive--use `make-frame' instead. */) (unsigned char *) &counters, ((STRINGP (value) && !strcmp (SSDATA (value), "extended")) ? 2 : 1)); + +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK + x_sync_init_fences (f); +#endif #endif } #endif diff --git a/src/xterm.c b/src/xterm.c index 7e304bcd6e..33e90603f8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -997,6 +997,7 @@ static const struct x_atom_ref x_atom_refs[] = ATOM_REFS_INIT ("_NET_WORKAREA", Xatom_net_workarea) ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST", Xatom_net_wm_sync_request) ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST_COUNTER", Xatom_net_wm_sync_request_counter) + ATOM_REFS_INIT ("_NET_WM_SYNC_FENCES", Xatom_net_wm_sync_fences) ATOM_REFS_INIT ("_NET_WM_FRAME_DRAWN", Xatom_net_wm_frame_drawn) ATOM_REFS_INIT ("_NET_WM_FRAME_TIMINGS", Xatom_net_wm_frame_timings) ATOM_REFS_INIT ("_NET_WM_USER_TIME", Xatom_net_wm_user_time) @@ -6812,6 +6813,85 @@ x_sync_update_begin (struct frame *f) FRAME_X_COUNTER_VALUE (f)); } +#ifdef HAVE_XSYNCTRIGGERFENCE + +/* Trigger the sync fence for counter VALUE immediately before a frame + finishes. */ + +static void +x_sync_trigger_fence (struct frame *f, XSyncValue value) +{ + uint64_t n, low, high, idx; + + /* Sync fences aren't supported by the X server. */ + if (FRAME_DISPLAY_INFO (f)->xsync_major < 3 + || (FRAME_DISPLAY_INFO (f)->xsync_major == 3 + && FRAME_DISPLAY_INFO (f)->xsync_minor < 1)) + return; + + low = XSyncValueLow32 (value); + high = XSyncValueHigh32 (value); + + n = low | (high << 32); + idx = (n / 4) % 2; + +#ifdef FRAME_DEBUG + fprintf (stderr, "Triggering synchonization fence: %lu\n", idx); +#endif + + XSyncTriggerFence (FRAME_X_DISPLAY (f), + FRAME_X_OUTPUT (f)->sync_fences[idx]); +} + +/* Initialize the sync fences on F. */ + +void +x_sync_init_fences (struct frame *f) +{ + struct x_output *output; + struct x_display_info *dpyinfo; + + output = FRAME_X_OUTPUT (f); + dpyinfo = FRAME_DISPLAY_INFO (f); + + /* Sync fences aren't supported by the X server. */ + if (dpyinfo->xsync_major < 3 + || (dpyinfo->xsync_major == 3 + && dpyinfo->xsync_minor < 1)) + return; + + output->sync_fences[0] + = XSyncCreateFence (FRAME_X_DISPLAY (f), + /* The drawable given below is only used to + determine the screen on which the fence is + created. */ + FRAME_X_WINDOW (f), + False); + output->sync_fences[1] + = XSyncCreateFence (FRAME_X_DISPLAY (f), + FRAME_X_WINDOW (f), + False); + + XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), + dpyinfo->Xatom_net_wm_sync_fences, XA_CARDINAL, + 32, PropModeReplace, + (unsigned char *) &output->sync_fences, 1); +} + +static void +x_sync_free_fences (struct frame *f) +{ + if (FRAME_X_OUTPUT (f)->sync_fences[0] != None) + XSyncDestroyFence (FRAME_X_DISPLAY (f), + FRAME_X_OUTPUT (f)->sync_fences[0]); + + if (FRAME_X_OUTPUT (f)->sync_fences[1] != None) + XSyncDestroyFence (FRAME_X_DISPLAY (f), + FRAME_X_OUTPUT (f)->sync_fences[1]); +} + +#endif + /* Tell the compositing manager that FRAME has been drawn and can be updated. */ @@ -6844,12 +6924,15 @@ x_sync_update_finish (struct frame *f) if (overflow) XSyncIntToValue (&FRAME_X_COUNTER_VALUE (f), 0); + /* Trigger any sync fences if necessary. */ +#ifdef HAVE_XSYNCTRIGGERFENCE + x_sync_trigger_fence (f, FRAME_X_COUNTER_VALUE (f)); +#endif + XSyncSetCounter (FRAME_X_DISPLAY (f), FRAME_X_EXTENDED_COUNTER (f), FRAME_X_COUNTER_VALUE (f)); - /* FIXME: this leads to freezes if the compositing manager crashes - in the meantime. */ if (FRAME_OUTPUT_DATA (f)->use_vsync_p) FRAME_X_WAITING_FOR_DRAW (f) = true; } @@ -26282,6 +26365,11 @@ x_free_frame_resources (struct frame *f) XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->bottom_edge_cursor); if (f->output_data.x->bottom_left_corner_cursor != 0) XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->bottom_left_corner_cursor); + + /* Free sync fences. */ +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK + x_sync_free_fences (f); +#endif } #ifdef HAVE_GTK3 diff --git a/src/xterm.h b/src/xterm.h index fb099e92ea..c1a944d3cd 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -614,9 +614,9 @@ struct x_display_info Xatom_net_wm_state_shaded, Xatom_net_frame_extents, Xatom_net_current_desktop, Xatom_net_workarea, Xatom_net_wm_opaque_region, Xatom_net_wm_ping, Xatom_net_wm_sync_request, Xatom_net_wm_sync_request_counter, - Xatom_net_wm_frame_drawn, Xatom_net_wm_frame_timings, Xatom_net_wm_user_time, - Xatom_net_wm_user_time_window, Xatom_net_client_list_stacking, - Xatom_net_wm_pid; + Xatom_net_wm_sync_fences, Xatom_net_wm_frame_drawn, Xatom_net_wm_frame_timings, + Xatom_net_wm_user_time, Xatom_net_wm_user_time_window, + Xatom_net_client_list_stacking, Xatom_net_wm_pid; /* XSettings atoms and windows. */ Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; @@ -1077,6 +1077,13 @@ struct x_output /* A temporary time used to calculate that value. */ uint64_t temp_frame_time; + +#ifdef HAVE_XSYNCTRIGGERFENCE + /* An array of two sync fences that are triggered in order after a + frame completes. Not initialized if the XSync extension is too + old to support sync fences. */ + XSyncFence sync_fences[2]; +#endif #endif #endif @@ -1516,6 +1523,9 @@ extern void x_make_frame_invisible (struct frame *); extern void x_iconify_frame (struct frame *); extern void x_free_frame_resources (struct frame *); extern void x_wm_set_size_hint (struct frame *, long, bool); +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK +extern void x_sync_init_fences (struct frame *); +#endif extern void x_delete_terminal (struct terminal *); extern Cursor x_create_font_cursor (struct x_display_info *, int); commit c6b5726130e9c3c297747a47c267dad5e8da4f52 Author: Gregory Heytings Date: Mon Aug 1 16:46:09 2022 +0000 ; * src/xdisp.c (get_visually_first_element): Fix last change. diff --git a/src/xdisp.c b/src/xdisp.c index 264fbaea59..7d62c7823e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8891,7 +8891,7 @@ get_visually_first_element (struct it *it) find_newline_no_quit (IT_CHARPOS (*it), IT_BYTEPOS (*it), -1, &it->bidi_it.bytepos), - get_closer_narrowed_begv (it->w, IT_CHARPOS (*it))); + it->narrowed_begv); bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, true); do { commit e0870fb8742d8f4fd4d2fc0ede6b4b6ae1036c38 Author: Eli Zaretskii Date: Mon Aug 1 19:13:16 2022 +0300 * src/xdisp.c (get_visually_first_element): Fix a typo. diff --git a/src/xdisp.c b/src/xdisp.c index c4abe6e985..264fbaea59 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8846,7 +8846,7 @@ get_visually_first_element (struct it *it) SET_WITH_NARROWED_BEGV (it, bob, string_p ? 0 : - IT_BYTEPOS (*it) < BEGV ? obegv : BEGV, + IT_CHARPOS (*it) < BEGV ? obegv : BEGV, it->narrowed_begv); if (STRINGP (it->string)) commit 5dc65c10ca1a2504699ad5374fedb127960946c8 Author: Gregory Heytings Date: Mon Aug 1 15:52:12 2022 +0000 Various improvements to long lines handling. * src/xdisp.c (get_visually_first_element, (move_it_vertically_backward): Do not go back too far with bidi. (get_narrowed_begv): Do not return 0 anymore instead of BEGV. (handle_fontified_prop): Simplify accordingly. * src/keyboard.c (safe_run_hooks_maybe_narrowed): Simplify accordingly. * src/composite.c (find_automatic_composition): Ditto. diff --git a/src/composite.c b/src/composite.c index 0f90b92a78..e721fe8c81 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1600,7 +1600,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, ptrdiff_t backlim, /* In buffers with very long lines, this function becomes very slow. Pretend that the buffer is narrowed to make it fast. */ narrowed_begv = get_narrowed_begv (w, window_point (w)); - if (narrowed_begv && pos > narrowed_begv) + if (pos > narrowed_begv) head = narrowed_begv; tail = ZV; stop = GPT; diff --git a/src/keyboard.c b/src/keyboard.c index 094119340e..a730dfe4fd 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1907,12 +1907,9 @@ safe_run_hooks_maybe_narrowed (Lisp_Object hook, struct window *w) specbind (Qinhibit_quit, Qt); if (current_buffer->long_line_optimizations_p) - { - ptrdiff_t begv = get_narrowed_begv (w, PT); - ptrdiff_t zv = get_narrowed_zv (w, PT); - if (!begv) begv = BEGV; - Fnarrow_to_region (make_fixnum (begv), make_fixnum (zv), Qt); - } + Fnarrow_to_region (make_fixnum (get_narrowed_begv (w, PT)), + make_fixnum (get_narrowed_zv (w, PT)), + Qt); run_hook_with_args (2, ((Lisp_Object []) {hook, hook}), safe_run_hook_funcall); unbind_to (count, Qnil); diff --git a/src/xdisp.c b/src/xdisp.c index c6fc05b8b4..c4abe6e985 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3507,9 +3507,7 @@ ptrdiff_t get_narrowed_begv (struct window *w, ptrdiff_t pos) { int len = get_narrowed_len (w); - ptrdiff_t begv; - begv = max ((pos / len - 1) * len, BEGV); - return begv == BEGV ? 0 : begv; + return max ((pos / len - 1) * len, BEGV); } ptrdiff_t @@ -4394,13 +4392,12 @@ handle_fontified_prop (struct it *it) if (current_buffer->long_line_optimizations_p) { - ptrdiff_t begv = it->narrowed_begv ? it->narrowed_begv : BEGV; + ptrdiff_t begv = it->narrowed_begv; ptrdiff_t zv = it->narrowed_zv; ptrdiff_t charpos = IT_CHARPOS (*it); if (charpos < begv || charpos > zv) { begv = get_narrowed_begv (it->w, charpos); - if (!begv) begv = BEGV; zv = get_narrowed_zv (it->w, charpos); } Fnarrow_to_region (make_fixnum (begv), make_fixnum (zv), Qt); @@ -8894,7 +8891,7 @@ get_visually_first_element (struct it *it) find_newline_no_quit (IT_CHARPOS (*it), IT_BYTEPOS (*it), -1, &it->bidi_it.bytepos), - it->narrowed_begv); + get_closer_narrowed_begv (it->w, IT_CHARPOS (*it))); bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, true); do { @@ -10784,7 +10781,7 @@ move_it_vertically_backward (struct it *it, int dy) dec_both (&cp, &bp); SET_WITH_NARROWED_BEGV (it, cp, find_newline_no_quit (cp, bp, -1, NULL), - it->narrowed_begv); + get_closer_narrowed_begv (it->w, IT_CHARPOS (*it))); move_it_to (it, cp, -1, -1, -1, MOVE_TO_POS); } bidi_unshelve_cache (it3data, true); commit 38d970b748a23d3b8dad6feef8e392f1d6d3c9e5 Author: Gregory Heytings Date: Mon Aug 1 15:01:15 2022 +0000 ; * src/xdisp.c (reseat): Improve recomputations. diff --git a/src/xdisp.c b/src/xdisp.c index 9574d06bd5..c6fc05b8b4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7531,13 +7531,17 @@ reseat (struct it *it, struct text_pos pos, bool force_p) if (current_buffer->long_line_optimizations_p) { - if (!it->narrowed_begv - || ((pos.charpos < it->narrowed_begv || pos.charpos > it->narrowed_zv) - && (!redisplaying_p || it->line_wrap == TRUNCATE))) + if (!it->narrowed_begv) { it->narrowed_begv = get_narrowed_begv (it->w, window_point (it->w)); it->narrowed_zv = get_narrowed_zv (it->w, window_point (it->w)); } + else if ((pos.charpos < it->narrowed_begv || pos.charpos > it->narrowed_zv) + && (!redisplaying_p || it->line_wrap == TRUNCATE)) + { + it->narrowed_begv = get_narrowed_begv (it->w, pos.charpos); + it->narrowed_zv = get_narrowed_zv (it->w, pos.charpos); + } } /* Determine where to check text properties. Avoid doing it commit d0e4ec3c29abc61a92c40d89fc7d3e3cc452e934 Author: Gregory Heytings Date: Mon Aug 1 13:27:02 2022 +0000 Fix forgotten initialization for long line optimizations. * src/xdisp.c (init_iterator): Initialize the 'narrowed_begv' field. * src/buffer.c (syms_of_buffer): Docstring clarification. diff --git a/src/buffer.c b/src/buffer.c index a07194aef7..e5601af505 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -6431,12 +6431,15 @@ will run for `clone-indirect-buffer' calls as well. */); DEFVAR_LISP ("long-line-threshold", Vlong_line_threshold, doc: /* Line length above which to use redisplay shortcuts. + The value should be a positive integer or nil. If the value is an integer, shortcuts in the display code intended to speed up redisplay for long lines will automatically be enabled in buffers which contain one or more lines whose length is above this threshold. -If nil, these display shortcuts will always remain disabled. */); +If nil, these display shortcuts will always remain disabled. + +There is no reason to change that value except for debugging purposes. */); XSETFASTINT (Vlong_line_threshold, 10000); defsubr (&Sbuffer_live_p); diff --git a/src/xdisp.c b/src/xdisp.c index 8a19b3bda9..9574d06bd5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3472,6 +3472,9 @@ init_iterator (struct it *it, struct window *w, &it->bidi_it); } + if (current_buffer->long_line_optimizations_p) + it->narrowed_begv = 0; + /* Compute faces etc. */ reseat (it, it->current.pos, true); } commit 43a174f62c50871c0bcb6e4b15144a177f028218 Author: Gregory Heytings Date: Sun Jul 31 22:36:55 2022 +0000 Move the computation of narrowing bounds for long line optimizations. * src/xdisp.c (init_iterator): Move the computation from here... (reseat): ... to here. Also recompute the position in certain cases. diff --git a/src/xdisp.c b/src/xdisp.c index 88a489e290..8a19b3bda9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3413,12 +3413,6 @@ init_iterator (struct it *it, struct window *w, } } - if (current_buffer->long_line_optimizations_p) - { - it->narrowed_begv = get_narrowed_begv (w, window_point (w)); - it->narrowed_zv = get_narrowed_zv (w, window_point (w)); - } - /* If a buffer position was specified, set the iterator there, getting overlays and face properties from that position. */ if (charpos >= BUF_BEG (current_buffer)) @@ -7532,6 +7526,17 @@ reseat (struct it *it, struct text_pos pos, bool force_p) reseat_1 (it, pos, false); + if (current_buffer->long_line_optimizations_p) + { + if (!it->narrowed_begv + || ((pos.charpos < it->narrowed_begv || pos.charpos > it->narrowed_zv) + && (!redisplaying_p || it->line_wrap == TRUNCATE))) + { + it->narrowed_begv = get_narrowed_begv (it->w, window_point (it->w)); + it->narrowed_zv = get_narrowed_zv (it->w, window_point (it->w)); + } + } + /* Determine where to check text properties. Avoid doing it where possible because text property lookup is very expensive. */ if (force_p commit 5e296283f57b21e962e6e6860e448905f99f281e Author: Gregory Heytings Date: Sun Jul 31 20:32:15 2022 +0000 Add locked narrowing around pre- and post-command-hook * src/keyboard.c (safe_run_hooks_maybe_narrowed): New function. (command_loop_1): Use it for 'pre-command-hook' and 'post-command-hook'. (syms_of_keyboard): Update docstrings of 'pre-command-hook' and 'post-command-hook'. * src/lisp.h: Prototype of the new function. diff --git a/src/keyboard.c b/src/keyboard.c index 2863058d63..094119340e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1295,7 +1295,8 @@ command_loop_1 (void) /* Note that the value cell will never directly contain nil if the symbol is a local variable. */ if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks)) - safe_run_hooks (Qpost_command_hook); + safe_run_hooks_maybe_narrowed (Qpost_command_hook, + XWINDOW (selected_window)); /* If displaying a message, resize the echo area window to fit that message's size exactly. */ @@ -1461,7 +1462,9 @@ command_loop_1 (void) } Vthis_command = cmd; Vreal_this_command = cmd; - safe_run_hooks (Qpre_command_hook); + + safe_run_hooks_maybe_narrowed (Qpre_command_hook, + XWINDOW (selected_window)); already_adjusted = 0; @@ -1513,7 +1516,8 @@ command_loop_1 (void) } kset_last_prefix_arg (current_kboard, Vcurrent_prefix_arg); - safe_run_hooks (Qpost_command_hook); + safe_run_hooks_maybe_narrowed (Qpost_command_hook, + XWINDOW (selected_window)); /* If displaying a message, resize the echo area window to fit that message's size exactly. Do this only if the echo area @@ -1895,6 +1899,25 @@ safe_run_hooks (Lisp_Object hook) unbind_to (count, Qnil); } +void +safe_run_hooks_maybe_narrowed (Lisp_Object hook, struct window *w) +{ + specpdl_ref count = SPECPDL_INDEX (); + + specbind (Qinhibit_quit, Qt); + + if (current_buffer->long_line_optimizations_p) + { + ptrdiff_t begv = get_narrowed_begv (w, PT); + ptrdiff_t zv = get_narrowed_zv (w, PT); + if (!begv) begv = BEGV; + Fnarrow_to_region (make_fixnum (begv), make_fixnum (zv), Qt); + } + + run_hook_with_args (2, ((Lisp_Object []) {hook, hook}), safe_run_hook_funcall); + unbind_to (count, Qnil); +} + /* Nonzero means polling for input is temporarily suppressed. */ @@ -12622,23 +12645,39 @@ Buffer modification stores t in this variable. */); DEFVAR_LISP ("pre-command-hook", Vpre_command_hook, doc: /* Normal hook run before each command is executed. -If an unhandled error happens in running this hook, -the function in which the error occurred is unconditionally removed, since -otherwise the error might happen repeatedly and make Emacs nonfunctional. + +If an unhandled error happens in running this hook, the function in +which the error occurred is unconditionally removed, since otherwise +the error might happen repeatedly and make Emacs nonfunctional. + +Note that, when the current buffer contains one or more lines whose +length is above `long-line-threshold', these hook functions are called +with the buffer narrowed to a small portion around point, and the +narrowing is locked (see `narrow-to-region'), so that these hook +functions cannot use `widen' to gain access to other portions of +buffer text. See also `post-command-hook'. */); Vpre_command_hook = Qnil; DEFVAR_LISP ("post-command-hook", Vpost_command_hook, doc: /* Normal hook run after each command is executed. -If an unhandled error happens in running this hook, -the function in which the error occurred is unconditionally removed, since -otherwise the error might happen repeatedly and make Emacs nonfunctional. + +If an unhandled error happens in running this hook, the function in +which the error occurred is unconditionally removed, since otherwise +the error might happen repeatedly and make Emacs nonfunctional. It is a bad idea to use this hook for expensive processing. If unavoidable, wrap your code in `(while-no-input (redisplay) CODE)' to avoid making Emacs unresponsive while the user types. +Note that, when the current buffer contains one or more lines whose +length is above `long-line-threshold', these hook functions are called +with the buffer narrowed to a small portion around point, and the +narrowing is locked (see `narrow-to-region'), so that these hook +functions cannot use `widen' to gain access to other portions of +buffer text. + See also `pre-command-hook'. */); Vpost_command_hook = Qnil; diff --git a/src/lisp.h b/src/lisp.h index 8fcc9b6e75..7136bb3dc1 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4829,6 +4829,7 @@ extern bool detect_input_pending (void); extern bool detect_input_pending_ignore_squeezables (void); extern bool detect_input_pending_run_timers (bool); extern void safe_run_hooks (Lisp_Object); +extern void safe_run_hooks_maybe_narrowed (Lisp_Object, struct window *); extern void cmd_error_internal (Lisp_Object, const char *); extern Lisp_Object command_loop_2 (Lisp_Object); extern Lisp_Object read_menu_command (void);