From c4b4948845508d599f6176441a833ae1a2cb6d40 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 11 Jan 2024 22:36:33 +0100 Subject: [PATCH 1/4] Don't recommend inverse-video for debugging * etc/DEBUG: Don't recommend 'inverse-video', which has been broken for 20 years, give or take. (Bug#11430) --- etc/DEBUG | 5 ----- 1 file changed, 5 deletions(-) diff --git a/etc/DEBUG b/etc/DEBUG index dd699f962ba..9dae54aeabd 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -864,11 +864,6 @@ in your ~/.emacs file. When the problem happens, exit the Emacs that you were running, kill it, and rename the two files. Then you can start another Emacs without clobbering those files, and use it to examine them. -An easy way to see if too much text is being redrawn on a terminal is to -evaluate '(setq inverse-video t)' before you try the operation you think -will cause too much redrawing. This doesn't refresh the screen, so only -newly drawn text is in inverse video. - ** Debugging LessTif If you encounter bugs whereby Emacs built with LessTif grabs all mouse From 418547162d5273de5a524fe857081867258cd511 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 12 Jan 2024 10:03:08 +0200 Subject: [PATCH 2/4] Improve documentation of Ispell commands * doc/emacs/fixit.texi (Spelling): Document "C-u M-$" and warn against modifications in recursive-edit. (Bug#14192) --- doc/emacs/fixit.texi | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index 13c79b237da..a972ed698f7 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -274,6 +274,9 @@ you can control which one is used by customizing the variable @item M-$ Check and correct spelling of the word at point (@code{ispell-word}). If the region is active, do it for all words in the region instead. +@item C-u M-$ +If a previous spelling operation was interrupted, continue that +operation (@code{ispell-continue}). @item M-x ispell Check and correct spelling of all words in the buffer. If the region is active, do it for all words in the region instead. @@ -305,12 +308,16 @@ Enable Flyspell mode for comments and strings only. @kindex M-$ @findex ispell-word +@findex ispell-continue To check the spelling of the word around or before point, and optionally correct it as well, type @kbd{M-$} (@code{ispell-word}). If a region is active, @kbd{M-$} checks the spelling of all words within the region. @xref{Mark}. (When Transient Mark mode is off, @kbd{M-$} always acts on the word around or before point, ignoring the -region; @pxref{Disabled Transient Mark}.) +region; @pxref{Disabled Transient Mark}.) When invoked with a prefix +argument, @kbd{C-u M-$}, this calls @code{ispell-continue}, which +continues the spelling operation, if any, which was interrupted with +@kbd{X} or @kbd{C-g}. @findex ispell @findex ispell-buffer @@ -383,9 +390,9 @@ wildcard. @item C-g @itemx X -Quit interactive spell-checking, leaving point at the word that was -being checked. You can restart checking again afterward with @w{@kbd{C-u -M-$}}. +Interrupt the interactive spell-checking, leaving point at the word +that was being checked. You can restart checking again afterward with +@w{@kbd{C-u M-$}}. @item x Quit interactive spell-checking and move point back to where it was @@ -394,6 +401,19 @@ when you started spell-checking. @item q Quit interactive spell-checking and kill the spell-checker subprocess. +@item C-r +Enter recursive-edit (@pxref{Recursive Editing}). When you exit +recursive-edit with @kbd{C-M-c}, the interactive spell-checking will +resume. This allows you to consult the buffer text without +interrupting the spell-checking. Do @emph{not} modify the buffer in +the recursive editing, and especially don't modify the misspelled +word, as the edits will be undone when you exit recursive-edit. If +you need to edit the misspelled word, use @kbd{r} or @kbd{R} instead, +or use @kbd{X}, edit the buffer, then resume with @w{@kbd{C-u M-$}}. + +@item C-z +Suspend Emacs or iconify the selected frame. + @item ? Show the list of options. @end table From a08e6423ccc94ff51367768c2d13e549204f9f46 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 13 Jan 2024 11:23:43 +0200 Subject: [PATCH 3/4] ; * doc/emacs/fixit.texi (Spelling): Fix last change. --- doc/emacs/fixit.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index a972ed698f7..6fa707ba2cc 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -402,7 +402,7 @@ when you started spell-checking. Quit interactive spell-checking and kill the spell-checker subprocess. @item C-r -Enter recursive-edit (@pxref{Recursive Editing}). When you exit +Enter recursive-edit (@pxref{Recursive Edit}). When you exit recursive-edit with @kbd{C-M-c}, the interactive spell-checking will resume. This allows you to consult the buffer text without interrupting the spell-checking. Do @emph{not} modify the buffer in From c494a6e879dfeecb0cec3e9ae7bc0d3c682a9185 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 13 Jan 2024 12:01:47 +0200 Subject: [PATCH 4/4] Improve documentation of 'emacs_function' in modules * doc/lispref/internals.texi (Module Functions): Warn about accessing the ARGS array in module functions. --- doc/lispref/internals.texi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 41777a7a303..333a5897837 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -1371,6 +1371,15 @@ objects between Emacs and the module (@pxref{Module Values}). The provides facilities for conversion between basic C data types and the corresponding @code{emacs_value} objects. +In the module function's body, do @emph{not} attempt to access +elements of the @var{args} array beyond the index +@code{@var{nargs}-1}: memory for the @var{args} array is allocated +exactly to accommodate @var{nargs} values, and accessing beyond that +will most probably crash your module. In particular, if the value of +@var{nargs} passed to the function at run time is zero, it must not +access @var{args} at all, as no memory will have been allocated for it +in that case. + A module function always returns a value. If the function returns normally, the Lisp code which called it will see the Lisp object corresponding to the @code{emacs_value} value the function returned.