bug#81562: [PATCH] Restore current_buffer when window_text_pixel_size fails
Eli Zaretskii <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
> From: Maxim Wayne <[email protected]> > Date: Sun, 16 Aug 2026 22:17:24 +0800 > Cc: [email protected] > > I've reworked the patch to validate the arguments up front, as you > suggested. FROM, TO, X-LIMIT, Y-LIMIT and MODE-LINES are now checked > with the CHECK_* macros at the beginning of Fwindow_text_pixel_size, > before any buffer switch. > > For MODE-LINES, my check limits the value to the three symbols: > mode-line, tab-line and header-line -- please tell me if you prefer > checking only the type. I think we don't need to check MODE-LINES at all, since any value except those supported by the function will be silently ignored. So I think that part of the patch and the corresponding tests should be removed. > The patch adds two tests: one verifies that an invalid FROM argument > signals an error before the buffer switch, the other covers the rest > of the new checks. Both fail on Emacs 30.2 and pass with the patch > applied. > > The patch is attached; it is against current master (commit > cb22cfe1414). Thanks, the patch LGTM, other than the comment above. Please send an updated patch. These changes are large enough for us to accept without your assigning the copyright to the FSF. So we will need you to sign the copyright-assignment agreement. If you agree, I will send you the form to fill and the instructions to go with it.