commit 35d39278599caf30eb4bfbd83118ffe15d2bc705 (HEAD, refs/remotes/origin/master) Author: Gerd Möllmann Date: Sat Jan 25 21:18:00 2025 +0100 Change doc string of frame-visible-p * src/frame.c (Fframe_visible_p): Don't say it always returns t for tty frames. diff --git a/src/frame.c b/src/frame.c index 49203fce375..904b7984420 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3293,11 +3293,7 @@ DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p, Return the symbol `icon' if FRAME is iconified or \"minimized\". Return nil if FRAME was made invisible, via `make-frame-invisible'. On graphical displays, invisible frames are not updated and are -usually not displayed at all, even in a window system's \"taskbar\". - -If FRAME is a text terminal frame, this always returns t. -Such frames are always considered visible, whether or not they are -currently being displayed on the terminal. */) +usually not displayed at all, even in a window system's \"taskbar\". */) (Lisp_Object frame) { CHECK_LIVE_FRAME (frame); commit 85aec497c71e26b66ecfc85c20d7888336300e1f Author: Gerd Möllmann Date: Sat Jan 25 19:42:52 2025 +0100 Replace is_frame_ancestor with frame_ancestor_p * src/dispnew.c (is_frame_ancestor): Removed. (frame_z_order_cmp): Use frame_ancestor_p. (copy_child_glyphs): Ditto. * src/dispextern.h: Declaration removed. * src/term.c (mouse_get_xy): Use frame_ancestor_p. diff --git a/src/dispextern.h b/src/dispextern.h index e1214128e35..1b383164752 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3960,7 +3960,6 @@ void tty_raise_lower_frame (struct frame *f, bool raise); int max_child_z_order (struct frame *parent); void root_xy (struct frame *f, int x, int y, int *rx, int *ry); void child_xy (struct frame *f, int x, int y, int *cx, int *cy); -bool is_frame_ancestor (struct frame *f1, struct frame *f2); INLINE_HEADER_END diff --git a/src/dispnew.c b/src/dispnew.c index bc37230d70c..d28dc3d54fa 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3366,17 +3366,6 @@ max_child_z_order (struct frame *parent) return z_order; } -/* Return true if F1 is an ancestor of F2. */ - -bool -is_frame_ancestor (struct frame *f1, struct frame *f2) -{ - for (struct frame *f = FRAME_PARENT_FRAME (f2); f; f = FRAME_PARENT_FRAME (f)) - if (f == f1) - return true; - return false; -} - /* Return a list of all frames having root frame ROOT. If VISIBLE_ONLY is true, return only visible frames. */ @@ -3420,9 +3409,9 @@ frame_z_order_cmp (struct frame *f1, struct frame *f2) { if (f1 == f2) return 0; - if (is_frame_ancestor (f1, f2)) + if (frame_ancestor_p (f1, f2)) return -1; - if (is_frame_ancestor (f2, f1)) + if (frame_ancestor_p (f2, f1)) return 1; return f1->z_order - f2->z_order; } @@ -3704,7 +3693,7 @@ static void copy_child_glyphs (struct frame *root, struct frame *child) { eassert (!FRAME_PARENT_FRAME (root)); - eassert (is_frame_ancestor (root, child)); + eassert (frame_ancestor_p (root, child)); /* Determine the intersection of the child frame rectangle with the root frame. This is basically clipping the child frame to the diff --git a/src/term.c b/src/term.c index 1b2e44af8db..777ab5f918c 100644 --- a/src/term.c +++ b/src/term.c @@ -3004,7 +3004,7 @@ mouse_get_xy (int *x, int *y) struct frame *f = XFRAME (XCAR (mouse)); struct frame *sf = SELECTED_FRAME (); - if (f == sf || is_frame_ancestor (sf, f)) + if (f == sf || frame_ancestor_p (sf, f)) { int mx = XFIXNUM (XCAR (XCDR (mouse))); int my = XFIXNUM (XCDR (XCDR (mouse))); commit 63df2164903e0cd6819187483a64b892aa7e0219 Author: Juri Linkov Date: Sat Jan 25 20:14:15 2025 +0200 Add 'treesit-forward-comment' with 'forward-comment-function' * lisp/treesit.el (treesit-forward-comment): New function. (treesit-major-mode-setup): Set 'forward-comment-function' to 'treesit-forward-comment' if the 'comment' thing is defined. * src/syntax.c (forward-comment-function): New variable. (Fforward_comment): Call the function from 'forward-comment-function' when it's non-nil (bug#75609). diff --git a/etc/NEWS b/etc/NEWS index 385e943c997..af5c320a19b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1099,6 +1099,10 @@ the tree-sitter library. The new function 'treesit-show-paren-data' is used to communicate the tree-sitter parsing results to 'show-paren-mode'. +*** New treesit thing 'comment'. +The new variable 'forward-comment-function' is set to the new function +'treesit-forward-comment' if a major mode defines the thing 'comment'. + +++ *** New function 'treesit-language-display-name'. This new function returns the display name of a language given the diff --git a/lisp/treesit.el b/lisp/treesit.el index 5e00379fa06..e08aa52ca50 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2945,6 +2945,29 @@ by `text' and `sentence' in `treesit-thing-settings'." (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing) 'sentence (abs arg)))) +(defun treesit-forward-comment (&optional count) + "Tree-sitter `forward-comment-function' implementation. + +COUNT is the same as in `forward-comment'." + (let ((res t) thing) + (while (> count 0) + (skip-chars-forward " \t\n") + (setq thing (treesit-thing-at (point) 'comment)) + (if (and thing (eq (point) (treesit-node-start thing))) + (progn + (goto-char (min (1+ (treesit-node-end thing)) (point-max))) + (setq count (1- count))) + (setq count 0 res nil))) + (while (< count 0) + (skip-chars-backward " \t\n") + (setq thing (treesit-thing-at (max (1- (point)) (point-min)) 'comment)) + (if (and thing (eq (point) (treesit-node-end thing))) + (progn + (goto-char (treesit-node-start thing)) + (setq count (1+ count))) + (setq count 0 res nil))) + res)) + (defun treesit-default-defun-skipper () "Skips spaces after navigating a defun. This function tries to move to the beginning of a line, either by @@ -3649,11 +3672,14 @@ before calling this function." (setq-local forward-list-function #'treesit-forward-list) (setq-local down-list-function #'treesit-down-list) (setq-local up-list-function #'treesit-up-list) - (setq-local show-paren-data-function 'treesit-show-paren-data)) + (setq-local show-paren-data-function #'treesit-show-paren-data)) (when (treesit-thing-defined-p 'sentence nil) (setq-local forward-sentence-function #'treesit-forward-sentence)) + (when (treesit-thing-defined-p 'comment nil) + (setq-local forward-comment-function #'treesit-forward-comment)) + ;; Imenu. (when (or treesit-aggregated-simple-imenu-settings treesit-simple-imenu-settings) diff --git a/src/syntax.c b/src/syntax.c index 6ffa8a94c7f..e25618ee03d 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2434,6 +2434,9 @@ between them, return t; otherwise return nil. */) int dummy2; unsigned short int quit_count = 0; + if (!NILP (Vforward_comment_function)) + return calln (Vforward_comment_function, count); + CHECK_FIXNUM (count); count1 = XFIXNUM (count); stop = count1 > 0 ? ZV : BEGV; @@ -3796,6 +3799,11 @@ In both cases, LIMIT bounds the search. */); DEFSYM (Qcomment_end_can_be_escaped, "comment-end-can-be-escaped"); Fmake_variable_buffer_local (Qcomment_end_can_be_escaped); + DEFVAR_LISP ("forward-comment-function", Vforward_comment_function, + doc: /* If non-nil, `forward-comment' delegates to this function. +Should take the same arguments and behave similarly to `forward-comment'. */); + Vforward_comment_function = Qnil; + defsubr (&Ssyntax_table_p); defsubr (&Ssyntax_table); defsubr (&Sstandard_syntax_table); commit 3bc6b88cc71b8ccc96b5e61d895e5208009aa3c0 Author: Juri Linkov Date: Sat Jan 25 19:59:56 2025 +0200 * lisp/treesit.el: Display treesit-explore buffer below selected window. (treesit-explorer-switch-parser, treesit-explore): Use display-buffer-below-selected for display-buffer (bug#75079). diff --git a/lisp/treesit.el b/lisp/treesit.el index 8d86d142e3f..5e00379fa06 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -4122,7 +4122,8 @@ Navigates from button to button." (user-error "Not in `treesit-explore-mode'")) (setq-local treesit--explorer-parser parser) (display-buffer treesit--explorer-buffer - (cons nil '((inhibit-same-window . t)))) + '(display-buffer-below-selected + (inhibit-same-window . t))) (setq-local treesit--explorer-last-node nil) (treesit--explorer-refresh)) @@ -4176,7 +4177,9 @@ window." (interactive) (if (and treesit-explore-mode (buffer-live-p treesit--explorer-buffer)) - (display-buffer treesit--explorer-buffer '(nil (inhibit-same-window . t))) + (display-buffer treesit--explorer-buffer + '(display-buffer-below-selected + (inhibit-same-window . t))) (treesit-explore-mode))) ;;; Install & build language grammar commit 442d04081bbe9913def50b543e499422c4ad9ece Author: Stefan Monnier Date: Sat Jan 25 10:39:12 2025 -0500 (when-let*): Warn if body is empty * lisp/subr.el (when-let*): Warn if body is empty. * lisp/textmodes/tex-mode.el (xref-backend-references): Fix use of `when-let*`. diff --git a/lisp/subr.el b/lisp/subr.el index 84e8bbd14ad..db2cb7e3f9e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2650,7 +2650,9 @@ The variable list VARLIST is the same as in `if-let*'. See also `and-let*'." (declare (indent 1) (debug if-let*)) - (list 'if-let* varlist (macroexp-progn body))) + (let ((res (list 'if-let* varlist (macroexp-progn body)))) + (if body res + (macroexp-warn-and-return "Empty body" res 'empty-body)))) (defmacro and-let* (varlist &rest body) "Bind variables according to VARLIST and conditionally evaluate BODY. diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 764d766dbe3..e10646e5727 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -4020,8 +4020,8 @@ There might be text before point." (ext (file-name-extension fbuf)) (finext (concat "*." ext)) ((not (seq-find (lambda (elt) (string-match-p elt finext)) - extlist-new))) - ((push finext extlist-new))))) + extlist-new)))) + (push finext extlist-new))) (unless (seq-set-equal-p extlist-new extlist) (setf (alist-get mode semantic-symref-filepattern-alist) extlist-new)))) commit 6016967e858e12f07c3cf4ade35cddef7b91a0d4 Merge: e8f173f0ba9 67903f5909d Author: Eli Zaretskii Date: Sat Jan 25 10:06:19 2025 -0500 Merge from origin/emacs-30 67903f5909d Restore the old behavior of `bookmark-write-file' 062da7003f9 ; Improve prompts and error messages in 'info-look' 52dc01f1c8b ; * admin/admin.el (set-version): Note about Android. fb282da2a07 Avoid double spaces around abbrevations in Texinfo bc1ab8ac3d8 ; * doc/emacs/custom.texi (Init Rebinding): Fix spacing. b41ef43af19 ; Fix previous change 5638b1d6bd4 Ispell: Use "personal dictionary" terminology consistently cc791e7499f ; Check man pages for mistakes less frequently 4ed4792e3b9 ; * admin/release-process: Minor copy-edits. 4a867c823b7 Add language server "ruff server" for Python 9e687c2871f Fix go-ts-mode type declaration indentation (Bug#75785) f751b3afa4f ; Minor improvements for doc strings in map.el cda78edc7d9 ; Fix typos ce50a1d3c18 ; * src/w32.c (w32_memory_info): Fix coding style of last... 58d3d4820ad Fix bug in w32_memory_info 77386412050 Avoid crashes in redisplay due to problematic font setups 0e3687e6006 Improve 'key-valid-p' docstring 9878092d2b9 Minor copyedits in internals.texi 4726900fdc5 Better document side-effect free and pure C functions 04c475a39f2 ; Fix documentation about faces of tool-tip text # Conflicts: # admin/codespell/codespell.exclude commit e8f173f0ba9327033781429ea9a1d99ff8d2f751 Author: Eli Zaretskii Date: Sat Jan 25 16:59:40 2025 +0200 ; * src/term.c (handle_one_term_event): Fix last change. diff --git a/src/term.c b/src/term.c index e13089af2bb..1b2e44af8db 100644 --- a/src/term.c +++ b/src/term.c @@ -2766,7 +2766,8 @@ int handle_one_term_event (struct tty_display_info *tty, const Gpm_Event *event_in) { Gpm_Event event = *event_in; - Lisp_Object frame = tty_frame_at (event_in->x, event_in->y, &event.x, &event.y); + int gpm_x = event.x, gpm_y = event.y; + Lisp_Object frame = tty_frame_at (event_in->x, event_in->y, &gpm_x, &gpm_y); struct frame *f = decode_live_frame (frame); struct input_event ie; commit 67903f5909db5c6140eeffebfaf818b4f93625d5 Author: Zhengyi Fu Date: Thu Jan 23 13:35:16 2025 +0800 Restore the old behavior of `bookmark-write-file' * lisp/bookmark.el (bookmark-write-file): Use 'pp-28' to avoid filling the bookmarks. (Bug#75775) Copyright-paperwork-exempt: yes diff --git a/lisp/bookmark.el b/lisp/bookmark.el index b931a4ed2f5..cd59293e0a4 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1678,7 +1678,8 @@ for a file, defaulting to the file defined by variable ;; Rather than a single call to `pp' we make one per bookmark. ;; Apparently `pp' has a poor algorithmic complexity, so this ;; scales a lot better. bug#4485. - (dolist (i bookmark-alist) (pp i (current-buffer))) + (let ((pp-default-function #'pp-28)) + (dolist (i bookmark-alist) (pp i (current-buffer)))) (insert ")\n") ;; Make sure the specified encoding can safely encode the ;; bookmarks. If it cannot, suggest utf-8-emacs as default. commit 1d086441166f564d8f8cd4945cb9590410c9676b Author: Gerd Möllmann Date: Sat Jan 25 14:43:17 2025 +0100 Fix the mistake that led to the reverts * src/terminal.c (raw_cursor_to): Fix reversed arguments. diff --git a/src/terminal.c b/src/terminal.c index e6d5a5d309a..17dc4770ef7 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -128,7 +128,7 @@ raw_cursor_to (struct frame *f, int row, int col) if (term->raw_cursor_to_hook) { int x, y; - root_xy (f, row, col, &x, &y); + root_xy (f, col, row, &x, &y); term->raw_cursor_to_hook (f, y, x); } } commit 20f26723774d50292f21487fb21b92355444d678 Author: Gerd Möllmann Date: Sat Jan 25 14:28:18 2025 +0100 Reapply "Multi-tty: selected frame can be a GUI frame" This reverts commit d93d822285813b89f2444ef93c5747cbeb67a46b. diff --git a/src/dispnew.c b/src/dispnew.c index 5a8064a1a02..bc37230d70c 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3906,26 +3906,44 @@ is_in_matrix (struct frame *f, int x, int y) return true; } -/* Is the terminal cursor of the selected frame obscured by a child - frame? */ +/* Return the frame of the selected window of frame F. + Value is NULL if we can't tell. */ + +static struct frame * +frame_selected_window_frame (struct frame *f) +{ + /* Paranoia. It should not happen that window or frame not valid. */ + Lisp_Object frame; + if (WINDOWP (f->selected_window) + && (frame = XWINDOW (f->selected_window)->frame, + FRAMEP (frame))) + return XFRAME (frame); + return NULL; +} + +/* Is the terminal cursor of ROOT obscured by a child frame? */ static bool -is_cursor_obscured (void) +is_cursor_obscured (struct frame *root) { + /* Determine in which frame on ROOT the cursor could be. */ + struct frame *sf = frame_selected_window_frame (root); + if (sf == NULL) + return false; + /* Give up if we can't tell where the cursor currently is. */ int x, y; - if (!abs_cursor_pos (SELECTED_FRAME (), &x, &y)) + if (!abs_cursor_pos (sf, &x, &y)) return false; /* (x, y) may be outside of the root frame in case the selected frame is a child frame which is clipped. */ - struct frame *root = root_frame (SELECTED_FRAME ()); if (!is_in_matrix (root, x, y)) return true; struct glyph_row *cursor_row = MATRIX_ROW (root->current_matrix, y); struct glyph *cursor_glyph = cursor_row->glyphs[0] + x; - return cursor_glyph->frame != SELECTED_FRAME (); + return cursor_glyph->frame != sf; } /* Decide where to show the cursor, and whether to hide it. @@ -3939,7 +3957,7 @@ static void terminal_cursor_magic (struct frame *root, struct frame *topmost_child) { /* By default, prevent the cursor "shining through" child frames. */ - if (is_cursor_obscured ()) + if (is_cursor_obscured (root)) tty_hide_cursor (FRAME_TTY (root)); /* If the terminal cursor is not in the topmost child, the topmost @@ -3947,7 +3965,8 @@ terminal_cursor_magic (struct frame *root, struct frame *topmost_child) non-nil, display the cursor in this "non-selected" topmost child frame to compensate for the fact that we can't display a non-selected cursor like on a window system frame. */ - if (topmost_child != SELECTED_FRAME ()) + struct frame *sf = frame_selected_window_frame (root); + if (sf && topmost_child != sf) { Lisp_Object frame; XSETFRAME (frame, topmost_child); @@ -3959,25 +3978,23 @@ terminal_cursor_magic (struct frame *root, struct frame *topmost_child) if (is_in_matrix (root, x, y)) { cursor_to (root, y, x); - tty_show_cursor (FRAME_TTY (topmost_child)); + tty_show_cursor (FRAME_TTY (root)); } else tty_hide_cursor (FRAME_TTY (root)); - } + } } } -#endif /* !HAVE_ANDROID */ - void combine_updates_for_frame (struct frame *f, bool inhibit_scrolling) { -#ifndef HAVE_ANDROID struct frame *root = root_frame (f); /* Determine visible frames on the root frame, including the root frame itself. Note that there are cases, see bug#75056, where we - can be called for invisible frames. */ + can be called for invisible frames. This looks like a bug with + multi-tty, but the old update code didn't check visibility either. */ Lisp_Object z_order = frames_in_reverse_z_order (root, true); if (NILP (z_order)) { @@ -4018,9 +4035,15 @@ combine_updates_for_frame (struct frame *f, bool inhibit_scrolling) add_frame_display_history (f, false); #endif } -#endif /* HAVE_ANDROID */ } +#else /* HAVE_ANDROID */ +void +combine_updates_for_frame (struct frame *f, bool inhibit_scrolling) +{ +} +#endif /* HAVE_ANDROID */ + /* Update on the screen all root frames ROOTS. Called from redisplay_internal as the last step of redisplaying. */ commit ccf3f8d21e346ac1fdb092079227c37f987f253d Author: Gerd Möllmann Date: Sat Jan 25 14:28:13 2025 +0100 Reapply "Fix mouse position handling for nested tty child frames" This reverts commit e2cc52dbcd196f95cc79c6c6d899b9e86e696fe5. diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 19d688e4d1e..e395723d05c 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -298,16 +298,11 @@ which is the \"1006\" extension implemented in Xterm >= 277." ;; FIXME: The test for running in batch mode is here solely ;; for the sake of xt-mouse-tests where the only frame is ;; the initial frame. - (frame (unless noninteractive (tty-frame-at x y))) - ;;(_ (message (format "*** %S" frame))) - (frame-pos (frame-position frame)) - ;;(_ (message (format "*** %S" frame-pos))) - (x (- x (car frame-pos))) - (y (- y (cdr frame-pos))) - ;;(_ (message (format "*** %S %S" x y))) + (frame-and-xy (unless noninteractive (tty-frame-at x y))) + (frame (nth 0 frame-and-xy)) + (x (nth 1 frame-and-xy)) + (y (nth 2 frame-and-xy)) (w (window-at x y frame)) - ;;(_ (message (format "*** %S" w))) - (ltrb (window-edges w)) (left (nth 0 ltrb)) (top (nth 1 ltrb)) diff --git a/src/dispextern.h b/src/dispextern.h index 9c193e79fd1..e1214128e35 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3959,6 +3959,7 @@ void combine_updates_for_frame (struct frame *f, bool inhibit_id_p); void tty_raise_lower_frame (struct frame *f, bool raise); int max_child_z_order (struct frame *parent); void root_xy (struct frame *f, int x, int y, int *rx, int *ry); +void child_xy (struct frame *f, int x, int y, int *cx, int *cy); bool is_frame_ancestor (struct frame *f1, struct frame *f2); INLINE_HEADER_END diff --git a/src/dispnew.c b/src/dispnew.c index 00e59c767e8..5a8064a1a02 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3328,6 +3328,17 @@ root_xy (struct frame *f, int x, int y, int *rx, int *ry) } } +/* Translate absolute coordinates (X, Y) to coordinates relative to F's origin. */ + +void +child_xy (struct frame *f, int x, int y, int *cx, int *cy) +{ + int rx, ry; + root_xy (f, 0, 0, &rx, &ry); + *cx = x - rx; + *cy = y - ry; +} + /* Return the rectangle frame F occupies. X and Y are in absolute coordinates. */ diff --git a/src/term.c b/src/term.c index 7397ee68347..e13089af2bb 100644 --- a/src/term.c +++ b/src/term.c @@ -2595,7 +2595,7 @@ tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row, #endif static Lisp_Object -tty_frame_at (int x, int y) +tty_frame_at (int x, int y, int *cx, int *cy) { for (Lisp_Object frames = Ftty_frame_list_z_order (Qnil); !NILP (frames); @@ -2606,24 +2606,33 @@ tty_frame_at (int x, int y) int fx, fy; root_xy (f, 0, 0, &fx, &fy); - if (fx <= x && x < fx + f->pixel_width - && fy <= y && y < fy + f->pixel_height) - return frame; + if ((fx <= x && x < fx + f->pixel_width) + && (fy <= y && y < fy + f->pixel_height)) + { + child_xy (XFRAME (frame), x, y, cx, cy); + return frame; + } } return Qnil; } -DEFUN ("tty-frame-at", Ftty_frame_at, Stty_frame_at, - 2, 2, 0, - doc: /* Return tty frame containing pixel position X, Y. */) +DEFUN ("tty-frame-at", Ftty_frame_at, Stty_frame_at, 2, 2, 0, + doc : /* Return tty frame containing absolute pixel position (X, Y). +Value is nil if no frame found. Otherwise it is a list (FRAME CX CY), +where FRAME is the frame containing (X, Y) and CX and CY are X and Y +relative to FRAME. */) (Lisp_Object x, Lisp_Object y) { if (! FIXNUMP (x) || ! FIXNUMP (y)) /* Coordinates this big can not correspond to any frame. */ return Qnil; - return tty_frame_at (XFIXNUM (x), XFIXNUM (y)); + int cx, cy; + Lisp_Object frame = tty_frame_at (XFIXNUM (x), XFIXNUM (y), &cx, &cy); + if (NILP (frame)) + return Qnil; + return list3 (frame, make_fixnum (cx), make_fixnum (cy)); } #ifdef HAVE_GPM @@ -2756,11 +2765,9 @@ term_mouse_click (struct input_event *result, Gpm_Event *event, int handle_one_term_event (struct tty_display_info *tty, const Gpm_Event *event_in) { - Lisp_Object frame = tty_frame_at (event_in->x, event_in->y); - struct frame *f = decode_live_frame (frame); Gpm_Event event = *event_in; - event.x -= f->left_pos; - event.y -= f->top_pos; + Lisp_Object frame = tty_frame_at (event_in->x, event_in->y, &event.x, &event.y); + struct frame *f = decode_live_frame (frame); struct input_event ie; int count = 0; commit e839b83c828fe09546edcc46dcfc5e09dd39b9fe Author: Gerd Möllmann Date: Sat Jan 25 14:28:11 2025 +0100 Reapply "Fix tty-frame-at for nested tty child frames" This reverts commit 9ad28959d6895720865c0718bf60f4b7b0b144f3. diff --git a/src/term.c b/src/term.c index 00bc94e6e31..7397ee68347 100644 --- a/src/term.c +++ b/src/term.c @@ -2603,9 +2603,11 @@ tty_frame_at (int x, int y) { Lisp_Object frame = Fcar (frames); struct frame *f = XFRAME (frame); + int fx, fy; + root_xy (f, 0, 0, &fx, &fy); - if (f->left_pos <= x && x < f->left_pos + f->pixel_width && - f->top_pos <= y && y < f->top_pos + f->pixel_height) + if (fx <= x && x < fx + f->pixel_width + && fy <= y && y < fy + f->pixel_height) return frame; } commit 26b144f241c7843b635415f2b68b8c3df0b23e02 Author: Gerd Möllmann Date: Sat Jan 25 14:28:09 2025 +0100 Reapply "Fix cursor positioning of nested tty child frames" This reverts commit 65036323fc1cdf18a7812b1c922583e6466972a6. diff --git a/src/terminal.c b/src/terminal.c index db6d42d4b4f..e6d5a5d309a 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -110,9 +110,13 @@ set_terminal_window (struct frame *f, int size) void cursor_to (struct frame *f, int vpos, int hpos) { - if (FRAME_TERMINAL (f)->cursor_to_hook) - (*FRAME_TERMINAL (f)->cursor_to_hook) (f, vpos + f->top_pos, - hpos + f->left_pos); + struct terminal *term = FRAME_TERMINAL (f); + if (term->cursor_to_hook) + { + int x, y; + root_xy (f, hpos, vpos, &x, &y); + term->cursor_to_hook (f, y, x); + } } /* Similar but don't take any account of the wasted characters. */ @@ -120,9 +124,13 @@ cursor_to (struct frame *f, int vpos, int hpos) void raw_cursor_to (struct frame *f, int row, int col) { - if (FRAME_TERMINAL (f)->raw_cursor_to_hook) - (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row + f->top_pos, - col + f->left_pos); + struct terminal *term = FRAME_TERMINAL (f); + if (term->raw_cursor_to_hook) + { + int x, y; + root_xy (f, row, col, &x, &y); + term->raw_cursor_to_hook (f, y, x); + } } /* Erase operations. */ commit 945ed044cd8ab67ccbbc185c19f500f723cd9045 Author: Gerd Möllmann Date: Sat Jan 25 14:28:03 2025 +0100 Reapply "Simplify absolute (x, y) computation on ttys" This reverts commit 13fdcd730ff63bf79caace9a6e46aff5f944b1b7. diff --git a/src/dispextern.h b/src/dispextern.h index 1060895d0f4..9c193e79fd1 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3958,7 +3958,7 @@ void combine_updates (Lisp_Object root_frames); void combine_updates_for_frame (struct frame *f, bool inhibit_id_p); void tty_raise_lower_frame (struct frame *f, bool raise); int max_child_z_order (struct frame *parent); -void frame_pos_abs (struct frame *f, int *x, int *y); +void root_xy (struct frame *f, int x, int y, int *rx, int *ry); bool is_frame_ancestor (struct frame *f1, struct frame *f2); INLINE_HEADER_END diff --git a/src/dispnew.c b/src/dispnew.c index 724ec6ece9a..00e59c767e8 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3313,16 +3313,18 @@ rect_intersect (struct rect *r, struct rect r1, struct rect r2) return true; } -/* Return the absolute position of frame F in *X and *Y. */ +/* Translate (X, Y) relative to frame F to absolute coordinates + in (*X, *Y). */ void -frame_pos_abs (struct frame *f, int *x, int *y) +root_xy (struct frame *f, int x, int y, int *rx, int *ry) { - *x = *y = 0; + *rx = x; + *ry = y; for (; f; f = FRAME_PARENT_FRAME (f)) { - *x += f->left_pos; - *y += f->top_pos; + *rx += f->left_pos; + *ry += f->top_pos; } } @@ -3333,7 +3335,7 @@ static struct rect frame_rect_abs (struct frame *f) { int x, y; - frame_pos_abs (f, &x, &y); + root_xy (f, 0, 0, &x, &y); return (struct rect) { x, y, f->total_cols, f->total_lines }; } @@ -3875,10 +3877,7 @@ abs_cursor_pos (struct frame *f, int *x, int *y) wx += max (0, w->left_margin_cols); - int fx, fy; - frame_pos_abs (f, &fx, &fy); - *x = fx + wx; - *y = fy + wy; + root_xy (f, wx, wy, x, y); return true; } diff --git a/src/term.c b/src/term.c index 4ae9c373888..00bc94e6e31 100644 --- a/src/term.c +++ b/src/term.c @@ -2996,10 +2996,9 @@ mouse_get_xy (int *x, int *y) struct frame *sf = SELECTED_FRAME (); if (f == sf || is_frame_ancestor (sf, f)) { - int fx, fy; - frame_pos_abs (f, &fx, &fy); - *x = fx + XFIXNUM (XCAR (XCDR (mouse))); - *y = fy + XFIXNUM (XCDR (XCDR (mouse))); + int mx = XFIXNUM (XCAR (XCDR (mouse))); + int my = XFIXNUM (XCDR (XCDR (mouse))); + root_xy (f, mx, my, x, y); } } commit d4220a17c4ecf4639a276352149218077c1d6315 Author: Mauro Aranda Date: Sat Jan 18 08:25:40 2025 -0300 Delete all overlays that belong to an editable-field * lisp/wid-edit.el (widget-specify-field): Store the end overlay that we sometimes create for an editable-field widget. (widget-field-value-delete): Make sure we delete all overlays that belong to the widget. (Bug#75646) * test/lisp/wid-edit-tests.el (widget-test-delete-field-overlays): New test. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index ca4e1e184cb..7260f60196a 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -416,6 +416,9 @@ the :notify function can't know the new value.") ;; character (so we don't do this for the character widget), ;; or if the size of the editable field isn't specified. (let ((overlay (make-overlay (1- to) to nil t nil))) + ;; Save it so that we can easily delete it in + ;; `widget-field-value-delete'. (Bug#75646) + (widget-put widget :field-end-overlay overlay) (overlay-put overlay 'field 'boundary) ;; We need the real field for tabbing. (overlay-put overlay 'real-field widget) @@ -2223,11 +2226,16 @@ the earlier input." (set-marker-insertion-type (car overlay) t))) (defun widget-field-value-delete (widget) - "Remove the widget from the list of active editing fields." + "Remove the field WIDGET from the list of active editing fields. + +Delete its overlays as well." (setq widget-field-list (delq widget widget-field-list)) (setq widget-field-new (delq widget widget-field-new)) ;; These are nil if the :format string doesn't contain `%v'. (let ((overlay (widget-get widget :field-overlay))) + (when (overlayp overlay) + (delete-overlay overlay))) + (let ((overlay (widget-get widget :field-end-overlay))) (when (overlayp overlay) (delete-overlay overlay)))) diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index 6f3c87a809f..c18e6d14c4c 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el @@ -414,4 +414,20 @@ return nil, even with a non-nil bubblep argument." (delete-char 1) (should (string= (widget-value w) ""))))) +(ert-deftest widget-test-delete-field-overlays () + "Test that we delete all the field's overlays when deleting it." + (with-temp-buffer + (let ((field (widget-create 'editable-field + :format "%t: %v " + :tag "Delete me")) + field-overlay field-end-overlay) + (widget-insert "\n") + (widget-setup) + (widget-backward 1) + (setq field-overlay (widget-get field :field-overlay)) + (setq field-end-overlay (car (overlays-at (point)))) + (widget-delete field) + (should-not (overlay-buffer field-overlay)) + (should-not (overlay-buffer field-end-overlay))))) + ;;; wid-edit-tests.el ends here commit 0514619b2c944ae17fbf649496595c5e866ff785 Author: Konstantin Kharlamov Date: Tue Jan 21 18:34:54 2025 +0300 python-mode: add 'exit' and 'quit' to the list of block-enders 'exit()' and 'quit()' end the current codeflow, there can't be any code past it, similarly to 'return', 'continue', etc. So when calculating indentation for the line next to 'exit()', 'os.exit()', 'os._exit()', 'sys.exit()' and 'quit()', decrease the indentation level. * /lisp/progmodes/python.el (python-rx): Add 'exit()', 'os.exit()', 'os._exit()', 'sys.exit()', 'quit' to the list of block-enders. (Bug#75729) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 16c296a8f86..c00de2d6a8d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -440,10 +440,17 @@ This variant of `rx' supports common Python named REGEXPS." (dedenter (seq symbol-start (or "elif" "else" "except" "finally" "case") symbol-end)) - (block-ender (seq symbol-start - (or - "break" "continue" "pass" "raise" "return") - symbol-end)) + (block-ender (seq + symbol-start + (or + (seq (or + "break" "continue" "pass" "raise" "return") + symbol-end) + (seq + (or + (seq (? (or (seq "os." (? ?_)) "sys.")) "exit") + "quit") + (* space) "(")))) (decorator (seq line-start (* space) ?@ (any letter ?_) (* (any word ?_)))) (defun (seq symbol-start commit 192355e54af91ad6e7d1343071a749e1ced29400 Author: Maxim Cournoyer Date: Tue Jan 21 11:50:44 2025 +0900 lisp: Introduce a `lisp-fill-paragraph-as-displayed' variable. Starting with Emacs 28, filling strings now happens in a narrowed scope, and looses the leading indentation and can cause the string to extend past the fill-column value. Introduce `lisp-fill-paragraph-as-displayed' as a new variable allowing opting out of this new behavior in specific scenarios (such as when using the Scheme major mode, say). * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph-as-displayed): New variable. (lisp-fill-paragraph): Honor it, by avoiding the logic narrow to strings before applying fill-paragraph. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-fill-paragraph-respects-fill-column): Test it. (lisp-fill-paragraph-docstring-boundaries): New test, as a safeguard to avoid regressions. Fixes: bug#56197 diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 2b75a5fd038..9e8292b992a 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1431,6 +1431,19 @@ Any non-integer value means do not use a different value of :group 'lisp :version "30.1") +(defvar lisp-fill-paragraph-as-displayed nil + "Modify the behavior of `lisp-fill-paragraph'. +The default behavior of `lisp-fill-paragraph' is tuned for filling Emacs +Lisp doc strings, with their special treatment for the first line. +Particularly, strings are filled in a narrowed context to avoid filling +surrounding code, which means any leading indent is disregarded, which +can cause the filled string to extend passed the configured +`fill-column' variable value. If you would rather fill the string in +its original context and ensure the `fill-column' value is more strictly +respected, set this variable to true. Doing so makes +`lisp-fill-paragraph' behave as it used to in Emacs 27 and prior +versions.") + (defun lisp-fill-paragraph (&optional justify) "Like \\[fill-paragraph], but handle Emacs Lisp comments and docstrings. If any of the current line is a comment, fill the comment or the @@ -1480,42 +1493,44 @@ and initial semicolons." (derived-mode-p 'emacs-lisp-mode)) emacs-lisp-docstring-fill-column fill-column))) - (let ((ppss (syntax-ppss)) - (start (point)) - ;; Avoid recursion if we're being called directly with - ;; `M-x lisp-fill-paragraph' in an `emacs-lisp-mode' buffer. - (fill-paragraph-function t)) + (let* ((ppss (syntax-ppss)) + (start (point)) + ;; Avoid recursion if we're being called directly with + ;; `M-x lisp-fill-paragraph' in an `emacs-lisp-mode' buffer. + (fill-paragraph-function t) + (string-start (ppss-comment-or-string-start ppss))) (save-excursion (save-restriction ;; If we're not inside a string, then do very basic ;; filling. This avoids corrupting embedded strings in ;; code. - (if (not (ppss-comment-or-string-start ppss)) + (if (not string-start) (lisp--fill-line-simple) - ;; If we're in a string, then narrow (roughly) to that - ;; string before filling. This avoids filling Lisp - ;; statements that follow the string. - (when (ppss-string-terminator ppss) - (goto-char (ppss-comment-or-string-start ppss)) - ;; The string may be unterminated -- in that case, don't - ;; narrow. - (when (ignore-errors - (progn - (forward-sexp 1) - t)) - (narrow-to-region (1+ (ppss-comment-or-string-start ppss)) - (1- (point))))) - ;; Move back to where we were. - (goto-char start) - ;; We should fill the first line of a string - ;; separately (since it's usually a doc string). - (if (= (line-number-at-pos) 1) - (narrow-to-region (line-beginning-position) - (line-beginning-position 2)) - (save-excursion - (goto-char (point-min)) - (forward-line 1) - (narrow-to-region (point) (point-max)))) + (unless lisp-fill-paragraph-as-displayed + ;; If we're in a string, then narrow (roughly) to that + ;; string before filling. This avoids filling Lisp + ;; statements that follow the string. + (when (ppss-string-terminator ppss) + (goto-char string-start) + ;; The string may be unterminated -- in that case, don't + ;; narrow. + (when (ignore-errors + (progn + (forward-sexp 1) + t)) + (narrow-to-region (1+ string-start) + (1- (point))))) + ;; Move back to where we were. + (goto-char start) + ;; We should fill the first line of a string + ;; separately (since it's usually a doc string). + (if (= (line-number-at-pos) 1) + (narrow-to-region (line-beginning-position) + (line-beginning-position 2)) + (save-excursion + (goto-char (point-min)) + (forward-line 1) + (narrow-to-region (point) (point-max))))) (fill-paragraph justify))))))) ;; Never return nil. t) diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index 3a765eab625..96e37114276 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el @@ -308,6 +308,53 @@ Expected initialization file: `%s'\" (indent-region (point-min) (point-max)) (should (equal (buffer-string) orig))))) + +;;; Filling + +(ert-deftest lisp-fill-paragraph-docstring-boundaries () + "Test bug#28937, ensuring filling the docstring filled is properly +bounded." + (with-temp-buffer + (insert "\ +(defun test () + \"This is a test docstring. +Here is some more text.\" + 1 + 2 + 3 + 4 + 5)") + (let ((correct (buffer-string))) + (emacs-lisp-mode) + (search-backward "This is a test docstring") + (fill-paragraph) ;function under test + (should (equal (buffer-string) correct))))) + +(ert-deftest lisp-fill-paragraph-as-displayed () + "Test bug#56197 -- more specifically, validate that a leading indentation +for a string is preserved in the filled string." + (let ((lisp-fill-paragraph-as-displayed t) ;variable under test + ;; The following is a contrived example that demonstrates the + ;; fill-column problem when the string to fill is indented. + (source "\ +'(description \"This is a very long string which is indented by a considerable value, causing it to +protrude from the configured `fill-column' since +lisp-fill-paragraph was refactored in version 28.\")")) + (with-temp-buffer + (insert source) + (emacs-lisp-mode) + (search-backward "This is a very long string") + (fill-paragraph) ;function under test + (goto-char (point-min)) + (message "%s" (buffer-substring-no-properties (point-min) (point-max))) + (let ((i 1) + (lines-count (count-lines (point-min) (point-max)))) + (while (< i lines-count) + (beginning-of-line i) + (end-of-line) + (should (<= (current-column) fill-column)) + (setq i (1+ i))))))) + ;;; Fontification commit d4ca688abefa90cf3e54add036b32c06b7da6363 Author: Mauro Aranda Date: Mon Jan 20 21:16:48 2025 -0300 Avoid error with empty search string in Customize * lisp/cus-edit.el (custom-buffer-create-internal): Only call customize-apropos if the string is not empty. (Bug#75714) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 95dd4c9e354..febbc8d1b8b 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1774,14 +1774,17 @@ or a regular expression.") 'editable-field :size 40 :help-echo echo :action (lambda (widget &optional _event) - (customize-apropos (split-string (widget-value widget))))))) + (let ((value (widget-value widget))) + (if (string= value "") + (message "Empty search field") + (customize-apropos (split-string value)))))))) (widget-insert " ") (widget-create-child-and-convert search-widget 'push-button :tag " Search " :help-echo echo :action (lambda (widget &optional _event) - (customize-apropos (split-string (widget-value (widget-get widget :parent)))))) + (widget-apply (widget-get widget :parent) :action))) (widget-insert "\n"))) ;; The custom command buttons are also in the toolbar, so for a commit 062da7003f98cb8352e9cc91e0a8fd7de11b2bd1 Author: Eli Zaretskii Date: Sat Jan 25 12:10:32 2025 +0200 ; Improve prompts and error messages in 'info-look' * lisp/info-look.el (info-lookup-change-mode): Improve text of prompt and error messages. (Bug#75634) diff --git a/lisp/info-look.el b/lisp/info-look.el index 70b04fe72a3..4e6498aa100 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -377,12 +377,13 @@ If optional argument QUERY is non-nil, query for the help mode." (cons (symbol-name mode-spec) mode-spec))) (info-lookup->topic-value topic))) (mode (completing-read - (format "Use %s help mode: " topic) + (format "Major mode whose manuals to search for this %s: " + topic) completions nil t nil 'info-lookup-history))) (or (setq mode (cdr (assoc mode completions))) - (error "No %s help available" topic)) + (error "No manuals available for %s" topic)) (or (info-lookup->mode-value topic mode) - (error "No %s help available for `%s'" topic mode)) + (error "The manuals of `%s' have no %s help" mode topic)) (setq info-lookup-mode mode))) (defun info-lookup--item-to-mode (item mode) commit 0f3d4e157fb9e638f568128096c818d4485b60fa Author: Jared Finder Date: Sat Jan 18 21:06:00 2025 -0800 ; Clean up 'xterm-mouse-mode' auto-enabling vars * lisp/term/xterm.el (xterm--auto-xt-mouse-allowed-names) (xterm--auto-xt-mouse-allowed-types): Use `rx' macro and update docstring. (Bug#74833) diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 23e29400c2f..15101ebd59d 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -84,13 +84,13 @@ capabilities, and only when that terminal understands bracketed paste." "Characters sent by the terminal to end a bracketed paste.") (defconst xterm--auto-xt-mouse-allowed-names - (mapconcat (lambda (s) (concat "^" s "\\>")) - '("Konsole" - "WezTerm" - ;; "XTerm" ;Disabled because OSC52 support is opt-in only. - "iTerm2" ;OSC52 support has opt-in/out UI on first usage - "kitty") - "\\|") + (rx string-start + (or "Konsole" + "WezTerm" + ;; "XTerm" ;Disabled because OSC52 support is opt-in only. + "iTerm2" ;OSC52 support has opt-in/out UI on first usage + "kitty") + word-end) "Regexp for terminals that automatically enable `xterm-mouse-mode' at startup. This will get matched against the terminal's XTVERSION string. @@ -105,14 +105,16 @@ functionality: \"Mouse motion mode\" (DECSET1003): Allows Emacs to get event on mouse motion. -Also see `xterm--auto-xt-mouse-allowed-types' which mtches against the -value of TERM instead.") +Also see `xterm--auto-xt-mouse-allowed-types' which matches against the +value of TERM instead. If either `xterm--auto-xt-mouse-allowed-names' +or `xterm--auto-xt-mouse-allowed-types' matches, then `xterm-mouse-mode' +will get enabled automatically.") (defconst xterm--auto-xt-mouse-allowed-types - (mapconcat (lambda (s) (concat "^" s "$")) - '("alacritty" - "contour") - "\\|") + (rx string-start + (or "alacritty" + "contour") + string-end) "Like `xterm--auto-xt-mouse-allowed-names', but for the terminal's type. This will get matched against the environment variable \"TERM\".") commit 5878c9ae7c958af1828e85a7b4d922c1a8c1b6bf Author: Stefan Monnier Date: Wed Jun 19 16:35:56 2024 -0400 Reload -loaddefs when replacing built-in packages * lisp/emacs-lisp/package.el (package--reload-previously-loaded): Add new optional argument to display a specified warning upon reloading. (package-activate-1): Always reload libraries when loading built-in packages. This avoids ELPA versions of built-in packages to be mixed with the built-in package autoloads. Link: https://yhetil.org/emacs-devel/87y1adrria.fsf@localhost/ diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index be8dc3f8377..b29e0a5f564 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -837,11 +837,15 @@ PKG-DESC is a `package-desc' object." (unless (equal file result) (throw 'done result)))))) -(defun package--reload-previously-loaded (pkg-desc) +(defun package--reload-previously-loaded (pkg-desc &optional warn) "Force reimportation of files in PKG-DESC already present in `load-history'. New editions of files contain macro definitions and redefinitions, the overlooking of which would cause -byte-compilation of the new package to fail." +byte-compilation of the new package to fail. +If WARN is a string, display a warning (using WARN as a format string) +before reloading the files. WARN must have two %-sequences +corresponding to package name (a symbol) and a list of files loaded (as +sexps)." (with-demoted-errors "Error in package--load-files-for-activation: %s" (let* (result (dir (package-desc-dir pkg-desc)) @@ -877,6 +881,10 @@ byte-compilation of the new package to fail." (unless (equal (file-name-base library) (format "%s-autoloads" (package-desc-name pkg-desc))) (push (cons (expand-file-name library dir) recent-index) result)))) + (when (and result warn) + (display-warning 'package + (format warn (package-desc-name pkg-desc) + (mapcar #'car result)))) (mapc (lambda (c) (load (car c) nil t)) (sort result (lambda (x y) (< (cdr x) (cdr y)))))))) @@ -904,8 +912,11 @@ correspond to previously loaded files." (if (listp package--quickstart-pkgs) ;; We're only collecting the set of packages to activate! (push pkg-desc package--quickstart-pkgs) - (when reload - (package--reload-previously-loaded pkg-desc)) + (when (or reload (assq name package--builtin-versions)) + (package--reload-previously-loaded + pkg-desc (unless reload + "Package %S is activated too late. +The following files have already been loaded: %S"))) (with-demoted-errors "Error loading autoloads: %s" (load (package--autoloads-file-name pkg-desc) nil t))) ;; Add info node. commit 1197e85e20730c864e85d8b66c777e3ed0117458 Merge: 5294d450da4 5ee12424b60 Author: Eli Zaretskii Date: Sat Jan 25 11:44:32 2025 +0200 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 5294d450da47734bbe2ca259505674bcae5ff573 Author: Daniel Mendler Date: Sat Jan 11 16:36:56 2025 +0100 ibuffer: Display column titles in header line If the option `ibuffer-use-header-line' is set to `title', display column titles in the header line. * lisp/ibuffer.el (ibuffer--format-title) (ibuffer--format-summary): New functions extracted from `ibuffer-update-title-and-summary'. (ibuffer-update-title-and-summary): Use them. (ibuffer-update): Do not always override `header-line-format'. (ibuffer-use-header-line): Update docstring and option `:type'. * lisp/ibuf-macs.el (define-ibuffer-sorter): Add "@" to the interactive specification for clicks on the header line. * etc/NEWS: Announce the change. (Bug#75497) diff --git a/etc/NEWS b/etc/NEWS index e7c54574688..385e943c997 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -354,6 +354,10 @@ You can now set `asm-comment-char' from 'asm-mode-hook' instead. The variable 'ibuffer-formats' configures the Ibuffer formats. Add 'recency' to the format to display the column. +*** New value 'title' for the user option 'ibuffer-use-header-line'. +Display column titles in the header line if 'ibuffer-use-header-line' is +set to 'title'. + *** New user option 'ibuffer-human-readable-size'. When non-nil, buffer sizes are shown in human readable format. diff --git a/lisp/ibuf-macs.el b/lisp/ibuf-macs.el index ff3dc755c36..7dbc9b4125a 100644 --- a/lisp/ibuf-macs.el +++ b/lisp/ibuf-macs.el @@ -146,7 +146,7 @@ value if and only if `a' is \"less than\" `b'. `(progn (defun ,(intern (concat "ibuffer-do-sort-by-" (symbol-name name))) () ,(or documentation "No :documentation specified for this sorting method.") - (interactive) + (interactive "@") (setq ibuffer-sorting-mode ',name) (when (eq ibuffer-sorting-mode ibuffer-last-sorting-mode) (setq ibuffer-sorting-reversep (not ibuffer-sorting-reversep))) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 11340d4bd9e..a94d9fddade 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -310,8 +310,10 @@ in completion lists of the `ibuffer-jump-to-buffer' command." :type 'boolean) (defcustom ibuffer-use-header-line t - "If non-nil, display a header line containing current filters." - :type 'boolean) + "If non-nil, display a header line. +If the variable's value is t, the header line displays the current +filters. For the value `title', display the column titles." + :type '(choice boolean (const :tag "Column titles" :value title))) (defcustom ibuffer-default-directory nil "The default directory to use for a new Ibuffer buffer. @@ -2048,59 +2050,90 @@ the value of point at the beginning of the line for that buffer." (ibuffer-update-format) (ibuffer-redisplay t)) +(defun ibuffer--format-title (element &optional header-line) + (if (stringp element) + element + (pcase-let ((`(,sym ,min ,_max ,align) element)) + ;; Ignore negative MIN, since the titles are left-aligned. + (when (cl-minusp min) + (setq min (- min))) + (let* ((name (or (get sym 'ibuffer-column-name) + (error "Unknown column %s in ibuffer-formats" sym))) + (len (length name)) + (hmap (get sym 'header-mouse-map)) + (strname (if (< len min) + (ibuffer-format-column name + (- min len) + align) + name))) + (when hmap + (setq + strname + (propertize strname 'mouse-face 'highlight 'keymap + (if header-line + (define-keymap "" hmap) + hmap)))) + strname)))) + +(defun ibuffer--format-summary (element) + (if (stringp element) + (make-string (length element) ?\s) + (pcase-let ((`(,sym ,min ,_max ,align) element)) + ;; Ignore negative MIN, since the summaries are left-aligned. + (when (cl-minusp min) + (setq min (- min))) + (let* ((summary + (if (get sym 'ibuffer-column-summarizer) + (funcall (get sym 'ibuffer-column-summarizer) + (get sym 'ibuffer-column-summary)) + (make-string + (length (get sym 'ibuffer-column-name)) + ?\s))) + (len (length summary))) + (if (< len min) + (ibuffer-format-column summary + (- min len) + align) + summary))))) + (defun ibuffer-update-title-and-summary (format) (ibuffer-assert-ibuffer-mode) ;; Don't do funky font-lock stuff here (let ((inhibit-modification-hooks t)) - (if (get-text-property (point-min) 'ibuffer-title) - (delete-region (point-min) - (next-single-property-change - (point-min) 'ibuffer-title))) - (goto-char (point-min)) - (add-text-properties - (point) - (progn - (let ((opos (point))) - ;; Insert the title names. - (dolist (element format) - (insert - (if (stringp element) - element - (pcase-let ((`(,sym ,min ,_max ,align) element)) - ;; Ignore a negative min when we're inserting the title - (when (cl-minusp min) - (setq min (- min))) - (let* ((name (or (get sym 'ibuffer-column-name) - (error "Unknown column %s in ibuffer-formats" sym))) - (len (length name)) - (hmap (get sym 'header-mouse-map)) - (strname (if (< len min) - (ibuffer-format-column name - (- min len) - align) - name))) - (when hmap - (setq - strname - (propertize strname 'mouse-face 'highlight 'keymap hmap))) - strname))))) - (add-text-properties opos (point) '(ibuffer-title-header t)) - (insert "\n") - ;; Add the underlines - (let ((str (save-excursion - (forward-line -1) - (beginning-of-line) - (buffer-substring (point) (line-end-position))))) - (apply #'insert (mapcar - (lambda (c) - (if (not (or (eq c ?\s) - (eq c ?\n))) - ?- - ?\s)) - str))) - (insert "\n")) - (point)) - `(ibuffer-title t font-lock-face ,ibuffer-title-face)) + ;; Insert the title names. + (if (eq ibuffer-use-header-line 'title) + (setq header-line-format + `("" header-line-indent + ,(propertize " " 'display + '(space :align-to header-line-indent-width)) + ,@(mapcar (lambda (e) (ibuffer--format-title e t)) format))) + (if (get-text-property (point-min) 'ibuffer-title) + (delete-region (point-min) + (next-single-property-change + (point-min) 'ibuffer-title))) + (goto-char (point-min)) + (add-text-properties + (point) + (progn + (let ((opos (point))) + (apply #'insert (mapcar #'ibuffer--format-title format)) + (add-text-properties opos (point) '(ibuffer-title-header t)) + (insert "\n") + ;; Add the underlines + (let ((str (save-excursion + (forward-line -1) + (beginning-of-line) + (buffer-substring (point) (line-end-position))))) + (apply #'insert (mapcar + (lambda (c) + (if (not (or (eq c ?\s) + (eq c ?\n))) + ?- + ?\s)) + str))) + (insert "\n")) + (point)) + `(ibuffer-title t font-lock-face ,ibuffer-title-face))) ;; Now, insert the summary columns. (goto-char (point-max)) (if (get-text-property (1- (point-max)) 'ibuffer-summary) @@ -2112,27 +2145,7 @@ the value of point at the beginning of the line for that buffer." (point) (progn (insert "\n") - (dolist (element format) - (insert - (if (stringp element) - (make-string (length element) ?\s) - (pcase-let ((`(,sym ,min ,_max ,align) element)) - ;; Ignore a negative min when we're inserting the title. - (when (cl-minusp min) - (setq min (- min))) - (let* ((summary - (if (get sym 'ibuffer-column-summarizer) - (funcall (get sym 'ibuffer-column-summarizer) - (get sym 'ibuffer-column-summary)) - (make-string - (length (get sym 'ibuffer-column-name)) - ?\s))) - (len (length summary))) - (if (< len min) - (ibuffer-format-column summary - (- min len) - align) - summary)))))) + (apply #'insert (mapcar #'ibuffer--format-summary format)) (point)) '(ibuffer-summary t))))) @@ -2197,10 +2210,11 @@ If optional arg SILENT is non-nil, do not display progress messages." ;; I tried to update this automatically from the mode-line-process format, ;; but changing nil-ness of header-line-format while computing ;; mode-line-format is asking a bit too much it seems. --Stef - (setq header-line-format - (and ibuffer-use-header-line - ibuffer-filtering-qualifiers - ibuffer-header-line-format))) + (unless (eq ibuffer-use-header-line 'title) + (setq header-line-format + (and ibuffer-use-header-line + ibuffer-filtering-qualifiers + ibuffer-header-line-format)))) (defun ibuffer-sort-bufferlist (bmarklist) (unless ibuffer-sorting-functions-alist commit 5ee12424b600fe5d677f6b526ab038bad4747f83 Author: Stefan Monnier Date: Sat Jan 25 04:42:01 2025 -0500 lisp/repeat.el: Don't expose `cl-extra/cl-lib` distinction diff --git a/lisp/repeat.el b/lisp/repeat.el index fcf9bc24376..f014d8266db 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -87,7 +87,7 @@ ;;; Code: -(require 'cl-extra) +(require 'cl-lib) ;;;;; ************************* USER OPTIONS ************************** ;;;;; commit 35576fde5670dffe104a6b2a76837a1f0a4c16ce Author: Daniel Mendler Date: Sat Jan 11 14:22:02 2025 +0100 ibuffer: New defcustom `ibuffer-human-readable-size' * lisp/ibuffer.el (ibuffer-human-readable-size): New defcustom. (define-ibuffer-column size): Use it. * etc/NEWS: Mention new defcustom. (Bug#75495) diff --git a/etc/NEWS b/etc/NEWS index 22cf8c636c2..e7c54574688 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -354,6 +354,9 @@ You can now set `asm-comment-char' from 'asm-mode-hook' instead. The variable 'ibuffer-formats' configures the Ibuffer formats. Add 'recency' to the format to display the column. +*** New user option 'ibuffer-human-readable-size'. +When non-nil, buffer sizes are shown in human readable format. + ** Smerge *** New command 'smerge-extend' extends a conflict over surrounding lines. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 32bc8140703..11340d4bd9e 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -186,6 +186,12 @@ recreate it for the change to take effect." (sexp :tag "Test Form") face))) +(defcustom ibuffer-human-readable-size nil + "Show buffer sizes in human-readable format. +Use the function `file-size-human-readable' for formatting." + :type 'boolean + :version "31.1") + (defcustom ibuffer-use-other-window nil "If non-nil, display Ibuffer in another window by default." :type 'boolean) @@ -1714,15 +1720,20 @@ If point is on a group name, this function operates on that group." (:inline t :header-mouse-map ibuffer-size-header-map :summarizer - (lambda (column-strings) - (let ((total 0)) - (dolist (string column-strings) - (setq total - ;; like, ewww ... - (+ (float (string-to-number string)) - total))) - (format "%.0f" total)))) - (format "%s" (buffer-size))) + (lambda (strings) + (let ((total + (cl-loop + for s in strings + for i = (text-property-not-all 0 (length s) 'ibuffer-size nil s) + if i sum (get-text-property i 'ibuffer-size s)))) + (if ibuffer-human-readable-size + (file-size-human-readable total) + (number-to-string total))))) + (let ((size (buffer-size))) + (propertize (if ibuffer-human-readable-size + (file-size-human-readable size) + (number-to-string size)) + 'ibuffer-size size))) (define-ibuffer-column recency (:inline t :summarizer ignore :header-mouse-map ibuffer-recency-header-map) commit 5e0fc49f3b14928f08eb314b15f70ccbb2ce7229 Author: Vladimir Panteleev Date: Wed Jan 15 18:33:23 2025 +0000 Quote identifiers in SQL queries in 'sqlite-mode' * lisp/sqlite-mode.el: (sqlite-mode-list-tables) (sqlite-mode-list-columns, sqlite--mode--list-data) (sqlite-mode-delete): Quote identifiers (table and column names) in the SQL queries. Fixes, e.g., opening databases which have a table called "values". (Bug#75598) diff --git a/lisp/sqlite-mode.el b/lisp/sqlite-mode.el index 5deb8c2d7bb..a4b96b02b48 100644 --- a/lisp/sqlite-mode.el +++ b/lisp/sqlite-mode.el @@ -76,7 +76,7 @@ (erase-buffer) (dolist (table (sqlite-select db "select name from sqlite_master where type = 'table' and name not like 'sqlite_%' order by name")) (push (list (car table) - (caar (sqlite-select db (format "select count(*) from %s" + (caar (sqlite-select db (format "select count(*) from \"%s\"" (car table))))) entries)) (sqlite-mode--tablify '("Table Name" "Number of Rows") @@ -137,7 +137,7 @@ (defun sqlite-mode--column-names (table) "Return a list of the column names for TABLE." - (mapcar (lambda (row) (nth 1 row)) (sqlite-select sqlite--db (format "pragma table_info(%s)" table)))) + (mapcar (lambda (row) (nth 1 row)) (sqlite-select sqlite--db (format "pragma table_info(\"%s\")" table)))) (defun sqlite-mode-list-data () "List the data from the table under point." @@ -171,7 +171,7 @@ (setq stmt (sqlite-select sqlite--db - (format "select rowid, * from %s where rowid >= ?" table) + (format "select rowid, * from \"%s\" where rowid >= ?" table) (list rowid) 'set)) (sqlite-mode--tablify (sqlite-columns stmt) @@ -201,11 +201,11 @@ (user-error "Not deleting")) (sqlite-execute sqlite--db - (format "delete from %s where %s" + (format "delete from \"%s\" where %s" (cdr table) (string-join (mapcar (lambda (column) - (format "%s = ?" (car (split-string column " ")))) + (format "\"%s\" = ?" (car (split-string column " ")))) (cons "rowid" (sqlite-mode--column-names (cdr table)))) " and ")) row) commit 13fdcd730ff63bf79caace9a6e46aff5f944b1b7 Author: Gerd Möllmann Date: Sat Jan 25 09:39:56 2025 +0100 Revert "Simplify absolute (x, y) computation on ttys" This reverts commit 5e132835ad320be1d5c45ffbf83d67d16fc7bf96. diff --git a/src/dispextern.h b/src/dispextern.h index 9c193e79fd1..1060895d0f4 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3958,7 +3958,7 @@ void combine_updates (Lisp_Object root_frames); void combine_updates_for_frame (struct frame *f, bool inhibit_id_p); void tty_raise_lower_frame (struct frame *f, bool raise); int max_child_z_order (struct frame *parent); -void root_xy (struct frame *f, int x, int y, int *rx, int *ry); +void frame_pos_abs (struct frame *f, int *x, int *y); bool is_frame_ancestor (struct frame *f1, struct frame *f2); INLINE_HEADER_END diff --git a/src/dispnew.c b/src/dispnew.c index 00e59c767e8..724ec6ece9a 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3313,18 +3313,16 @@ rect_intersect (struct rect *r, struct rect r1, struct rect r2) return true; } -/* Translate (X, Y) relative to frame F to absolute coordinates - in (*X, *Y). */ +/* Return the absolute position of frame F in *X and *Y. */ void -root_xy (struct frame *f, int x, int y, int *rx, int *ry) +frame_pos_abs (struct frame *f, int *x, int *y) { - *rx = x; - *ry = y; + *x = *y = 0; for (; f; f = FRAME_PARENT_FRAME (f)) { - *rx += f->left_pos; - *ry += f->top_pos; + *x += f->left_pos; + *y += f->top_pos; } } @@ -3335,7 +3333,7 @@ static struct rect frame_rect_abs (struct frame *f) { int x, y; - root_xy (f, 0, 0, &x, &y); + frame_pos_abs (f, &x, &y); return (struct rect) { x, y, f->total_cols, f->total_lines }; } @@ -3877,7 +3875,10 @@ abs_cursor_pos (struct frame *f, int *x, int *y) wx += max (0, w->left_margin_cols); - root_xy (f, wx, wy, x, y); + int fx, fy; + frame_pos_abs (f, &fx, &fy); + *x = fx + wx; + *y = fy + wy; return true; } diff --git a/src/term.c b/src/term.c index 00bc94e6e31..4ae9c373888 100644 --- a/src/term.c +++ b/src/term.c @@ -2996,9 +2996,10 @@ mouse_get_xy (int *x, int *y) struct frame *sf = SELECTED_FRAME (); if (f == sf || is_frame_ancestor (sf, f)) { - int mx = XFIXNUM (XCAR (XCDR (mouse))); - int my = XFIXNUM (XCDR (XCDR (mouse))); - root_xy (f, mx, my, x, y); + int fx, fy; + frame_pos_abs (f, &fx, &fy); + *x = fx + XFIXNUM (XCAR (XCDR (mouse))); + *y = fy + XFIXNUM (XCDR (XCDR (mouse))); } } commit 65036323fc1cdf18a7812b1c922583e6466972a6 Author: Gerd Möllmann Date: Sat Jan 25 09:39:54 2025 +0100 Revert "Fix cursor positioning of nested tty child frames" This reverts commit 8cbb3c7335ff03b6fae4efeae126e91993cb962a. diff --git a/src/terminal.c b/src/terminal.c index e6d5a5d309a..db6d42d4b4f 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -110,13 +110,9 @@ set_terminal_window (struct frame *f, int size) void cursor_to (struct frame *f, int vpos, int hpos) { - struct terminal *term = FRAME_TERMINAL (f); - if (term->cursor_to_hook) - { - int x, y; - root_xy (f, hpos, vpos, &x, &y); - term->cursor_to_hook (f, y, x); - } + if (FRAME_TERMINAL (f)->cursor_to_hook) + (*FRAME_TERMINAL (f)->cursor_to_hook) (f, vpos + f->top_pos, + hpos + f->left_pos); } /* Similar but don't take any account of the wasted characters. */ @@ -124,13 +120,9 @@ cursor_to (struct frame *f, int vpos, int hpos) void raw_cursor_to (struct frame *f, int row, int col) { - struct terminal *term = FRAME_TERMINAL (f); - if (term->raw_cursor_to_hook) - { - int x, y; - root_xy (f, row, col, &x, &y); - term->raw_cursor_to_hook (f, y, x); - } + if (FRAME_TERMINAL (f)->raw_cursor_to_hook) + (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row + f->top_pos, + col + f->left_pos); } /* Erase operations. */ commit 9ad28959d6895720865c0718bf60f4b7b0b144f3 Author: Gerd Möllmann Date: Sat Jan 25 09:39:51 2025 +0100 Revert "Fix tty-frame-at for nested tty child frames" This reverts commit 9693f2a95ad14bf0caa34e60d72722d4dd4d85c9. diff --git a/src/term.c b/src/term.c index 7397ee68347..00bc94e6e31 100644 --- a/src/term.c +++ b/src/term.c @@ -2603,11 +2603,9 @@ tty_frame_at (int x, int y) { Lisp_Object frame = Fcar (frames); struct frame *f = XFRAME (frame); - int fx, fy; - root_xy (f, 0, 0, &fx, &fy); - if (fx <= x && x < fx + f->pixel_width - && fy <= y && y < fy + f->pixel_height) + if (f->left_pos <= x && x < f->left_pos + f->pixel_width && + f->top_pos <= y && y < f->top_pos + f->pixel_height) return frame; } commit e2cc52dbcd196f95cc79c6c6d899b9e86e696fe5 Author: Gerd Möllmann Date: Sat Jan 25 09:39:47 2025 +0100 Revert "Fix mouse position handling for nested tty child frames" This reverts commit f37559a1ee035d184bc4db6e4f597281d3ac6879. diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index e395723d05c..19d688e4d1e 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -298,11 +298,16 @@ which is the \"1006\" extension implemented in Xterm >= 277." ;; FIXME: The test for running in batch mode is here solely ;; for the sake of xt-mouse-tests where the only frame is ;; the initial frame. - (frame-and-xy (unless noninteractive (tty-frame-at x y))) - (frame (nth 0 frame-and-xy)) - (x (nth 1 frame-and-xy)) - (y (nth 2 frame-and-xy)) + (frame (unless noninteractive (tty-frame-at x y))) + ;;(_ (message (format "*** %S" frame))) + (frame-pos (frame-position frame)) + ;;(_ (message (format "*** %S" frame-pos))) + (x (- x (car frame-pos))) + (y (- y (cdr frame-pos))) + ;;(_ (message (format "*** %S %S" x y))) (w (window-at x y frame)) + ;;(_ (message (format "*** %S" w))) + (ltrb (window-edges w)) (left (nth 0 ltrb)) (top (nth 1 ltrb)) diff --git a/src/dispextern.h b/src/dispextern.h index e1214128e35..9c193e79fd1 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3959,7 +3959,6 @@ void combine_updates_for_frame (struct frame *f, bool inhibit_id_p); void tty_raise_lower_frame (struct frame *f, bool raise); int max_child_z_order (struct frame *parent); void root_xy (struct frame *f, int x, int y, int *rx, int *ry); -void child_xy (struct frame *f, int x, int y, int *cx, int *cy); bool is_frame_ancestor (struct frame *f1, struct frame *f2); INLINE_HEADER_END diff --git a/src/dispnew.c b/src/dispnew.c index 5a8064a1a02..00e59c767e8 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3328,17 +3328,6 @@ root_xy (struct frame *f, int x, int y, int *rx, int *ry) } } -/* Translate absolute coordinates (X, Y) to coordinates relative to F's origin. */ - -void -child_xy (struct frame *f, int x, int y, int *cx, int *cy) -{ - int rx, ry; - root_xy (f, 0, 0, &rx, &ry); - *cx = x - rx; - *cy = y - ry; -} - /* Return the rectangle frame F occupies. X and Y are in absolute coordinates. */ diff --git a/src/term.c b/src/term.c index e13089af2bb..7397ee68347 100644 --- a/src/term.c +++ b/src/term.c @@ -2595,7 +2595,7 @@ tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row, #endif static Lisp_Object -tty_frame_at (int x, int y, int *cx, int *cy) +tty_frame_at (int x, int y) { for (Lisp_Object frames = Ftty_frame_list_z_order (Qnil); !NILP (frames); @@ -2606,33 +2606,24 @@ tty_frame_at (int x, int y, int *cx, int *cy) int fx, fy; root_xy (f, 0, 0, &fx, &fy); - if ((fx <= x && x < fx + f->pixel_width) - && (fy <= y && y < fy + f->pixel_height)) - { - child_xy (XFRAME (frame), x, y, cx, cy); - return frame; - } + if (fx <= x && x < fx + f->pixel_width + && fy <= y && y < fy + f->pixel_height) + return frame; } return Qnil; } -DEFUN ("tty-frame-at", Ftty_frame_at, Stty_frame_at, 2, 2, 0, - doc : /* Return tty frame containing absolute pixel position (X, Y). -Value is nil if no frame found. Otherwise it is a list (FRAME CX CY), -where FRAME is the frame containing (X, Y) and CX and CY are X and Y -relative to FRAME. */) +DEFUN ("tty-frame-at", Ftty_frame_at, Stty_frame_at, + 2, 2, 0, + doc: /* Return tty frame containing pixel position X, Y. */) (Lisp_Object x, Lisp_Object y) { if (! FIXNUMP (x) || ! FIXNUMP (y)) /* Coordinates this big can not correspond to any frame. */ return Qnil; - int cx, cy; - Lisp_Object frame = tty_frame_at (XFIXNUM (x), XFIXNUM (y), &cx, &cy); - if (NILP (frame)) - return Qnil; - return list3 (frame, make_fixnum (cx), make_fixnum (cy)); + return tty_frame_at (XFIXNUM (x), XFIXNUM (y)); } #ifdef HAVE_GPM @@ -2765,9 +2756,11 @@ term_mouse_click (struct input_event *result, Gpm_Event *event, int handle_one_term_event (struct tty_display_info *tty, const Gpm_Event *event_in) { - Gpm_Event event = *event_in; - Lisp_Object frame = tty_frame_at (event_in->x, event_in->y, &event.x, &event.y); + Lisp_Object frame = tty_frame_at (event_in->x, event_in->y); struct frame *f = decode_live_frame (frame); + Gpm_Event event = *event_in; + event.x -= f->left_pos; + event.y -= f->top_pos; struct input_event ie; int count = 0; commit d93d822285813b89f2444ef93c5747cbeb67a46b Author: Gerd Möllmann Date: Sat Jan 25 09:39:11 2025 +0100 Revert "Multi-tty: selected frame can be a GUI frame" This reverts commit 57b7c07b3709d9a2b2c70e0c8218a52448368a12. diff --git a/src/dispnew.c b/src/dispnew.c index bc37230d70c..5a8064a1a02 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3906,44 +3906,26 @@ is_in_matrix (struct frame *f, int x, int y) return true; } -/* Return the frame of the selected window of frame F. - Value is NULL if we can't tell. */ - -static struct frame * -frame_selected_window_frame (struct frame *f) -{ - /* Paranoia. It should not happen that window or frame not valid. */ - Lisp_Object frame; - if (WINDOWP (f->selected_window) - && (frame = XWINDOW (f->selected_window)->frame, - FRAMEP (frame))) - return XFRAME (frame); - return NULL; -} - -/* Is the terminal cursor of ROOT obscured by a child frame? */ +/* Is the terminal cursor of the selected frame obscured by a child + frame? */ static bool -is_cursor_obscured (struct frame *root) +is_cursor_obscured (void) { - /* Determine in which frame on ROOT the cursor could be. */ - struct frame *sf = frame_selected_window_frame (root); - if (sf == NULL) - return false; - /* Give up if we can't tell where the cursor currently is. */ int x, y; - if (!abs_cursor_pos (sf, &x, &y)) + if (!abs_cursor_pos (SELECTED_FRAME (), &x, &y)) return false; /* (x, y) may be outside of the root frame in case the selected frame is a child frame which is clipped. */ + struct frame *root = root_frame (SELECTED_FRAME ()); if (!is_in_matrix (root, x, y)) return true; struct glyph_row *cursor_row = MATRIX_ROW (root->current_matrix, y); struct glyph *cursor_glyph = cursor_row->glyphs[0] + x; - return cursor_glyph->frame != sf; + return cursor_glyph->frame != SELECTED_FRAME (); } /* Decide where to show the cursor, and whether to hide it. @@ -3957,7 +3939,7 @@ static void terminal_cursor_magic (struct frame *root, struct frame *topmost_child) { /* By default, prevent the cursor "shining through" child frames. */ - if (is_cursor_obscured (root)) + if (is_cursor_obscured ()) tty_hide_cursor (FRAME_TTY (root)); /* If the terminal cursor is not in the topmost child, the topmost @@ -3965,8 +3947,7 @@ terminal_cursor_magic (struct frame *root, struct frame *topmost_child) non-nil, display the cursor in this "non-selected" topmost child frame to compensate for the fact that we can't display a non-selected cursor like on a window system frame. */ - struct frame *sf = frame_selected_window_frame (root); - if (sf && topmost_child != sf) + if (topmost_child != SELECTED_FRAME ()) { Lisp_Object frame; XSETFRAME (frame, topmost_child); @@ -3978,23 +3959,25 @@ terminal_cursor_magic (struct frame *root, struct frame *topmost_child) if (is_in_matrix (root, x, y)) { cursor_to (root, y, x); - tty_show_cursor (FRAME_TTY (root)); + tty_show_cursor (FRAME_TTY (topmost_child)); } else tty_hide_cursor (FRAME_TTY (root)); - } + } } } +#endif /* !HAVE_ANDROID */ + void combine_updates_for_frame (struct frame *f, bool inhibit_scrolling) { +#ifndef HAVE_ANDROID struct frame *root = root_frame (f); /* Determine visible frames on the root frame, including the root frame itself. Note that there are cases, see bug#75056, where we - can be called for invisible frames. This looks like a bug with - multi-tty, but the old update code didn't check visibility either. */ + can be called for invisible frames. */ Lisp_Object z_order = frames_in_reverse_z_order (root, true); if (NILP (z_order)) { @@ -4035,14 +4018,8 @@ combine_updates_for_frame (struct frame *f, bool inhibit_scrolling) add_frame_display_history (f, false); #endif } -} - -#else /* HAVE_ANDROID */ -void -combine_updates_for_frame (struct frame *f, bool inhibit_scrolling) -{ -} #endif /* HAVE_ANDROID */ +} /* Update on the screen all root frames ROOTS. Called from redisplay_internal as the last step of redisplaying. */ commit 52dc01f1c8b3c14405cc9ce2a825ea68edcdadc8 Author: Eli Zaretskii Date: Sat Jan 25 10:38:29 2025 +0200 ; * admin/admin.el (set-version): Note about Android. diff --git a/admin/admin.el b/admin/admin.el index d98b8243f25..131b8574029 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -131,6 +131,11 @@ Root must be the root of an Emacs source tree." (set-version-in-file root "etc/refcards/ru-refcard.tex" newmajor "\\\\newcommand{\\\\versionemacs}\\[0\\]\ {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs"))) + ;; Note: There's also the "android:versionCode=" property in + ;; java/AndroidManifest.xml, whose value is the major Emacs version, + ;; but if we increase it, upgraded installation will be unable to be + ;; downgraded to previous Emacs releases. (The corresponding + ;; "android:versionName=" value there is updated by configure.) (let* ((oldversion (with-temp-buffer (insert-file-contents (expand-file-name "README" root)) commit fb282da2a0756d4e6de16b5879e42204f0d33e5b Author: Stefan Kangas Date: Fri Jan 24 17:32:17 2025 +0100 Avoid double spaces around abbrevations in Texinfo * doc/emacs/custom.texi (Init Rebinding): * doc/emacs/dired.texi (Operating on Files): * doc/emacs/emacs.texi (Top): * doc/emacs/emerge-xtra.texi (Emerge): * doc/emacs/files.texi (Files): * doc/emacs/frames.texi (Drag and Drop): * doc/emacs/misc.texi (Hyperlinking): * doc/emacs/modes.texi (Modes): * doc/emacs/mule.texi (Input Methods): * doc/emacs/windows.texi (Window Tool Bar): * doc/lispintro/emacs-lisp-intro.texi (Lexical & Dynamic Binding Differences): * doc/lispref/elisp.texi (Top): * doc/lispref/functions.texi (Functions, Generic Functions): * doc/lispref/hash.texi (Defining Hash): * doc/lispref/keymaps.texi (Creating Keymaps): * doc/lispref/lists.texi (Property Lists): * doc/lispref/modes.texi (%-Constructs): * doc/lispref/nonascii.texi (Character Properties): * doc/lispref/processes.texi (Misc Network): * doc/lispref/searching.texi (Regexp Functions): * doc/lispref/syntax.texi (Syntax Table Internals): * doc/lispref/text.texi (Filling, Checksum/Hash) (JSONRPC deferred requests): * doc/misc/calc.texi (What is Calc, Modes Tutorial): * doc/misc/cc-mode.texi (List Line-Up, Operator Line-Up) (Custom Macros, Indenting Directives): * doc/misc/efaq.texi (Colors on a TTY, Security risks with Emacs): * doc/misc/eglot.texi (Eglot Variables): * doc/misc/erc.texi (Connecting): * doc/misc/eshell.texi (Aliases, Completion): * doc/misc/flymake.texi (Backend functions): * doc/misc/gnus-faq.texi (FAQ 5 - Composing messages): * doc/misc/gnus.texi (Gnus Unplugged, Window Layout) (Filtering Incoming Mail, History): * doc/misc/idlwave.texi (Online Help, Catalogs): * doc/misc/wisent.texi (Wisent Overview): Be more consistent with abbreviations. Use @: or comma or rewrite to avoid double spaces. Ref: https://lists.gnu.org/r/emacs-devel/2025-01/msg00909.html diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index ad38b330023..22c8bf417e3 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -2044,7 +2044,7 @@ sequences. For example, to bind @kbd{C-c h} to the string @end example Non-@acronym{ASCII} characters can be specified directly in the -string. To bind to e.g.@: @samp{ol@'a}, use: +string. To bind to, for example, @samp{ol@'a}, use: @example (keymap-global-set "C-c h" (key-description "ol@'a")) diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 2160039eaf1..8882049dae1 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -749,7 +749,7 @@ window with a Dired buffer, or the most recently used window with a Dired buffer, or to use any other function. When the value is a function, it will be called with no arguments and is expected to return a list of directories which will be used as defaults -(i.e. default target and ``future history''). +(i.e., default target and ``future history''). Here are the file-manipulating Dired commands that operate on files. diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 4455046c8a1..a81c7134a70 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -462,7 +462,7 @@ File Handling * Copying and Naming:: Copying, naming and renaming files. * Misc File Ops:: Other things you can do on files. * Compressed Files:: Accessing compressed files. -* File Archives:: Operating on tar, zip, jar etc. archive files. +* File Archives:: Operating on tar, zip, jar etc.@: archive files. * Remote Files:: Accessing files on other machines. * Quoted File Names:: Quoting special characters in file names. * File Name Cache:: Completion against a list of files you often use. @@ -588,7 +588,7 @@ International Character Set Support Major and Minor Modes -* Major Modes:: Text mode vs. Lisp mode vs. C mode... +* Major Modes:: Text mode vs.@: Lisp mode vs.@: C mode... * Minor Modes:: Each minor mode is a feature you can turn on independently of any others. * Choosing Modes:: How modes are chosen when visiting files. @@ -909,7 +909,7 @@ Tags Tables Merging Files with Emerge * Overview of Emerge:: How to start Emerge. Basic concepts. -* Submodes of Emerge:: Fast mode vs. Edit mode. +* Submodes of Emerge:: Fast mode vs.@: Edit mode. Skip Prefers mode and Auto Advance mode. * State of Difference:: You do the merge by specifying state A or B for each difference. @@ -1121,7 +1121,7 @@ Hyperlinking and Navigation Features * Embedded WebKit Widgets:: Embedding browser widgets in Emacs buffers. * Browse-URL:: Following URLs. * Goto Address mode:: Activating URLs. -* FFAP:: Finding files etc. at point. +* FFAP:: Finding files etc.@: at point. Emacs Lisp Packages diff --git a/doc/emacs/emerge-xtra.texi b/doc/emacs/emerge-xtra.texi index cea0424814e..d80c3f3b3a3 100644 --- a/doc/emacs/emerge-xtra.texi +++ b/doc/emacs/emerge-xtra.texi @@ -23,7 +23,7 @@ and @ref{Top,, Ediff, ediff, The Ediff Manual}. @menu * Overview of Emerge:: How to start Emerge. Basic concepts. -* Submodes of Emerge:: Fast mode vs. Edit mode. +* Submodes of Emerge:: Fast mode vs.@: Edit mode. Skip Prefers mode and Auto Advance mode. * State of Difference:: You do the merge by specifying state A or B for each difference. diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 3dc6efe17cf..c04ac685ee0 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -34,7 +34,7 @@ on file directories. * Copying and Naming:: Copying, naming and renaming files. * Misc File Ops:: Other things you can do on files. * Compressed Files:: Accessing compressed files. -* File Archives:: Operating on tar, zip, jar etc. archive files. +* File Archives:: Operating on tar, zip, jar etc.@: archive files. * Remote Files:: Accessing files on other machines. * Quoted File Names:: Quoting special characters in file names. * File Name Cache:: Completion against a list of files you often use. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 696d3df44ae..e0d8a607072 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1233,7 +1233,7 @@ or bottom of the window during drag. Emacs can also optionally drag the region with the mouse into another portion of this or another buffer. To enable that, customize the variable @code{mouse-drag-and-drop-region} to a non-@code{nil} -value. Normally, the text is moved, i.e. cut and pasted, when the +value. Normally, the text is moved, i.e.@: cut and pasted, when the destination is the same buffer as the origin; dropping the region on another buffer copies the text instead. If the value of this variable names a modifier key, such as @samp{shift}, @samp{control} or diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 393d3def574..5896dc83fe1 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2996,7 +2996,7 @@ URLs and other types of links occurring in Emacs buffer text. * Embedded WebKit Widgets:: Embedding browser widgets in Emacs buffers. * Browse-URL:: Following URLs. * Goto Address mode:: Activating URLs. -* FFAP:: Finding files etc. at point. +* FFAP:: Finding files etc.@: at point. @end menu @node EWW diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi index 3089a2543e5..c3008a48b04 100644 --- a/doc/emacs/modes.texi +++ b/doc/emacs/modes.texi @@ -23,7 +23,7 @@ words as you type (@pxref{Auto Fill}). Minor modes are independent of one another, and of the selected major mode. @menu -* Major Modes:: Text mode vs. Lisp mode vs. C mode... +* Major Modes:: Text mode vs.@: Lisp mode vs.@: C mode... * Minor Modes:: Each minor mode is a feature you can turn on independently of any others. * Choosing Modes:: How modes are chosen when visiting files. diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 4db0febbef8..397315867e4 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -516,8 +516,9 @@ do the highlighting in the buffer showing the possible characters, rather than in the echo area. To enter characters according to the @dfn{p@=iny@=in} transliteration -method instead, use the @code{chinese-sisheng} input method. This is -a composition based method, where e.g. @kbd{pi1} results in @samp{p@=i}. +method instead, use the @code{chinese-sisheng} input method. This is a +composition based method, where, for example, @kbd{pi1} results in +@samp{p@=i}. In Japanese input methods, first you input a whole word using phonetic spelling; then, after the word is in the buffer, Emacs diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index c5502b54091..a992f26fcdd 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -713,7 +713,7 @@ you customize the value of @code{tab-line-format} in Lisp to add The command @code{global-window-tool-bar-mode} toggles the display of a tool bar at the top of each window. When enabled, multiple windows can display their own tool bar simultaneously. To conserve space, a -window tool bar is hidden if there are no buttons to show, i.e. if +window tool bar is hidden if there are no buttons to show, i.e.@: if @code{tool-bar-map} is @code{nil}. @findex window-tool-bar-mode diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 2c94e7f407e..b041678d8c8 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -3812,7 +3812,7 @@ the @code{let} body finishes, it takes that binding off of the stack, revealing the one it had (if any) before the @code{let} expression. @node Lexical vs Dynamic Binding Example -@unnumberedsubsubsec Example of Lexical vs. Dynamic Binding +@unnumberedsubsubsec Example of Lexical vs.@: Dynamic Binding In some cases, both lexical and dynamic binding behave identically. However, in other cases, they can change the meaning of your program. For example, see what happens in this code under lexical binding: diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index cc5762e37e5..772267453e0 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -560,7 +560,7 @@ Multisession Variables Functions -* What Is a Function:: Lisp functions vs. primitives; terminology. +* What Is a Function:: Lisp functions vs.@: primitives; terminology. * Lambda Expressions:: How functions are expressed as Lisp objects. * Function Names:: A symbol can serve as the name of a function. * Defining Functions:: Lisp expressions for defining functions. diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 6f65ff95c44..569e7b93400 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -11,7 +11,7 @@ explains what functions are, how they accept arguments, and how to define them. @menu -* What Is a Function:: Lisp functions vs. primitives; terminology. +* What Is a Function:: Lisp functions vs.@: primitives; terminology. * Lambda Expressions:: How functions are expressed as Lisp objects. * Function Names:: A symbol can serve as the name of a function. * Defining Functions:: Lisp expressions for defining functions. @@ -1378,7 +1378,7 @@ that don't require them. The type specializer, @code{(@var{arg} @var{type})}, can specify one of the @dfn{system types} in the following list. When a parent type is specified, an argument whose type is any of its more specific child -types, as well as grand-children, grand-grand-children, etc. will also +types, as well as grand-children, grand-grand-children, etc.@: will also be compatible. @table @code diff --git a/doc/lispref/hash.texi b/doc/lispref/hash.texi index 3b40e3f2c59..f429d1512fd 100644 --- a/doc/lispref/hash.texi +++ b/doc/lispref/hash.texi @@ -291,10 +291,10 @@ the same integer. @end defun @defun sxhash-eql obj -This function returns a hash code for Lisp object @var{obj} suitable -for @code{eql} comparison. I.e. it reflects identity of @var{obj} -except for the case where the object is a bignum or a float number, -in which case a hash code is generated for the value. +This function returns a hash code for Lisp object @var{obj} suitable for +@code{eql} comparison. In other words, it reflects identity of +@var{obj} except for the case where the object is a bignum or a float +number, in which case a hash code is generated for the value. If two objects @var{obj1} and @var{obj2} are @code{eql}, then @code{(sxhash-eql @var{obj1})} and @code{(sxhash-eql @var{obj2})} are diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 8c3f21bf18f..56bfb550974 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -459,9 +459,9 @@ Here's an example: @kindex :repeat @kindex repeat-mode @cindex repeatable key bindings -Each command in the keymap can be marked as `repeatable', i.e. usable +Each command in the keymap can be marked as `repeatable', i.e.@: usable in @code{repeat-mode}, by putting a @code{repeat-map} property on it, -e.g. +for example: @lisp (put 'undo 'repeat-map 'undo-repeat-map) diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index a660a9b7ecf..37a07421e94 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -1980,8 +1980,8 @@ valid property list. @node Plists and Alists @subsection Property Lists and Association Lists -@cindex plist vs. alist -@cindex alist vs. plist +@cindex plist vs.@: alist +@cindex alist vs.@: plist @cindex property lists vs association lists Association lists (@pxref{Association Lists}) are very similar to diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 43a1d75cd67..aa13f1316c6 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -2608,7 +2608,7 @@ The value of @code{global-mode-string} (which is part of @item %o The degree of @dfn{travel} of the window through (the visible portion -of) the buffer, i.e. the size of the text above the top of the window +of) the buffer, i.e.@: the size of the text above the top of the window expressed as a percentage of all the text outside the window, or @samp{Top}, @samp{Bottom} or @samp{All}. diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index 43d4181e045..eccca96df0a 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi @@ -644,7 +644,7 @@ be consulted instead. Corresponds to Unicode language- and context-independent special lower-casing rules. The value of this property is a string (which may be empty). For example for U+0130 @sc{latin capital letter i -with dot above} the value is @code{"i\u0307"} (i.e. a 2-character string +with dot above} the value is @code{"i\u0307"} (i.e., a 2-character string consisting of @sc{latin small letter i} followed by U+0307 @sc{combining dot above}). This mapping overrides the @code{lowercase} property, and thus the current case table. For characters with no @@ -741,7 +741,7 @@ belongs, according to the Unicode Standard classification of the Unicode code space into script-specific blocks. This char-table has a single extra slot whose value is the list of all script symbols. Note that Emacs's classification of characters into scripts is not a 1-for-1 -reflection of the Unicode standard, e.g. there is no @samp{symbol} +reflection of the Unicode standard, for example there is no @samp{symbol} script in Unicode. @end defvar diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index df08f82c86a..bde6fa2e871 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -3159,7 +3159,7 @@ machine you are using. The value is an alist whose elements have the form @code{(@var{ifname} . @var{address})}. @var{ifname} is a string naming the interface, @var{address} has the same form as the @var{local-address} and @var{remote-address} arguments to -@code{make-network-process}, i.e. a vector of integers. By default +@code{make-network-process}, i.e.@: a vector of integers. By default both IPv4 and IPv6 addresses are returned if possible. Optional argument @var{full} non-@code{nil} means to instead return a diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 77362b3b401..09ff6202afa 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1835,7 +1835,7 @@ The optional argument @var{paren} can be any of the following: @table @asis @item a string The resulting regexp is preceded by @var{paren} and followed by -@samp{\)}, e.g. use @samp{"\\(?1:"} to produce an explicitly +@samp{\)}. For example, use @samp{"\\(?1:"} to produce an explicitly numbered group. @item @code{words} diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index c4f6a073bb1..3ab349df8f3 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -996,7 +996,7 @@ character (similar to the second character in a syntax descriptor). @cindex syntax tables (accessing elements of) Use @code{aref} (@pxref{Array Functions}) to get the raw syntax -descriptor of a character, e.g. @w{@code{(aref (syntax-table) ch)}}. +descriptor of a character, for example @w{@code{(aref (syntax-table) ch)}}. Here are the syntax codes corresponding to the various syntax classes: diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 5e072b8697b..f3cf0294c81 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1695,7 +1695,7 @@ The @code{pixel-fill-width} helper function can be used to compute the pixel width to use. If given no arguments, it'll return a value slightly less than the width of the current window. The first optional value, @var{columns}, specifies the number of columns using -the standard, monospaced fonts, e.g. @code{fill-column}. The second +the standard, monospaced fonts, for example @code{fill-column}. The second optional value is the window to use. You'd typically use it like this: @@ -4970,7 +4970,7 @@ network. MD5 and SHA-1 are not collision resistant (i.e., it is possible to deliberately design different pieces of data which have the same MD5 or SHA-1 hash), so you should not use them for anything security-related. For security-related applications you should use -the other hash types, such as SHA-2 (e.g. @code{sha256} or +the other hash types, such as SHA-2 (e.g., @code{sha256} or @code{sha512}). @defun secure-hash-algorithms @@ -6136,7 +6136,7 @@ communicating endpoints is a matter of correctly designing the RPC application: when synchronization is needed, requests (which are blocking) should be used; when it isn't, notifications should suffice. However, when Emacs acts as one of these endpoints, asynchronous -events (e.g. timer- or process-related) may be triggered while there +events (e.g., timer- or process-related) may be triggered while there is still uncertainty about the state of the remote endpoint. Furthermore, acting on these events may only sometimes demand synchronization, depending on the event's specific nature. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 0635ab7ac05..9127e3c41cf 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -234,7 +234,7 @@ series of calculators, its many features include: @itemize @bullet @item Choice of algebraic or Reverse Polish notation (RPN), -i.e. stack-based, entry of calculations. +i.e.@: stack-based, entry of calculations. @item Arbitrary precision integers and floating-point numbers. @@ -2630,8 +2630,8 @@ elements.) Calculations involving fractions will always produce exact fractional results; Fraction mode only says what to do when dividing two integers. -@cindex Fractions vs. floats -@cindex Floats vs. fractions +@cindex Fractions vs.@: floats +@cindex Floats vs.@: fractions (@bullet{}) @strong{Exercise 4.} If fractional arithmetic is exact, why would you ever use floating-point numbers instead? @xref{Modes Answer 4, 4}. (@bullet{}) diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 6bda333b4f9..65f178c2fa5 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -6047,7 +6047,7 @@ Line up the second entry of a brace block under the first, when the first line is also contained in an arglist or an enclosing brace @emph{on that line}. -I.e. handle something like the following: +In other words, handle something like the following: @example @group @@ -6081,7 +6081,7 @@ Line up the second entry of a class (etc.) initializer @code{c-basic-offset} characters in from the identifier when: @enumerate @item -The type is a class, struct, union, etc. (but not an enum); +The type is a class, struct, union, etc.@: (but not an enum); @item There is a brace block in the type declaration, specifying it; and @item @@ -6089,7 +6089,7 @@ The first element of the initializer is on the same line as its opening brace. @end enumerate -I.e. we have a construct like this: +In other words, we have a construct like this: @example @group @@ -6123,7 +6123,7 @@ Line up the second entry of a class (etc.) initializer after its opening brace when: @enumerate @item -The type is a class, struct, union, etc. (but not an enum); +The type is a class, struct, union, etc.@: (but not an enum); @item There is a brace block in the type declaration, specifying it; and @item @@ -6131,7 +6131,7 @@ The first element of the initializer is on the same line as its opening brace. @end enumerate -I.e. we have a construct like this: +In other words, we have a construct like this: @example @group @@ -6445,7 +6445,7 @@ function is the same as specifying a list @code{(c-lineup-assignments @defun c-lineup-ternary-bodies @findex lineup-ternary-bodies @r{(c-)} Line up true and false branches of a ternary operator -(i.e. @code{?:}). More precisely, if the line starts with a colon +(i.e., @code{?:}). More precisely, if the line starts with a colon which is a part of a said operator, align it with corresponding question mark. For example: @@ -7018,7 +7018,7 @@ is @code{nil}, all lines inside macro definitions are analyzed as @end defopt Sometimes you may want to indent particular directives -(e.g. @code{#pragma}) as though they were statements. To do this, see +(e.g., @code{#pragma}) as though they were statements. To do this, see @ref{Indenting Directives}. Because a macro can expand into anything at all, near where one is @@ -7210,7 +7210,7 @@ after the mode hooks have run. @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Sometimes you may want to indent particular preprocessor directives -(e.g. @code{#pragma}) as though they were statements. To do this, +(e.g., @code{#pragma}) as though they were statements. To do this, first set up @code{c-cpp-indent-to-body-directives} to include the directive name(s), then enable the ``indent to body'' feature with @code{c-toggle-cpp-indent-to-body}. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 087342f012f..5e4117d4898 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1889,8 +1889,8 @@ capabilities. If by contrast you wish to @emph{disable} tty color support, either start emacs with the @samp{--color=no} command-line option, or ensure -that the frame parameter @code{tty-color-mode} is @code{no}, e.g. by -putting the following in your init file: +that the frame parameter @code{tty-color-mode} is @code{no}, for example +by putting the following in your init file: @lisp (push '(tty-color-mode . no) default-frame-alist) @@ -3687,9 +3687,9 @@ You can tell Emacs the shell's current directory with the command @item Third party packages. -Any package you install into Emacs can run arbitrary code with the -same privileges as the Emacs process itself. Be aware of this when -you use the package system (e.g. @code{M-x list-packages}) with third +Any package you install into Emacs can run arbitrary code with the same +privileges as the Emacs process itself. Be aware of this when you use +the package system (for example, @code{M-x list-packages}) with third party archives. Use only third parties that you can trust! @item diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index af38adc094a..d7bd78e134b 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -872,7 +872,7 @@ If this is non-@code{nil}, and @kbd{M-.} (@code{xref-find-definitions}) lands you in a file outside of your project, such as a system-installed library or header file, transiently consider that file as managed by the same language server. -That file is still outside your project (i.e. @code{project-find-file} +That file is still outside your project (i.e., @code{project-find-file} won't find it), but Eglot and the server will consider it to be part of the workspace. The default is @code{nil}. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 19fb9eaa7d7..ab46753e709 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -851,7 +851,7 @@ Examples of use: In the case of @code{:client-certificate t}, you will need to add a line like the following to your authinfo file -(e.g. @file{~/.authinfo.gpg}): +(for example, @file{~/.authinfo.gpg}): @example machine irc.libera.chat key /home/bandali/my-cert.key cert /home/bandali/my-cert.crt diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 944092f61c2..57aaa3eeddb 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1593,7 +1593,7 @@ edited aliases. Note that unlike aliases in Bash, arguments must be handled explicitly. Within aliases, you can use the special variables -@samp{$*}, @samp{$0}, @samp{$1}, @samp{$2}, etc. to refer to the +@samp{$*}, @samp{$0}, @samp{$1}, @samp{$2}, etc.@: to refer to the arguments passed to the alias. @table @code @@ -2536,8 +2536,8 @@ glob patterns, the pattern will be removed from the input line, and replaced by the completion. @kindex M-? -If you want to see the entire list of possible completions (e.g. when it's -below the @code{completion-cycle-threshold}), press @kbd{M-?}. +If you want to see the entire list of possible completions (e.g., when +it's below the @code{completion-cycle-threshold}), press @kbd{M-?}. @subsection pcomplete Pcomplete, short for programmable completion, is the completion diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 8782089613a..54835767928 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -582,7 +582,7 @@ function was called for the buffer. If the list is empty, this indicates that no changes have been recorded. If it is the first time that this backend function is called for this activation of @code{flymake-mode}, then this argument isn't provided at all -(i.e. it's not merely nil). +(in other words, it's not merely nil). Each element is in the form (@var{beg} @var{end} @var{text}) where @var{beg} and @var{end} are buffer positions, and @var{text} is a diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index 914de5320f0..c4bec5a273f 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -1054,7 +1054,7 @@ of the variables @code{shr-color-visible-distance-min} and messages? * FAQ 5-3:: How to set stuff like From, Organization, Reply-To, signature...? -* FAQ 5-4:: Can I set things like From, Signature etc. group based on +* FAQ 5-4:: Can I set things like From, Signature etc.@: group based on the group I post too? * FAQ 5-5:: Is there a spell-checker? Perhaps even on-the-fly spell-checking? diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 41ec75a5ed2..7bfe580f768 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -18611,7 +18611,7 @@ sending the diary message to them as well. @cindex Gnus agent @cindex Gnus unplugged -In olden times (ca. February '88), people used to run their newsreaders +In olden times (ca.@: February '88), people used to run their newsreaders on big machines with permanent connections to the net. News transport was dealt with by news servers, and all the newsreaders had to do was to read news. Believe it or not. @@ -23348,7 +23348,7 @@ windows resized. Lastly, it's possible to make Gnus window layouts ``atomic'' (@pxref{Atomic Windows, , Atomic Windows, elisp, The GNU Emacs Lisp Reference Manual}) by setting @code{gnus-use-atomic-windows} to -@code{t}. This will ensure that pop-up buffers (e.g. help or +@code{t}. This will ensure that pop-up buffers (e.g., help or completion buffers), will appear below or to the side of the entire Gnus window layout and not, for example, squashed between the summary and article buffers. @@ -24858,7 +24858,7 @@ particular spam group. You don't have to throw all mail into all the spam tests. Another reason why this is nice is that messages to mailing lists you have rules for don't have to have resource-intensive blackhole checks performed on them. You could also specify different -spam checks for your nnmail split vs. your nnimap split. Go crazy. +spam checks for your nnmail split vs.@: your nnimap split. Go crazy. You should set the @code{spam-use-*} variables for whatever spam back ends you intend to use. The reason is that when loading @@ -26979,7 +26979,7 @@ appropriate name, don't you think?) In any case, after spending all that energy on coming up with a new and spunky name, we decided that the name was @emph{too} spunky, so we renamed it back again to ``Gnus''. But in mixed case. ``Gnus'' vs. -``@sc{gnus}''. New vs. old. +``@sc{gnus}''. New vs.@: old. @menu * Gnus Versions:: What Gnus versions have been released. diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 0db01faf3d1..3e431cd1886 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -1333,7 +1333,7 @@ corresponding help (@pxref{Routine Info}). When using completion and Emacs pops up a @file{*Completions*} buffer with possible completions, clicking with @kbd{mouse-3} on a completion item invokes help on that item (@pxref{Completion}). Items for which -help is available in the online system documentation (vs. just the +help is available in the online system documentation (vs.@: just the program source itself) will be emphasized (e.g., colored blue). @end itemize @noindent @@ -3495,7 +3495,7 @@ Controls under what circumstances routine info is updated automatically. @emph{Catalogs} are files containing scanned information on individual routines, including arguments and keywords, calling sequence, file path, -class and procedure vs. function type, etc. They represent a way of +class and procedure vs.@: function type, etc. They represent a way of extending the internal built-in information available for IDL system routines (@pxref{Routine Info}) to other source collections. diff --git a/doc/misc/wisent.texi b/doc/misc/wisent.texi index a92f61fd6c7..bf9837d65fc 100644 --- a/doc/misc/wisent.texi +++ b/doc/misc/wisent.texi @@ -126,7 +126,7 @@ It uses a fast but not so space-efficient encoding for the parse tables, described in Corbett's PhD thesis from Berkeley: @quotation @cite{Static Semantics in Compiler Error Recovery}@* -June 1985, Report No. UCB/CSD 85/251. +June 1985, Report No.@: UCB/CSD 85/251. @end quotation @item commit bc1ab8ac3d8fd8f42641ad45820df995525ddf0b Author: Robert Pluim Date: Fri Jan 24 16:55:15 2025 +0100 ; * doc/emacs/custom.texi (Init Rebinding): Fix spacing. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 426c3d6748a..ad38b330023 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -2044,7 +2044,7 @@ sequences. For example, to bind @kbd{C-c h} to the string @end example Non-@acronym{ASCII} characters can be specified directly in the -string. To bind to e.g. @samp{ol@'a}, use: +string. To bind to e.g.@: @samp{ol@'a}, use: @example (keymap-global-set "C-c h" (key-description "ol@'a")) commit b41ef43af19479279f6f967e3cb9e6b0aa3622d8 Author: Robert Pluim Date: Fri Jan 24 15:58:47 2025 +0100 ; Fix previous change * doc/emacs/fixit.texi (Spelling): Use "personal" instead of "private" dictionary. diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index 1ebc76fa949..f240057aa69 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -371,7 +371,7 @@ Accept the incorrect word---treat it as correct, but only in this editing session and for this buffer. @item i -Insert this word in your private dictionary file so that it will be +Insert this word in your personal dictionary file so that it will be considered correct from now on, even in future sessions. @item m @@ -379,7 +379,7 @@ Like @kbd{i}, but you can also specify dictionary completion information. @item u -Insert the lower-case version of this word in your private dictionary +Insert the lower-case version of this word in your personal dictionary file. @item l @var{word} @key{RET} commit 5638b1d6bd41e822796cbba1e1692c0899183bb5 Author: Rudolf Adamkovič Date: Fri Jan 24 10:52:14 2025 +0100 Ispell: Use "personal dictionary" terminology consistently * lisp/textmodes/ispell.el (ispell-command-loop, ispell-help): Use consistent terminology when referring to "personal dictionary". (Bug#75802) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 2fa729a413c..dbaf19ad8e2 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -56,7 +56,7 @@ ;; Commands in ispell-region: ;; Character replacement: Replace word with choice. May query-replace. ;; ` ': Accept word this time. -;; `i': Accept word and insert into private dictionary. +;; `i': Accept word and insert into personal dictionary. ;; `a': Accept word for this session. ;; `A': Accept word and place in buffer-local dictionary. ;; `r': Replace word with typed-in value. Rechecked. @@ -2196,7 +2196,7 @@ Global `ispell-quit' is set to start location to continue spell session." (insert (car guess) " ") (setq guess (cdr guess))) (insert (substitute-command-keys - "\nUse option `i' to accept this spelling and put it in your private dictionary.\n")))) + "\nUse option `i' to accept this spelling and put it in your personal dictionary.\n")))) (while choices (when (> (+ 7 (current-column) (length (car choices)) @@ -2451,7 +2451,7 @@ Selections are: \\`0'..\\`9' Replace the word with a digit offered in the *Choices* buffer. \\`SPC' Accept word this time. -\\`i' Accept word and insert into private dictionary. +\\`i' Accept word and insert into personal dictionary. \\`a' Accept word for this session. \\`A' Accept word and place in `buffer-local dictionary'. \\`r' Replace word with typed-in value. Rechecked. @@ -2485,7 +2485,7 @@ Selections are: \\`0'..\\`9' Replace the word with a digit offered in the *Choices* buffer. \\`SPC' Accept word this time. -\\`i' Accept word and insert into private dictionary. +\\`i' Accept word and insert into personal dictionary. \\`a' Accept word for this session. \\`A' Accept word and place in `buffer-local dictionary'. \\`r' Replace word with typed-in value. Rechecked. @@ -2505,7 +2505,7 @@ Selections are: (let ((help-1 (concat "[r/R]eplace word; [a/A]ccept for this session; " - "[i]nsert into private dictionary")) + "[i]nsert into personal dictionary")) (help-2 (concat "[l]ook a word up in alternate dictionary; " "e[x/X]it; [q]uit session")) (help-3 (concat "[u]ncapitalized insert into dict. " commit cc791e7499fb2cc64a317e340fc90b45fb683da7 Author: Stefan Kangas Date: Fri Jan 24 01:53:21 2025 +0100 ; Check man pages for mistakes less frequently * admin/make-tarball.txt: Move checking man pages from here... * admin/release-process: ...to here. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 8e23165b257..858f381cb61 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -172,11 +172,6 @@ General steps (for each step, check for possible errors): 4. autoreconf -i -I m4 --force make bootstrap - The below script checks for any mistakes in the source text of - manual pages. Fix any errors and re-run the script to verify. - - ./admin/check-man-pages - Then do this: make -C etc/refcards diff --git a/admin/release-process b/admin/release-process index b76a6aa4ec8..7240ff10a29 100644 --- a/admin/release-process +++ b/admin/release-process @@ -222,6 +222,13 @@ https://publicsuffix.org/list/public_suffix_list.dat - leim/SKK-DIC/SKK-JISYO.L https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.L +** Check for mistakes in man pages. + +The below script checks for any mistakes in the source text of +manual pages. Fix any errors and re-run the script to verify. + + ./admin/check-man-pages + * BUGS ** Check for modes which bind M-s that conflicts with a new global binding M-s commit 4ed4792e3b9f77a504925ca46b2181b5e823556b Author: Stefan Kangas Date: Fri Jan 24 01:40:55 2025 +0100 ; * admin/release-process: Minor copy-edits. diff --git a/admin/release-process b/admin/release-process index d66bc48f70d..b76a6aa4ec8 100644 --- a/admin/release-process +++ b/admin/release-process @@ -90,7 +90,8 @@ documentation (or decide no updates are necessary) for those that aren't. ** Try to reorder NEWS: most important things first, related items together. -** For a major release, add a "New in Emacs XX" section to faq.texi. +** For a major release, add a "New in Emacs XX" section to efaq.texi. +This should highlight some of the more significant changes. ** cusver-check from admin.el can help find new defcustoms missing :version tags. This asks for new and old Lisp directories; use the one @@ -113,14 +114,14 @@ Check for node names using problematic characters: Sadly makeinfo does not warn about such characters. Check for major new features added since the last release (e.g. new -lisp files), and add the relevant authors to the Acknowledgments in +Lisp files), and add the relevant authors to the Acknowledgments in doc/emacs/ack.texi and emacs.texi. To find new files, you could run a command such as this: - $ diff -rq emacs-NN.MM emacs-XX.YY | grep "^Only in emacs-XX" + $ git diff --name-status emacs-NN emacs-XX | grep -E "^A" -where NN.MM is the previous Emacs version, and XX.YY is the new version. -This assumes you have the source trees of both versions available. +where emacs-NN is the previous Emacs release branch, and emacs-XX is the +new one. For major releases, rewrite the "Antinews" appendix of the User Manual (doc/emacs/anti.texi) to describe features lost by downgrading to the @@ -129,10 +130,6 @@ significant changes and new features in the upcoming release, then describe the "benefits" from losing those features. Be funny, use humor. The text written for the previous releases can serve as an example. -The Emacs FAQ (doc/misc/efaq.texi) also has a "What's new" section; -for major releases a new section should be added listing the -significant changes. - Check cross-references between the manuals (e.g. from emacs to elisp) are correct. You can use something like the following in the info directory in the Emacs build tree: commit 4a867c823b77fc77be57f13d355fe9469281d653 Author: Stefan Kangas Date: Thu Jan 23 18:32:29 2025 +0100 Add language server "ruff server" for Python * lisp/progmodes/eglot.el (eglot-server-programs): Add "ruff server" for Python. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 02bb844b54e..9eb28e34faf 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -251,7 +251,7 @@ automatically)." . ,(eglot-alternatives '("pylsp" "pyls" ("basedpyright-langserver" "--stdio") ("pyright-langserver" "--stdio") - "jedi-language-server" "ruff-lsp"))) + "jedi-language-server" ("ruff" "server") "ruff-lsp"))) ((js-json-mode json-mode json-ts-mode jsonc-mode) . ,(eglot-alternatives '(("vscode-json-language-server" "--stdio") ("vscode-json-languageserver" "--stdio") commit 9e687c2871f8fd6146b0c5591d65ee61d8374c5e Author: Randy Taylor Date: Thu Jan 23 11:16:34 2025 -0500 Fix go-ts-mode type declaration indentation (Bug#75785) * lisp/progmodes/go-ts-mode.el (go-ts-mode--indent-rules): Add rule for type_declaration. diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 1e948f7785a..cdd6e427db7 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -90,6 +90,7 @@ ((parent-is "parameter_list") parent-bol go-ts-mode-indent-offset) ((parent-is "select_statement") parent-bol 0) ((parent-is "type_case") parent-bol go-ts-mode-indent-offset) + ((parent-is "type_declaration") parent-bol go-ts-mode-indent-offset) ((parent-is "type_spec") parent-bol go-ts-mode-indent-offset) ((parent-is "type_switch_statement") parent-bol 0) ((parent-is "var_declaration") parent-bol go-ts-mode-indent-offset) commit f751b3afa4f5646625293cb5484606842f96495e Author: Eli Zaretskii Date: Thu Jan 23 12:29:04 2025 +0200 ; Minor improvements for doc strings in map.el * lisp/emacs-lisp/map.el (map-let, map-put, map-apply) (map-values-apply, map-some, map-every-p, map--merge) (map-merge-with, map-put!): Doc fixes. diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index 9c19dfdda78..72ff5e2221d 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el @@ -71,7 +71,7 @@ to match if any element of ARGS fails to match." ,@(map--make-pcase-bindings args))) (defmacro map-let (keys map &rest body) - "Bind the variables in KEYS to the elements of MAP then evaluate BODY. + "Bind the variables in KEYS to the elements of MAP, then evaluate BODY. KEYS can be a list of symbols, in which case each element will be bound to the looked up value in MAP. @@ -192,7 +192,7 @@ or array." "Associate KEY with VALUE in MAP and return VALUE. If KEY is already present in MAP, replace the associated value with VALUE. -When MAP is an alist, test equality with TESTFN if non-nil, +If MAP is an alist, test equality with TESTFN if non-nil, otherwise use `equal'. MAP can be an alist, plist, hash-table, or array." @@ -318,7 +318,7 @@ The default implementation delegates to `map-do'." (cl-defgeneric map-apply (function map) "Apply FUNCTION to each element of MAP and return the result as a list. -FUNCTION is called with two arguments, the key and the value. +FUNCTION is called with two arguments, the key of an element and its value. The default implementation delegates to `map-do'." (let ((res '())) (map-do (lambda (k v) (push (funcall function k v) res)) map) @@ -339,7 +339,7 @@ The default implementation delegates to `map-apply'." map)) (cl-defgeneric map-values-apply (function map) - "Return the result of applying FUNCTION to each value in MAP. + "Return the result of applying FUNCTION to the value of each key in MAP. The default implementation delegates to `map-apply'." (map-apply (lambda (_ val) (funcall function val)) @@ -407,8 +407,9 @@ If MAP is a plist, TESTFN defaults to `eq'." (not (eq v (gethash key map v))))) (cl-defgeneric map-some (pred map) - "Return the first non-nil (PRED key val) in MAP. + "Return the first non-nil value from applying PRED to elements of MAP. Return nil if no such element is found. +PRED is called with two arguments: the key of an element and its value. The default implementation delegates to `map-do'." ;; FIXME: Not sure if there's much benefit to defining it as defgeneric, ;; since as defined, I can't think of a map-type where we could provide an @@ -422,7 +423,8 @@ The default implementation delegates to `map-do'." nil)) (cl-defgeneric map-every-p (pred map) - "Return non-nil if (PRED key val) is non-nil for all elements of MAP. + "Return non-nil if calling PRED on all elements of MAP returns non-nil. +PRED is called with two arguments: the key of an element and its value. The default implementation delegates to `map-do'." ;; FIXME: Not sure if there's much benefit to defining it as defgeneric, ;; since as defined, I can't think of a map-type where we could provide an @@ -436,7 +438,7 @@ The default implementation delegates to `map-do'." (defun map--merge (merge type &rest maps) "Merge into a map of TYPE all the key/value pairs in MAPS. -MERGE is a function that takes the target MAP, a KEY, and a +MERGE is a function that takes the target MAP, a KEY and its VALUE, merges KEY and VALUE into MAP, and returns the result. MAP may be of a type other than TYPE." ;; Use a hash table internally if `type' is a list. This avoids @@ -466,7 +468,7 @@ See `map-into' for all supported values of TYPE." (defun map-merge-with (type function &rest maps) "Merge into a map of TYPE all the key/value pairs in MAPS. When two maps contain the same key, call FUNCTION on the two -values and use the value returned by it. +values and use the value FUNCTION returns. Each of MAPS can be an alist, plist, hash-table, or array. See `map-into' for all supported values of TYPE." (let ((not-found (list nil))) @@ -502,8 +504,8 @@ See `map-into' for all supported values of TYPE." "Associate KEY with VALUE in MAP. If KEY is already present in MAP, replace the associated value with VALUE. -This operates by modifying MAP in place. -If it cannot do that, it signals a `map-not-inplace' error. +This operates by modifying MAP in place. If it cannot do that, +it signals the `map-not-inplace' error. To insert an element without modifying MAP, use `map-insert'." ;; `testfn' only exists for backward compatibility with `map-put'! (declare (advertised-calling-convention (map key value) "27.1"))) commit cda78edc7d9194181bcda1790f29cb7cf3ceb0b9 Author: Stefan Kangas Date: Thu Jan 23 03:13:01 2025 +0100 ; Fix typos diff --git a/ChangeLog.3 b/ChangeLog.3 index 067a60cdb0a..8fcec8da85b 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -47356,7 +47356,7 @@ possible bug. * lisp/progmodes/flymake.el (flymake--mode-line-counter): Must - explicily create a new string unpropertized string + explicitly create a new string unpropertized string 2020-12-31 João Távora @@ -160589,7 +160589,7 @@ to be replaced with an appropriate character reference. Make ‘sgml-quote’ do that. - While at it, fix entiteis not being unquoted if they lack closing + While at it, fix entities not being unquoted if they lack closing semicolon (e.g. ‘&’) occurring at the very end of a region. Even though unlikely, make ‘sgml-quote’ handle this scenario. @@ -186569,7 +186569,7 @@ Delete a Flymake obsolete alias that can't possibly work The function `flymake-ler-make-ler' can't possibly work as an backward - compatible interface to existing extensinos (even purely hypothetical + compatible interface to existing extensions (even purely hypothetical ones, since none are known). This is because every diagnostic considered by Flymake has to passed to a report-fn function. @@ -223234,7 +223234,7 @@ called any longer. Furthermore, when newline has whitespace syntax, ‘\s-$’ regular - expression ends up matching empty lins since ‘\s-’ matches newline + expression ends up matching empty lines since ‘\s-’ matches newline characetr of proceeding line. This leads to needless loop iterations. Since previous change to ‘delete-trailing-whitespace’ already introduced diff --git a/ChangeLog.4 b/ChangeLog.4 index 80e16869ad7..accbf824c7e 100644 --- a/ChangeLog.4 +++ b/ChangeLog.4 @@ -342,7 +342,7 @@ Improve documentation for 'while-let' - * doc/lispref/control.texi (Conditionals): Reorganise describing + * doc/lispref/control.texi (Conditionals): Reorganize describing what's overlapping between the macros (and between the macros and let*), and then improve the documentation for 'while-let'. @@ -15155,7 +15155,7 @@ Remove unnecessary (delq nil...). - This is presumed to be an artifacto of an old default. + This is presumed to be an artifact of an old default. * lisp/which-key.el (which-key-replacement-alist): Remove unnecessary (delq nil...). @@ -50535,7 +50535,7 @@ The Emacs regexp engine interprets character ranges from ASCII to raw bytes, such as [a-\xfe], as not including non-ASCII Unicode at all; - ranges from non-ACII Unicode to raw bytes, such as [ü-\x91], are + ranges from non-ASCII Unicode to raw bytes, such as [ü-\x91], are ignored entirely. To make rx produce a translation that works as intended, split ranges @@ -53275,7 +53275,7 @@ * lisp/emacs-lisp/cl-macs.el (cl--slet): Add `nowarn` arg. (cl--defsubst-expand): Use it. - (cl-defstruct): Silence warnings abour lexical shadowing when a slot's + (cl-defstruct): Silence warnings about lexical shadowing when a slot's name happens to be the same as a dynbound var. 2023-06-25 Stefan Monnier @@ -68708,7 +68708,7 @@ works. * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): - Instead of re-using local variables through mutation, bind them at + Instead of reusing local variables through mutation, bind them at point of use. This ensures that there is no value leakage by mistake and actually reduces the static size of the bytecode of this function somewhat. @@ -75501,7 +75501,7 @@ 4004dde6ea Avoid positional arguments to define-minor-mode cb85f9c274 Fix typo in use-package docstring 30b35d6d62 Update use-package.texi - 9be2580f5f optimization: constand folding for read-kbd-macro + 9be2580f5f optimization: constant folding for read-kbd-macro 1143f14d65 bind-keys-form: error for repeat sub-keywords without :rep... c4bd2aa3b8 bind-key-form: allow :continue keyword inside repeat map 5ef327ce9f bind-key-form: allow :exit keyword inside repeat map diff --git a/admin/codespell/codespell.exclude b/admin/codespell/codespell.exclude index f4c67ae83e8..5bb85a0dac3 100644 --- a/admin/codespell/codespell.exclude +++ b/admin/codespell/codespell.exclude @@ -1743,3 +1743,16 @@ Timo Savola, Jorgen Sch@"afer, Holger Schauer, William Schelter, Ralph 2a85d81c47 Add support for gathering statistics on use-package declar... (let* ((nam (buffer-substring (match-beginning 2) (match-end 2))) (setq nmlst (cons nam nmlst) + (elisp--safe-macroexpand-all): Make the warning more discrete. +|PACK|UNPK|INDX|BLD |LEN |... | +@key{INDX} removes an integer @var{n}, then builds a vector of +integers from 1 to @var{n}. @kbd{INV INDX} takes three numbers +(sref STRING INDX) returns the character in STRING at INDEX. INDEX +;; |PACK|UNPK|INDX|BLD |LEN |... | + ( "INDX" (progn calc-num-prefix calc-index) "\C-u\excalc-index\r" ) + (calc-enter-result 3 "indx" (cons 'calcFunc-index (calc-top-list-n 3))) + (calc-enter-result 0 "indx" (list 'calcFunc-index + (elisp--safe-macroexpand-all): Make the warning more discreet. + dee6b36286 If use-package-verbose is t, show loading times when :afte... + 267fc6d00c4 ruby-smie-rules: Fix misindentation of a method call afte... + b0181dafb9e Improve documentation of 'enable-local-variables' in Emac... diff --git a/admin/nt/dist-build/build-dep-zips.py b/admin/nt/dist-build/build-dep-zips.py index 567e8eb2133..af3036eb8e6 100755 --- a/admin/nt/dist-build/build-dep-zips.py +++ b/admin/nt/dist-build/build-dep-zips.py @@ -30,7 +30,7 @@ # Base URI for the package sources mapped in PKG_REQ SRC_REPO="https://repo.msys2.org/mingw/sources" -# Map items in `dynamic-library-alist' to source pakages +# Map items in `dynamic-library-alist' to source packages PKG_REQ='''mingw-w64-x86_64-giflib mingw-w64-x86_64-gnutls mingw-w64-x86_64-harfbuzz @@ -47,7 +47,7 @@ mingw-w64-x86_64-tree-sitter mingw-w64-x86_64-sqlite3'''.split() -# Emacs style path to dependancy DLLs on build system +# Emacs style path to dependency DLLs on build system DLL_SRC="c:/msys64/mingw64/bin" # libraries we never include @@ -110,7 +110,7 @@ def gather_deps(): print("Deps updated in", os.getcwd(), "as", zipfile) os.chdir("../") -# Return dependancies listed in Emacs +# Return dependencies listed in Emacs def init_deps(): return '''libXpm-nox4.dll libpng16-16.dll @@ -382,7 +382,7 @@ def clean(): parser.add_argument("-l", help="list dependencies", action="store_true") -parser.add_argument("-e", help="extract direct dependancies", +parser.add_argument("-e", help="extract direct dependencies", action="store_true") args = parser.parse_args() diff --git a/admin/nt/dist-build/emacs.nsi b/admin/nt/dist-build/emacs.nsi index b8226d69423..4a5de4f85f9 100644 --- a/admin/nt/dist-build/emacs.nsi +++ b/admin/nt/dist-build/emacs.nsi @@ -92,7 +92,7 @@ Section "Uninstall" # remove All Users shortcuts only # SetShellVarContext all - # retreive/recalculate uninstaller location + # retrieve/recalculate uninstaller location StrCpy $UninstallerPath "$INSTDIR\Uninstall-${VERSION_BRANCH}.exe" # remove registry key @@ -101,7 +101,7 @@ Section "Uninstall" # delete uninstaller Delete "$INSTDIR\Uninstall-${VERSION_BRANCH}.exe" - # retreive/reclculate startmenu shortcuts location + # retrieve/recalculate startmenu shortcuts location !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder StrCpy $StartMenuFolder "$SMPROGRAMS\$StartMenuFolder" @@ -120,7 +120,7 @@ Section "Uninstall" # we're basically using GOTO, above, so we should get here.. startMenuDeleteLoopDone: - # next we remove stuff from program-files/instalation path + # next we remove stuff from program-files/installation path # start with recursive delete of the Emacs we installed RMDir /r "$INSTDIR\emacs-${VERSION_BRANCH}" diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 23d770ce450..53cc73a1650 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -4712,7 +4712,7 @@ and secondary selections by saving the value supplied into a variable subsequent calls to @code{gui-get-selection} return. From the clipboard, @code{gui-get-selection} is capable of returning -UTF-8 string data of the type @code{STRING}, the @code{TAREGTS} data +UTF-8 string data of the type @code{STRING}, the @code{TARGETS} data type, or image and application data of any MIME type. @code{gui-set-selection} sets only string data, much as under MS-Windows, although this data is not affected by the value of diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index f598d96c625..cc82a03db98 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -2745,7 +2745,7 @@ The window-relative vertical position of the line containing @item window_end_valid This field is set to a non-zero value if @code{window_end_pos} and @code{window_end_vpos} are truly valid. This is zero if nontrivial -redisplay is pre-empted, since in that case the display that +redisplay is preempted, since in that case the display that @code{window_end_pos} was computed for did not get onto the screen. @item cursor diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 1dcbe017353..49e9248c688 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1600,7 +1600,7 @@ https://lists.gnu.org/r/emacs-devel/2016-07/msg00154.html. *** In Emacs built with GTK+ toolkit, menu-bar background becomes transparent. -This happens when 'alpha-background' is less than 100. This is due a +This happens when 'alpha-background' is less than 100. This is due to a GTK limitation, for which no workaround is currently known, unfortunately. @@ -1622,7 +1622,7 @@ after switching back from another virtual desktop. Setting the variable *** Gnome desktop does not respect frame size specified in .Xresources -This has been obeserved when running a GTK+ build of Emacs 29 from the +This has been observed when running a GTK+ build of Emacs 29 from the launch pad on Ubuntu 24.04 with mutter as window manager. The problem can be resolved by running Emacs from the command line instead. diff --git a/etc/future-bug b/etc/future-bug index c18dd995d66..a9c871d6cee 100644 --- a/etc/future-bug +++ b/etc/future-bug @@ -30,7 +30,7 @@ comments when you write it (sometime in 2198 as I recall). P.S. You'll be pleased to know that since (time-forward N) still works - for N >= 0, we've used it to pre-emptively update configure.ac. + for N >= 0, we've used it to preemptively update configure.ac. Emacs now configures and builds on every platform that will ever be made. It wasn't easy, but at least that's one problem out of the way for good. If you'd like the patch, just ask. diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 457f4ed42ec..d94cbed94e9 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -102,7 +102,7 @@ ;; the absolute format (see e.g. `calendar-iso-from-absolute' in ;; cal-iso.el). This representation is also useful for certain ;; calculations; e.g. `calendar-day-of-week' is simply the absolute -;; represention modulo 7, because December 31, 1BC is a Sunday. +;; representation modulo 7, because December 31, 1BC is a Sunday. ;; A note on free variables: diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index abc789d403c..36cbc1c08fe 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -198,7 +198,7 @@ ;; ;; The expected syntax of an item is either "word" or "symbol", ;; possibly ending with optional whitespace. Everything following - ;; the item (but belonging to it) is expected to by skipable by + ;; the item (but belonging to it) is expected to by skippable by ;; `forward-sexp'. The list of items is expected to be separated ;; by commas and terminated by semicolons or equals signs. ;; diff --git a/lisp/type-break.el b/lisp/type-break.el index b36860e48ef..551af70a484 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el @@ -116,8 +116,8 @@ then there is no minimum threshold; as soon as the scheduled time has elapsed, the user will always be queried. The second number is the maximum number of keystrokes that can be entered -before a typing break is requested immediately, pre-empting the originally -scheduled break. If this second value is nil, then no pre-emptive breaks +before a typing break is requested immediately, preempting the originally +scheduled break. If this second value is nil, then no preemptive breaks will occur; only scheduled ones will. Keys with bucky bits (shift, control, meta, etc) are counted as only one diff --git a/nextstep/README b/nextstep/README index 487ea52ead4..853d6bcda35 100644 --- a/nextstep/README +++ b/nextstep/README @@ -14,7 +14,7 @@ OpenStep and then Rhapsody, which became Mac OS X. In 2004 it was adapted to GNUstep, a free OpenStep implementation, and in 2008 it was merged to the GNU Emacs trunk and released with Emacs 23. Around the same time a separate Mac-only port using the Carbon APIs and -descending from a 2001 Mac OS 8/9 port of Emacs 21 was removed. (It +descending from a 2001 Mac OS 8/9 port of Emacs 21 was removed. (It remains available externally under the name "mac".) @@ -48,12 +48,12 @@ Classes are declared like the following: GUIDELINES -* Adhere the to the FSF philosophy that a feature in GNU software - should not only be available on non-free systems. +* Adhere to the FSF philosophy that a feature in GNU software should not + only be available on non-free systems. * People with varying Cocoa and Objective-C skills will read and modify the NS code over a long period of time. Keep the code simple - and avoid language constructs that makes the code hard to maintain. + and avoid language constructs that make the code hard to maintain. * Don't use macros and types intended for the XCode Interface Builder, like 'IBAction'. @@ -81,7 +81,7 @@ GNUstep. Even though they are less frequently used, this is important for a number of reasons: * It supports the GNUstep project and provides an Emacs with the same - look-and-feel as the rest of the system. + look and feel as the rest of the system. * This allows other Emacs developers to test their changes on the NS interface without having access to a macOS machine. @@ -93,7 +93,7 @@ for a number of reasons: SEE ALSO -The src/ns... files contains the C and Objective-C parts. +The src/ns... files contain the C and Objective-C parts. The lisp/term/ns-win.el file contains the lisp part of the NS interface. diff --git a/src/ChangeLog.3 b/src/ChangeLog.3 index 0051330f556..259bd1836f4 100644 --- a/src/ChangeLog.3 +++ b/src/ChangeLog.3 @@ -15583,7 +15583,7 @@ 1989-04-29 Joe Arceneaux (jla@apple-gunkies.ai.mit.edu) - * xterm.c (x_term_init): Don't set visible bell, as it pre-empts + * xterm.c (x_term_init): Don't set visible bell, as it preempts .emacs control. 1989-04-26 Richard Stallman (rms@sugar-bombs.ai.mit.edu) diff --git a/src/keyboard.c b/src/keyboard.c index ffb90c56f4a..a9548011c93 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2681,7 +2681,7 @@ read_char (int commandflag, Lisp_Object map, /* Normal case: no input arrived during redisplay. */ break; - /* Input arrived and pre-empted redisplay. + /* Input arrived and preempted redisplay. Process any events which are not user-visible. */ swallow_events (false); /* If that cleared input_pending, try again to redisplay. */ commit ce50a1d3c18bcf0e5f51f4ed49f292f7be31010d Author: Eli Zaretskii Date: Tue Jan 21 21:25:15 2025 +0200 ; * src/w32.c (w32_memory_info): Fix coding style of last change. diff --git a/src/w32.c b/src/w32.c index 0d876951cf6..1135462ba8c 100644 --- a/src/w32.c +++ b/src/w32.c @@ -7659,7 +7659,7 @@ w32_memory_info (unsigned long long *totalram, unsigned long long *freeram, { MEMORYSTATUS memst; MEMORY_STATUS_EX memstex; - memstex.dwLength = sizeof(memstex); + memstex.dwLength = sizeof (memstex); /* Use GlobalMemoryStatusEx if available, as it can report more than 2GB of memory. */ if (global_memory_status_ex (&memstex)) @@ -7671,7 +7671,7 @@ w32_memory_info (unsigned long long *totalram, unsigned long long *freeram, return 0; } - memst.dwLength = sizeof(memst); + memst.dwLength = sizeof (memst); if (global_memory_status (&memst)) { *totalram = memst.dwTotalPhys; commit 58d3d4820ad327f07cea5894a9675bf30553461e Author: Arthur Miller Date: Tue Jan 21 19:10:14 2025 +0100 Fix bug in w32_memory_info * src/w32.c (w32_memory_info): Initialize struct size. diff --git a/src/w32.c b/src/w32.c index 6399d883544..0d876951cf6 100644 --- a/src/w32.c +++ b/src/w32.c @@ -7659,7 +7659,7 @@ w32_memory_info (unsigned long long *totalram, unsigned long long *freeram, { MEMORYSTATUS memst; MEMORY_STATUS_EX memstex; - + memstex.dwLength = sizeof(memstex); /* Use GlobalMemoryStatusEx if available, as it can report more than 2GB of memory. */ if (global_memory_status_ex (&memstex)) @@ -7670,7 +7670,9 @@ w32_memory_info (unsigned long long *totalram, unsigned long long *freeram, *freeswap = memstex.ullAvailPageFile; return 0; } - else if (global_memory_status (&memst)) + + memst.dwLength = sizeof(memst); + if (global_memory_status (&memst)) { *totalram = memst.dwTotalPhys; *freeram = memst.dwAvailPhys; commit 77386412050fa348940bf83c5d736ff7b745d5d8 Author: Eli Zaretskii Date: Tue Jan 21 14:24:57 2025 +0200 Avoid crashes in redisplay due to problematic font setups * src/xdisp.c (handle_single_display_spec) (produce_stretch_glyph): Avoid crashes if a face's font is NULL. (Bug#75725) diff --git a/src/xdisp.c b/src/xdisp.c index 19ce5b74b01..f11a8aa6d55 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -6111,7 +6111,9 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, { struct face *face = FACE_FROM_ID (it->f, it->face_id); it->voffset = - (XFLOATINT (value) - * (normal_char_height (face->font, -1))); + * (face->font + ? normal_char_height (face->font, -1) + : FRAME_LINE_HEIGHT (it->f))); } #endif /* HAVE_WINDOW_SYSTEM */ } @@ -32056,7 +32058,8 @@ produce_stretch_glyph (struct it *it) /* Compute height. */ if (FRAME_WINDOW_P (it->f)) { - int default_height = normal_char_height (font, ' '); + int default_height = + font ? normal_char_height (font, ' ') : FRAME_LINE_HEIGHT (it->f); if ((prop = plist_get (plist, QCheight), !NILP (prop)) && calc_pixel_width_or_height (&tem, it, prop, font, false, NULL)) commit 0e3687e6006ea93603a032056c6af99a242c6af5 Author: Robert Pluim Date: Fri Jan 17 09:44:32 2025 +0100 Improve 'key-valid-p' docstring * lisp/keymap.el (key-valid-p): Add "RET", "", and "C-m" examples. (Bug#75586) diff --git a/lisp/keymap.el b/lisp/keymap.el index f74a84e8806..b2c7321a1d5 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -343,6 +343,9 @@ Here are some example of valid key sequences. \"C-c o\" (a two-key sequence: the key `c' with the control modifier followed by the key `o') \"H-\" (the cursor control key named \"left\" with the hyper modifier) + \"RET\" (the \"return\" key, also available as \"C-m\") + \"\" (the \"\" function key, which can be bound separately + from \"RET\" on some systems) \"M-RET\" (the \"return\" key with a meta modifier) \"C-M-\" (the \"space\" key with both the control and meta modifiers) commit 9878092d2b9114d70149c3d9ce1c24e2825138ae Author: Stefan Kangas Date: Sun Jan 19 14:28:30 2025 +0100 Minor copyedits in internals.texi * doc/lispref/internals.texi (Writing Emacs Primitives): Minor copyedits. diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index b318f26d26f..f598d96c625 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -1021,7 +1021,7 @@ comment. @xref{Documentation Basics}, for more details. (@code{int} and @code{bool}), the name of the C variable is the name of the Lisp variable with @code{-} replaced by @code{_}. When the variable has type @code{Lisp_Object}, the convention is to also prefix -the C variable name with @code{V}. i.e. +the C variable name with @code{V}. This is an example: @smallexample DEFVAR_INT ("my-int-variable", my_int_variable, @@ -1038,7 +1038,6 @@ with @code{let}. In C sources, this is done by defining a corresponding, constant symbol, and using @code{specbind}. By convention, @code{Qmy_lisp_variable} corresponds to @code{Vmy_lisp_variable}; to define it, use the @code{DEFSYM} macro. -i.e. @smallexample DEFSYM (Qmy_lisp_variable, "my-lisp-variable"); @@ -1050,17 +1049,17 @@ DEFSYM (Qmy_lisp_variable, "my-lisp-variable"); specbind (Qmy_lisp_variable, Qt); @end smallexample - In Lisp symbols sometimes need to be quoted, to achieve the same -effect in C you again use the corresponding constant symbol + In Lisp, symbols sometimes need to be quoted. To achieve the same +effect in C, you again use the corresponding constant symbol @code{Qmy_lisp_variable}. For example, when creating a buffer-local -variable (@pxref{Buffer-Local Variables}) in Lisp you would write: +variable (@pxref{Buffer-Local Variables}) in Lisp, you would write: @smallexample (make-variable-buffer-local 'my-lisp-variable) @end smallexample -In C the corresponding code uses @code{Fmake_variable_buffer_local} in -combination with @code{DEFSYM}, i.e. +In C, the corresponding code uses @code{Fmake_variable_buffer_local} in +combination with @code{DEFSYM}: @smallexample DEFSYM (Qmy_lisp_variable, "my-lisp-variable"); commit 4726900fdc5b0736feb03e928594eb64262f9bd5 Author: Stefan Kangas Date: Sun Jan 19 13:57:23 2025 +0100 Better document side-effect free and pure C functions * doc/lispref/internals.texi (Writing Emacs Primitives): Document that side-effect free and pure properties of C functions are defined in byte-opt.el. diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 3703c6087f7..b318f26d26f 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -1164,7 +1164,8 @@ functions. If you define a function which is side-effect free or pure, give it a non-@code{nil} @code{side-effect-free} or @code{pure} property, -respectively (@pxref{Standard Properties}). +respectively (@pxref{Standard Properties}). See the lists defined in +@samp{byte-opt.el}. @node Writing Dynamic Modules @section Writing Dynamically-Loaded Modules commit 04c475a39f25b09b557e3183bcd5340d75120e0c Author: Eli Zaretskii Date: Sat Jan 18 15:07:52 2025 +0200 ; Fix documentation about faces of tool-tip text * lisp/tooltip.el (tooltip): * src/frame.c (syms_of_frame) : Doc fixes. diff --git a/lisp/tooltip.el b/lisp/tooltip.el index a198a3d8d08..482af3bd7bf 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el @@ -135,8 +135,8 @@ of the `tooltip' face are used instead." :inherit variable-pitch)) "Face for tooltips. -When using the GTK toolkit, this face will only be used if -`x-gtk-use-system-tooltips' is non-nil." +When using the GTK toolkit, NS, or Haiku, this face will only +be used if `use-system-tooltips' is nil." :group 'tooltip :group 'basic-faces) diff --git a/src/frame.c b/src/frame.c index 8753f168a3b..b21ff73c9ef 100644 --- a/src/frame.c +++ b/src/frame.c @@ -6795,11 +6795,11 @@ Gtk+ tooltips are not used) and on Windows. */); tooltip_reuse_hidden_frame = false; DEFVAR_BOOL ("use-system-tooltips", use_system_tooltips, - doc: /* Use the toolkit to display tooltips. -This option is only meaningful when Emacs is built with GTK+ or Haiku -windowing support, and results in tooltips that look like those -displayed by other GTK+ or Haiku programs, but will not be able to -display text properties inside tooltip text. */); + doc: /* Whether to use the toolkit to display tooltips. +This option is only meaningful when Emacs is built with GTK+, NS or Haiku +windowing support, and, if it's non-nil (the default), it results in +tooltips that look like those displayed by other GTK+/NS/Haiku programs, +but will not be able to display text properties inside tooltip text. */); use_system_tooltips = true; DEFVAR_LISP ("iconify-child-frame", iconify_child_frame,