commit ca56dc2e71660cf501f417ab683590ba2e333661 (HEAD, refs/remotes/origin/master) Author: Richard M. Stallman Date: Sat Aug 10 18:45:06 2024 -0400 Fix buglet. * lisp/emacs-lisp/cond-star.el (cond*-match): Move a backquote. diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el index 6309b0d1a15..5e8564c29c2 100644 --- a/lisp/emacs-lisp/cond-star.el +++ b/lisp/emacs-lisp/cond-star.el @@ -347,8 +347,8 @@ as in `cond*-condition'." (if uncondit-clauses (setq expression `(progn ,expression - (cond*-bind-pattern-syms - ,(if retrieve-value-swap-outs + ,(cond*-bind-pattern-syms + (if retrieve-value-swap-outs ;; If we saved the bindings' values after the ;; true-clauses, bind the same variables ;; here to the values we saved then. @@ -356,7 +356,7 @@ as in `cond*-condition'." ;; Otherwise bind them to the values ;; they matched in the pattern. (car raw-result)) - (cond*-convert uncondit-clauses))))) + (cond*-convert uncondit-clauses))))) ;; Bind the backtrack-aliases if any. ;; We need them bound for the TRUE-EXPS. ;; It is harmless to bind them around IFFALSE commit b6c2f360694831753a9064e48434d29d7ab07505 Author: Pip Cet Date: Sat Aug 10 17:01:44 2024 +0000 Fix coordinate transformations in sfnt.c * src/sfnt.c (sfnt_transform_coordinates): (sfnt_transform_f26dot6): Fix calculation of transformed coordinates in the very rare case of arbitrary transformation matrices. diff --git a/src/sfnt.c b/src/sfnt.c index 34ff6964c31..b235c795ef7 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -2578,8 +2578,10 @@ sfnt_transform_coordinates (struct sfnt_compound_glyph_component *component, for (i = 0; i < num_coordinates; ++i) { - x[i] = m1 * x[i] + m2 * y[i] + m3 * 1; - y[i] = m4 * x[i] + m5 * y[i] + m6 * 1; + sfnt_fixed xi = m1 * x[i] + m2 * y[i] + m3 * 1; + sfnt_fixed yi = m4 * x[i] + m5 * y[i] + m6 * 1; + x[i] = xi; + y[i] = yi; } } @@ -12822,8 +12824,10 @@ sfnt_transform_f26dot6 (struct sfnt_compound_glyph_component *component, for (i = 0; i < num_coordinates; ++i) { - x[i] = m1 * x[i] + m2 * y[i] + m3 * 1; - y[i] = m4 * x[i] + m5 * y[i] + m6 * 1; + sfnt_f26dot6 xi = m1 * x[i] + m2 * y[i] + m3 * 1; + sfnt_f26dot6 yi = m4 * x[i] + m5 * y[i] + m6 * 1; + x[i] = xi; + y[i] = yi; } } commit 1a38936299d3c93767e4b542ccde990ea08379e3 Author: Pip Cet Date: Sat Aug 10 16:57:49 2024 +0000 Make ftcrfont_close idempotent This prevents crashes when running code like: (let ((font (open-font (find-font (font-spec ...))))) (close-font font) (close-font font)) * src/ftcrfont.c (ftcrfont_close): Make sure the function can be run several times in a row without crashing. diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 5ee375c782b..3700154e44a 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -344,12 +344,20 @@ ftcrfont_close (struct font *font) ftcrfont_info->hb_font = NULL; } #endif - for (int i = 0; i < ftcrfont_info->metrics_nrows; i++) - if (ftcrfont_info->metrics[i]) - xfree (ftcrfont_info->metrics[i]); if (ftcrfont_info->metrics) - xfree (ftcrfont_info->metrics); - cairo_scaled_font_destroy (ftcrfont_info->cr_scaled_font); + { + for (int i = 0; i < ftcrfont_info->metrics_nrows; i++) + if (ftcrfont_info->metrics[i]) + xfree (ftcrfont_info->metrics[i]); + if (ftcrfont_info->metrics) + xfree (ftcrfont_info->metrics); + ftcrfont_info->metrics = NULL; + } + if (ftcrfont_info->cr_scaled_font) + { + cairo_scaled_font_destroy (ftcrfont_info->cr_scaled_font); + ftcrfont_info->cr_scaled_font = NULL; + } unblock_input (); } commit 6c6860035121aaa5d5b45589f6f5b5f49ba63c0f Merge: 361be932825 4dd953d3cc3 Author: Eli Zaretskii Date: Sat Aug 10 04:15:33 2024 -0400 Merge from origin/emacs-30 4dd953d3cc3 * lisp/epg.el (epg--start): Don't convert EOL on encoding... commit 361be932825ec7d6e0bf3ee63614209a101166fe Merge: 23d8e4326c9 5cace09ed04 Author: Eli Zaretskii Date: Sat Aug 10 04:15:33 2024 -0400 ; Merge from origin/emacs-30 The following commit was skipped: 5cace09ed04 Add PROBLEMS entry for bug#72517 commit 23d8e4326c9fd9904ead800c3602d85165457657 Merge: 24b7f810d84 a0406f7c12e Author: Eli Zaretskii Date: Sat Aug 10 04:15:32 2024 -0400 Merge from origin/emacs-30 a0406f7c12e ; Improve documentation of 'add-to-list' bd6dfb97ff0 NS: Fix scroll-bar setting code (bug#72331) commit 4dd953d3cc37a6f84458eccd6fc81966fa7207f5 (refs/remotes/origin/emacs-30) Author: Kazuhiro Ito Date: Fri Aug 9 21:28:41 2024 +0900 * lisp/epg.el (epg--start): Don't convert EOL on encoding (bug#72542). diff --git a/lisp/epg.el b/lisp/epg.el index 494bdd68c41..6b4db52f298 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -683,7 +683,7 @@ callback data (if any)." ;; We encode and decode ourselves the text sent/received from gpg, ;; so the below disables automatic encoding and decoding by ;; subprocess communications routines. - (set-process-coding-system process 'raw-text 'raw-text) + (set-process-coding-system process 'raw-text 'raw-text-unix) (setf (epg-context-process context) process))) (defun epg--process-filter (process input) commit 24b7f810d843f2264131b881c6f451e7bd041b40 Author: Manuel Giraud Date: Fri Aug 9 17:41:51 2024 +0200 Reuse already read `capabilities' * lisp/mail/smtpmail.el (smtpmail-via-smtp): Reuse already read `capabilities'. (Bug#72544) diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 98083c0489a..c98fdfd10ed 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -800,11 +800,7 @@ Returns an error if the server cannot be contacted." (smtpmail-command-or-throw process (format "HELO %s" (smtpmail-fqdn))) ;; EHLO was successful, so we parse the extensions. - (dolist (line (delete - "" - (split-string - (plist-get (cdr result) :capabilities) - "\r\n"))) + (dolist (line (delete "" (split-string capabilities "\r\n"))) (let ((name ;; Use ASCII case-table to prevent I ;; downcasing to a dotless i under some commit 944e45db53cb173c5eadd4794081c133e8649d67 Author: Eli Zaretskii Date: Fri Aug 9 14:00:34 2024 +0300 ; * src/w32.c (init_ntproc): Fix formatting conventions in last change. diff --git a/src/w32.c b/src/w32.c index 0c1291f1094..cec15606bf2 100644 --- a/src/w32.c +++ b/src/w32.c @@ -10482,14 +10482,19 @@ init_ntproc (int dumping) { #ifdef _UCRT - /* For UCRT, the _fdopen will try to find free stream from - _IOB_ENTRIES (= 3), thus we can't reopen the standard handles - with it. Using SetHandleInformation to make the handle not - inheritable to child process is a better way. */ - SetHandleInformation (GetStdHandle(STD_INPUT_HANDLE), HANDLE_FLAG_INHERIT, 0); - SetHandleInformation (GetStdHandle(STD_OUTPUT_HANDLE), HANDLE_FLAG_INHERIT, 0); - SetHandleInformation (GetStdHandle(STD_ERROR_HANDLE), HANDLE_FLAG_INHERIT, 0); -#else + /* The non-UCRT code below relies on MSVCRT-only behavior, whereby + _fdopen reuses the first unused FILE slot, whereas UCRT skips the + first 3 slots, which correspond to stdin/stdout/stderr. That + makes it impossible in the UCRT build to open these 3 streams + once they are closed. So we use SetHandleInformation instead, + which is available on all versions of Windows that have UCRT. */ + SetHandleInformation (GetStdHandle(STD_INPUT_HANDLE), + HANDLE_FLAG_INHERIT, 0); + SetHandleInformation (GetStdHandle(STD_OUTPUT_HANDLE), + HANDLE_FLAG_INHERIT, 0); + SetHandleInformation (GetStdHandle(STD_ERROR_HANDLE), + HANDLE_FLAG_INHERIT, 0); +#else /* !_UCRT */ HANDLE parent; HANDLE stdin_save = INVALID_HANDLE_VALUE; HANDLE stdout_save = INVALID_HANDLE_VALUE; @@ -10497,8 +10502,8 @@ init_ntproc (int dumping) parent = GetCurrentProcess (); - /* ignore errors when duplicating and closing; typically the - handles will be invalid when running as a gui program. */ + /* Ignore errors when duplicating and closing; typically the + handles will be invalid when running as a gui program. */ DuplicateHandle (parent, GetStdHandle (STD_INPUT_HANDLE), parent, @@ -10544,7 +10549,7 @@ init_ntproc (int dumping) else _open ("nul", O_TEXT | O_NOINHERIT | O_WRONLY); _fdopen (2, "w"); -#endif +#endif /* !_UCRT */ } /* unfortunately, atexit depends on implementation of malloc */ commit de7de561e1e3a973581b6993b3cc0074ff0bf91c Author: Kien Nguyen Date: Wed Aug 7 10:39:38 2024 -0700 Use SetHandleInformation to set NOINHERIT in UCRT64 * src/w32.c (init_ntproc) [_UCRT]: Use SetHandleInformation to prevent standard handles from being inherited, instead of relying on MSVCRT-only behavior. For the details of the problem, see https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01129.html. Copyright-paperwork-exempt: yes diff --git a/src/w32.c b/src/w32.c index 31ffa301c2f..0c1291f1094 100644 --- a/src/w32.c +++ b/src/w32.c @@ -10480,6 +10480,16 @@ init_ntproc (int dumping) /* Initial preparation for subprocess support: replace our standard handles with non-inheritable versions. */ { + +#ifdef _UCRT + /* For UCRT, the _fdopen will try to find free stream from + _IOB_ENTRIES (= 3), thus we can't reopen the standard handles + with it. Using SetHandleInformation to make the handle not + inheritable to child process is a better way. */ + SetHandleInformation (GetStdHandle(STD_INPUT_HANDLE), HANDLE_FLAG_INHERIT, 0); + SetHandleInformation (GetStdHandle(STD_OUTPUT_HANDLE), HANDLE_FLAG_INHERIT, 0); + SetHandleInformation (GetStdHandle(STD_ERROR_HANDLE), HANDLE_FLAG_INHERIT, 0); +#else HANDLE parent; HANDLE stdin_save = INVALID_HANDLE_VALUE; HANDLE stdout_save = INVALID_HANDLE_VALUE; @@ -10534,6 +10544,7 @@ init_ntproc (int dumping) else _open ("nul", O_TEXT | O_NOINHERIT | O_WRONLY); _fdopen (2, "w"); +#endif } /* unfortunately, atexit depends on implementation of malloc */ commit 5cace09ed0495aff620549e83b4e0dd9d631ecd8 Author: Thomas Fitzsimmons Date: Thu Aug 8 22:58:48 2024 -0400 Add PROBLEMS entry for bug#72517 * etc/PROBLEMS (X runtime problems): Document ssh -X session hang-on-exit after deletion of remote emacsclient -c frame. (bug#72517) (cherry picked from commit 9f03300c5c626bf6f8f839be4943cc20db89c24d) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 7d7c9ab5f27..4d6927705b1 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1778,6 +1778,23 @@ happen without any special user interaction, for example, when Emacs restores a saved desktop. A fix is to install version 2.6.8 of FVWM, see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31650. +*** ssh -X session hangs on exit after remote emacsclient -c frame is deleted. + +When Emacs is configured with an X toolkit, for example, +--with-x-toolkit=lucid, and "emacsclient -c" is run over an "ssh -X" +connection, deleting the emacsclient frame (via C-x 5 0 or C-x C-c) can +leave the X display connection open. + +The symptom is that after you delete the "emacsclient -c" frame and then +attempt to exit ssh (with C-d, or "exit"), ssh will hang before +returning you to the local shell. You will have to press C-c (to sever +the X connection) before ssh returns you to your local shell (that is, +the shell from which you invoked "ssh -X"). + +To avoid this issue configure Emacs with --with-x-toolkit=no. + +See . + ** General X problems *** Redisplay using X is much slower than previous Emacs versions. commit a0406f7c12e4f7f175646c6468a5ff9290da4c34 Author: Eli Zaretskii Date: Fri Aug 9 08:45:30 2024 +0300 ; Improve documentation of 'add-to-list' * doc/lispref/lists.texi (List Variables): * lisp/subr.el (add-to-list): Add/clarify caveats of using 'add-to-list'. diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index dce9115c61b..6f4d838042a 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -840,6 +840,13 @@ The argument @var{symbol} is not implicitly quoted; @code{add-to-list} is an ordinary function, like @code{set} and unlike @code{setq}. Quote the argument yourself if that is what you want. +This function is for adding elements to configuration variables such as +@code{load-path} (@pxref{Library Search}), @code{image-load-path} +(@pxref{Defining Images}), etc. Its code includes quite a few special +checks for these uses, and emits warnings in support of them. For this +reason, we recommend against using it in Lisp programs for constructing +arbitrary lists; use @code{push} instead. @xref{List Variables}. + Do not use this function when @var{symbol} refers to a lexical variable. @end defun diff --git a/lisp/subr.el b/lisp/subr.el index b382fa9f771..31c53a6455b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2386,9 +2386,11 @@ LIST-VAR should not refer to a lexical variable. The return value is the new value of LIST-VAR. -This is handy to add some elements to configuration variables, -but please do not abuse it in Elisp code, where you are usually -better off using `push' or `cl-pushnew'. +This is meant to be used for adding elements to configuration +variables, such as adding a directory to a path variable +like `load-path', but please do not abuse it to construct +arbitrary lists in Elisp code, where using `push' or `cl-pushnew' +will get you more efficient code. If you want to use `add-to-list' on a variable that is not defined until a certain package is loaded, you should put the commit bd6dfb97ff0d712dc02c0542a51b00ce41022012 Author: Gerd Möllmann Date: Thu Aug 8 08:19:56 2024 +0200 NS: Fix scroll-bar setting code (bug#72331) * src/nsterm.m (ns_set_vertical_scroll_bar): Use WINDOW_SCROLL_AREA_WIDTH instead of NS_SCROLL_BAR_WIDTH. (ns_set_horizontal_scroll_bar): Use WINDOW_SCROLL_AREA_HEIGHT instead of NS_SCROLL_BAR_HEIGHT. Clear area differently if vertical scroll bars are present. * src/nsterm.h (NS_SCROLL_BAR_WIDTH, NS_SCROLL_BAR_HEIGHT): Remove. diff --git a/src/nsterm.h b/src/nsterm.h index a07829a36ec..6c67653705e 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -1069,22 +1069,6 @@ struct x_output styleMask:[[FRAME_NS_VIEW (f) window] styleMask]]) \ - NSHeight([[[FRAME_NS_VIEW (f) window] contentView] frame]))) -/* Compute pixel size for vertical scroll bars. */ -#define NS_SCROLL_BAR_WIDTH(f) \ - (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \ - ? rint (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0 \ - ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) \ - : (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f))) \ - : 0) - -/* Compute pixel size for horizontal scroll bars. */ -#define NS_SCROLL_BAR_HEIGHT(f) \ - (FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) \ - ? rint (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) > 0 \ - ? FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) \ - : (FRAME_SCROLL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f))) \ - : 0) - /* Difference between char-column-calculated and actual SB widths. This is only a concern for rendering when SB on left. */ #define NS_SCROLL_BAR_ADJUST(w, f) \ diff --git a/src/nsterm.m b/src/nsterm.m index b883e605a5b..905707dace4 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -5067,7 +5067,7 @@ Function modeled after x_draw_glyph_string_box (). window_box (window, ANY_AREA, 0, &window_y, 0, &window_height); top = window_y; height = window_height; - width = NS_SCROLL_BAR_WIDTH (f); + width = WINDOW_SCROLL_BAR_AREA_WIDTH (window); left = WINDOW_SCROLL_BAR_AREA_X (window); r = NSMakeRect (left, top, width, height); @@ -5161,7 +5161,7 @@ Function modeled after x_draw_glyph_string_box (). window_box (window, ANY_AREA, &window_x, 0, &window_width, 0); left = window_x; width = window_width; - height = NS_SCROLL_BAR_HEIGHT (f); + height = WINDOW_SCROLL_BAR_AREA_HEIGHT (window); top = WINDOW_SCROLL_BAR_AREA_Y (window); r = NSMakeRect (left, top, width, height); @@ -5199,7 +5199,7 @@ Function modeled after x_draw_glyph_string_box (). it fills with junk. */ if (!NILP (window->vertical_scroll_bar)) ns_clear_frame_area (f, WINDOW_SCROLL_BAR_AREA_X (window), top, - NS_SCROLL_BAR_HEIGHT (f), height); + WINDOW_SCROLL_BAR_AREA_WIDTH (window), height); if (update_p) [bar setPosition: position portion: portion whole: whole];