From: Eli Zaretskii Date: Wed, 11 Jan 2023 17:15:30 +0000 (+0200) Subject: ; Fix documentation of last change X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c51bfef34a6bdefad048444c279ea5b63a6aada1;p=emacs.git ; Fix documentation of last change * etc/NEWS: * doc/emacs/programs.texi (Moving by Sentences): Minor wording fixes. --- diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index a2cdf6c6eb9..065ed1c51f7 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -266,24 +266,29 @@ commands to move over certain constructs in programming languages (@pxref{Sentences}, @pxref{Moving by Defuns}). In a programming language a sentence is usually a complete language construct smaller than defuns, but larger than sexps (@pxref{List Motion,,, elisp, The -Emacs Lisp Reference Manual}). What exactly a sentence is in a -non-human language is dependent on the target language, but usually it -is complete statements, such as a variable definition and -initialization, or a conditional statement. An example of a sentence -in the C language could be +Emacs Lisp Reference Manual}). What exactly is a sentence in this +case depends on the programming language, but usually it is a complete +statement, such as a variable definition and initialization, or a +conditional statement. An example of a sentence in the C language +could be @example int x = 5; @end example +@noindent or in the JavaScript language it could look like @example +@group const thing = () => console.log("Hi"); - +@end group +@group const foo = [1] == '1' ? "No way" : "..."; +@end group + @end example @table @kbd @@ -308,7 +313,7 @@ sentence in the direction of motion. @kbd{M-a} with a negative argument @minus{}@var{n} moves forward @var{n} times to the next end of a sentence. Likewise, @kbd{M-e} with -a negative argument moves back to a start of a sentence. +a negative argument moves back to the start of a sentence. @node Imenu @subsection Imenu diff --git a/etc/NEWS b/etc/NEWS index 0c782eeaee8..90a6c6a0522 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -69,8 +69,8 @@ Tree-sitter modes. This functionality utilizes the new ** Commands and variables to move by program statements *** New variable 'forward-sentence-function'. -Major modes now can set this variable to customize the behavior of the -'forward-sentence' function. +Major modes can now set this variable to customize the behavior of the +'forward-sentence' command. *** New function 'forward-sentence-default-function'. The previous implementation of 'forward-sentence' is moved into its @@ -78,11 +78,11 @@ own function, to be bound by 'forward-sentence-function'. *** New defvar-local 'treesit-sentence-type-regexp. Similarly to 'treesit-defun-type-regexp', this variable is used to -navigate sentences in Tree-sitter enabled modes. +define "sentences" in Tree-sitter enabled modes. *** New function 'treesit-forward-sentence'. -treesit.el now conditionally sets 'forward-sentence-function' for all -Tree-sitter modes that sets 'treesit-sentence-type-regexp'. +All tree-sitter modes that define 'treesit-sentence-type-regexp' now +set 'forward-sentence-function' to call 'treesit-forward-sentence'. * Changes in Specialized Modes and Packages in Emacs 30.1