emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 9ec60fde2e 3/3: Merge branch 'master' of git.sv.gnu.org:/srv/git/


From: Michael Albinus
Subject: master 9ec60fde2e 3/3: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Date: Sun, 15 Jan 2023 12:50:23 -0500 (EST)

branch: master
commit 9ec60fde2e8b2b144a04d05031a83469abe7846f
Merge: 4d37504c43 0052aa54f6
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
---
 doc/lispref/modes.texi                             |  14 +-
 doc/misc/htmlfontify.texi                          |  13 +-
 etc/NEWS.29                                        |   6 +-
 lisp/calendar/diary-lib.el                         |   5 +-
 lisp/files.el                                      |   9 +-
 lisp/icomplete.el                                  |   4 +-
 lisp/ls-lisp.el                                    |  18 +-
 lisp/org/org-mouse.el                              |   4 +-
 lisp/pcomplete.el                                  |  29 ++-
 lisp/progmodes/c-ts-mode.el                        | 245 +++++++++++++--------
 lisp/progmodes/java-ts-mode.el                     |   3 +-
 lisp/simple.el                                     |  10 +-
 lisp/sqlite-mode.el                                |   4 +
 lisp/treesit.el                                    |  13 +-
 lisp/woman.el                                      |  60 ++---
 src/ccl.c                                          |   2 +-
 src/keyboard.c                                     |   2 +-
 src/regex-emacs.c                                  |   2 +-
 .../erc/resources/networks/merge-server/track.eld  |   2 +-
 test/lisp/minibuffer-tests.el                      |   2 +-
 .../progmodes/c-ts-mode-resources/filling.erts     | 198 +++++++++++++++++
 .../lisp/progmodes/c-ts-mode-resources/indent.erts | 121 +++++++++-
 test/lisp/progmodes/c-ts-mode-tests.el             |   4 +
 test/manual/indent/octave.m                        |   2 +-
 24 files changed, 599 insertions(+), 173 deletions(-)

diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index ff372edb3f..fe5eb8a1b8 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -4926,8 +4926,7 @@ the current line to @var{matcher}; if it returns 
non-@code{nil}, this
 rule is applicable.  Then Emacs passes the node to @var{anchor}, which
 returns a buffer position.  Emacs takes the column number of that
 position, adds @var{offset} to it, and the result is the indentation
-column for the current line.  @var{offset} can be an integer or a
-variable whose value is an integer.
+column for the current line.
 
 The @var{matcher} and @var{anchor} are functions, and Emacs provides
 convenient defaults for them.
@@ -4943,10 +4942,13 @@ inside a multi-line string, no node can start at that 
position, so
 @var{node} is @code{nil}.  In that case, @var{parent} would be the
 smallest node that spans that position.
 
-Emacs finds @var{bol}, @var{node} and @var{parent} and
-passes them to each @var{matcher} and @var{anchor}.  @var{matcher}
-should return non-@code{nil} if the rule is applicable, and
-@var{anchor} should return a buffer position.
+@var{matcher} should return non-@code{nil} if the rule is applicable,
+and @var{anchor} should return a buffer position.
+
+@var{offset} can be an integer, a variable whose value is an integer,
+or a function that returns an integer.  If it is a function, it is
+passed @var{node}, @var{parent}, and @var{bol}, like matchers and
+anchors.
 @end defvar
 
 @defvar treesit-simple-indent-presets
diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi
index 2c96002fb1..fa45f9361a 100644
--- a/doc/misc/htmlfontify.texi
+++ b/doc/misc/htmlfontify.texi
@@ -1351,11 +1351,10 @@ Whether or not to split the index @ref{hfy-index-file} 
alphabetically
 on the first letter of each tag.  Useful when the index would otherwise
 be large and take a long time to render or be difficult to navigate.
 
-@item hfy-find-cmd
-@vindex hfy-find-cmd
-@anchor{hfy-find-cmd}
+@item hfy-exclude-file-rules
+@vindex hfy-exclude-file-rules
 
-The ``find'' command used to harvest a list of files to attempt to fontify.
+Regular expressions to exclude files which shouldn't be fontified.
 
 @item hfy-extn
 @vindex hfy-extn
@@ -1545,12 +1544,6 @@ but you should be able to override this.
 
 See: @ref{Customization}
 
-@item
-A copy of find (e.g., GNU find) that provides the @code{-path} predicate.
-
-You may be able to work around this with a suitable clever shell
-command and the customization entry: @ref{hfy-find-cmd}
-
 @item
 A copy of sed (e.g., GNU sed).
 
diff --git a/etc/NEWS.29 b/etc/NEWS.29
index ac338da71e..d1ddd0194c 100644
--- a/etc/NEWS.29
+++ b/etc/NEWS.29
@@ -25,11 +25,13 @@ applies, and please also update docstrings as needed.
 * Installation Changes in Emacs 29.1
 
 ---
-** Ahead-of-time native compilation can now be specified via configure.
-Use '--with-native-compilation=aot' to specify that all the Lisp files
+** Ahead-of-time native compilation can now be requested via configure.
+Use '--with-native-compilation=aot' to request that all the Lisp files
 in the Emacs tree should be natively compiled ahead of time.  (This is
 slow on most machines.)
 
+This feature existed in Emacs 28.1, but was less easy to request.
+
 +++
 ** Emacs can be built with the tree-sitter parsing library.
 This library, together with grammar libraries, provides incremental
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 5f1ce0aaea..946cf0e723 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -880,7 +880,10 @@ LIST-ONLY is non-nil, in which case it just returns the 
list."
                                    (original-date original-date))
                     (run-hooks 'diary-hook))))))
         (and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff)))
-      (or d-incp (message "Preparing diary...done"))
+      (or d-incp
+          ;; Don't clobber messages displayed while preparing the diary.
+          (not (equal (current-message) "Preparing diary..."))
+          (message "Preparing diary...done"))
       diary-entries-list)))
 
 (defun diary-unhide-everything ()
diff --git a/lisp/files.el b/lisp/files.el
index d0167bf381..daa86e94d7 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -7675,9 +7675,12 @@ regardless of the language.")
 (defvar insert-directory-ls-version 'unknown)
 
 (defun insert-directory-wildcard-in-dir-p (dir)
-  "Return non-nil if DIR contents a shell wildcard in the directory part.
-The return value is a cons (DIR . WILDCARDS); DIR is the
-`default-directory' in the Dired buffer, and WILDCARDS are the wildcards.
+  "Return non-nil if DIR contains shell wildcards in its parent directory part.
+The return value is a cons (DIRECTORY . WILDCARD), where DIRECTORY is the
+part of DIR up to and excluding the first component that includes
+wildcard characters, and WILDCARD is the rest of DIR's components.  The
+DIRECTORY part of the value includes the trailing slash, to indicate that
+it is a directory.
 
 Valid wildcards are `*', `?', `[abc]' and `[a-z]'."
   (let ((wildcards "[?*"))
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 9fa622017f..014f38b202 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -252,7 +252,7 @@ the default otherwise."
   "Step forward completions by one entry.
 Second entry becomes the first and can be selected with
 `icomplete-force-complete-and-exit'.
-Return non-nil iff something was stepped."
+Return non-nil if something was stepped."
   (interactive)
   (let* ((beg (icomplete--field-beg))
          (end (icomplete--field-end))
@@ -270,7 +270,7 @@ Return non-nil iff something was stepped."
   "Step backward completions by one entry.
 Last entry becomes the first and can be selected with
 `icomplete-force-complete-and-exit'.
-Return non-nil iff something was stepped."
+Return non-nil if something was stepped."
   (interactive)
   (let* ((beg (icomplete--field-beg))
          (end (icomplete--field-end))
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 217bebcfcb..81ff14932c 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -482,8 +482,22 @@ not contain `d', so that a full listing is expected."
       (if (not dir-wildcard)
           (funcall orig-fun dir-or-list switches)
         (let* ((default-directory (car dir-wildcard))
-               (files (file-expand-wildcards (cdr dir-wildcard)))
+               (wildcard (cdr dir-wildcard))
+               (files (file-expand-wildcards wildcard))
                (dir (car dir-wildcard)))
+          ;; When the wildcard ends in a slash, file-expand-wildcards
+          ;; returns nil; fix that by treating the wildcards as
+          ;; specifying only directories whose names match the
+          ;; widlcard.
+          (if (and (null files)
+                   (directory-name-p wildcard))
+              (setq files
+                    (delq nil
+                          (mapcar (lambda (fname)
+                                   (if (file-accessible-directory-p fname)
+                                        fname))
+                                 (file-expand-wildcards
+                                   (directory-file-name wildcard))))))
           (if files
               (let ((inhibit-read-only t)
                     (buf
@@ -494,7 +508,7 @@ not contain `d', so that a full listing is expected."
                     (dired-goto-next-file)
                     (forward-line 0)
                     (insert "  wildcard " (cdr dir-wildcard) "\n"))))
-            (user-error "No files matching regexp")))))))
+            (user-error "No files matching wildcard")))))))
 
 (advice-add 'dired :around #'ls-lisp--dired)
 
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index 6a733f09db..3b2c4cba62 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -241,7 +241,7 @@ return `:middle'."
    (t :middle)))
 
 (defun org-mouse-empty-line ()
-  "Return non-nil iff the line contains only white space."
+  "Return non-nil if the line contains only white space."
   (save-excursion (beginning-of-line) (looking-at "[ \t]*$")))
 
 (defun org-mouse-next-heading ()
@@ -283,7 +283,7 @@ keyword as the only argument.
 
 If SELECTED is nil, then all items are normal menu items.  If
 SELECTED is a function, then each item is a checkbox, which is
-enabled for a given keyword iff (funcall SELECTED keyword) return
+enabled for a given keyword if (funcall SELECTED keyword) return
 non-nil.  If SELECTED is neither nil nor a function, then the
 items are radio buttons.  A radio button is enabled for the
 keyword `equal' to SELECTED.
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 5bee515246..1ca7a21336 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -632,6 +632,13 @@ This will modify the current buffer."
 ;;; Internal Functions:
 
 ;; argument handling
+(defsubst pcomplete-actual-arg (&optional index offset)
+  "Return the actual text representation of the last argument.
+This is different from `pcomplete-arg', which returns the textual value
+that the last argument evaluated to.  This function returns what the
+user actually typed in."
+  (buffer-substring (pcomplete-begin index offset) (point)))
+
 (defun pcomplete-arg (&optional index offset)
   "Return the textual content of the INDEXth argument.
 INDEX is based from the current processing position.  If INDEX is
@@ -659,11 +666,20 @@ the pcomplete-arg-value text property of that string."
                   (_      (- pcomplete-index (or index 0))))
                 (or offset 0))
               pcomplete-args)))
-    (if (stringp arg)
+    (if (or (stringp arg)
+            ;; FIXME: 'last' is handled specially in Emacs 29, because
+            ;; 'pcomplete-parse-arguments' accepts a list of strings
+            ;; (which are completion candidates) as return value for
+            ;; (pcomplete-arg 'last).  See below: "it means it's a
+            ;; list of completions computed during parsing,
+            ;; e.g. Eshell uses that to turn globs into lists of
+            ;; completions".  This special case will be dealt with
+            ;; differently in Emacs 30: the pcomplete-arg-value
+            ;; property will be used by 'pcomplete-parse-arguments'.
+            (eq index 'last))
         arg
       (propertize
-       (buffer-substring (pcomplete-begin index offset)
-                         (pcomplete-begin (1- (or index 0)) offset))
+       (car (split-string (pcomplete-actual-arg index offset)))
        'pcomplete-arg-value arg))))
 
 (defun pcomplete-begin (&optional index offset)
@@ -679,13 +695,6 @@ See the documentation for `pcomplete-arg'."
       (setq index (+ index offset)))
   (nth index pcomplete-begins))
 
-(defsubst pcomplete-actual-arg (&optional index offset)
-  "Return the actual text representation of the last argument.
-This is different from `pcomplete-arg', which returns the textual value
-that the last argument evaluated to.  This function returns what the
-user actually typed in."
-  (buffer-substring (pcomplete-begin index offset) (point)))
-
 (defsubst pcomplete-next-arg ()
   "Move the various pointers to the next argument."
   (setq pcomplete-index (1+ pcomplete-index)
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index b2151775e9..c066a79815 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -118,7 +118,6 @@ MODE is either `c' or `cpp'."
          `(((parent-is "translation_unit") parent-bol 0)
            ((node-is ")") parent 1)
            ((node-is "]") parent-bol 0)
-           ((node-is "}") c-ts-mode--bracket-children-anchor 0)
            ((node-is "else") parent-bol 0)
            ((node-is "case") parent-bol 0)
            ((node-is "preproc_arg") no-indent)
@@ -130,17 +129,28 @@ MODE is either `c' or `cpp'."
             c-ts-mode--comment-2nd-line-anchor
             1)
            ((parent-is "comment") prev-adaptive-prefix 0)
-           (c-ts-mode--top-level-label-matcher point-min 1)
+
+           ;; Labels.
            ((node-is "labeled_statement") parent-bol 0)
-           ((parent-is "labeled_statement") parent-bol c-ts-mode-indent-offset)
+           ((parent-is "labeled_statement")
+            point-min c-ts-mode--statement-offset)
+
            ((match "preproc_ifdef" "compound_statement") point-min 0)
            ((match "#endif" "preproc_ifdef") point-min 0)
            ((match "preproc_if" "compound_statement") point-min 0)
            ((match "#endif" "preproc_if") point-min 0)
            ((match "preproc_function_def" "compound_statement") point-min 0)
            ((match "preproc_call" "compound_statement") point-min 0)
+
+           ;; {} blocks.
+           ((node-is "}") point-min c-ts-mode--close-bracket-offset)
            ((parent-is "compound_statement")
-            c-ts-mode--bracket-children-anchor c-ts-mode-indent-offset)
+            point-min c-ts-mode--statement-offset)
+           ((parent-is "enumerator_list")
+            point-min c-ts-mode--statement-offset)
+           ((parent-is "field_declaration_list")
+            point-min c-ts-mode--statement-offset)
+
            ((parent-is "function_definition") parent-bol 0)
            ((parent-is "conditional_expression") first-sibling 0)
            ((parent-is "assignment_expression") parent-bol 
c-ts-mode-indent-offset)
@@ -156,12 +166,11 @@ MODE is either `c' or `cpp'."
            ((query "(for_statement update: (_) @indent)") parent-bol 5)
            ((query "(call_expression arguments: (_) @indent)") parent 
c-ts-mode-indent-offset)
            ((parent-is "call_expression") parent 0)
-           ((parent-is "enumerator_list") parent-bol c-ts-mode-indent-offset)
            ,@(when (eq mode 'cpp)
                '(((node-is "access_specifier") parent-bol 0)
                  ;; Indent the body of namespace definitions.
                  ((parent-is "declaration_list") parent-bol 
c-ts-mode-indent-offset)))
-           ((parent-is "field_declaration_list") parent-bol 
c-ts-mode-indent-offset)
+
            ((parent-is "initializer_list") parent-bol c-ts-mode-indent-offset)
            ((parent-is "if_statement") parent-bol c-ts-mode-indent-offset)
            ((parent-is "for_statement") parent-bol c-ts-mode-indent-offset)
@@ -174,6 +183,7 @@ MODE is either `c' or `cpp'."
     `((gnu
        ;; Prepend rules to set highest priority
        ((match "while" "do_statement") parent 0)
+       (c-ts-mode--top-level-label-matcher point-min 1)
        ,@common)
       (k&r ,@common)
       (linux
@@ -210,25 +220,55 @@ NODE should be a labeled_statement."
   (let ((func (treesit-parent-until
                node (lambda (n)
                       (equal (treesit-node-type n)
-                             "function_definition")))))
+                             "compound_statement")))))
     (and (equal (treesit-node-type node)
                 "labeled_statement")
-         (not (treesit-node-top-level func "function_definition")))))
-
-(defun c-ts-mode--bracket-children-anchor (_n parent &rest _)
-  "This anchor is used for children of a compound_statement.
-So anything inside a {} block.  PARENT should be the
-compound_statement.  This anchor looks at the {, if itson its own
-line, anchor at it, if it has stuff before it, anchor at the
-beginning of grandparent."
-  (save-excursion
-    (goto-char (treesit-node-start parent))
-    (let ((bol (line-beginning-position)))
-      (skip-chars-backward " \t")
-      (treesit-node-start
-       (if (< bol (point))
-           (treesit-node-parent parent)
-         parent)))))
+         (not (treesit-node-top-level func "compound_statement")))))
+
+(defvar c-ts-mode-indent-block-type-regexp
+  (rx (or "compound_statement"
+          "field_declaration_list"
+          "enumeratior_list"))
+  "Regexp matching types of block nodes (i.e., {} blocks).")
+
+(defun c-ts-mode--statement-offset (node parent &rest _)
+  "This anchor is used for children of a statement inside a block.
+
+This function basically counts the number of block nodes (defined
+by `c-ts-mode--indent-block-type-regexp') between NODE and the
+root node (not counting NODE itself), and multiply that by
+`c-ts-mode-indent-offset'.
+
+To support GNU style, on each block level, this function also
+checks whether the opening bracket { is on its own line, if so,
+it adds an extra level, except for the top-level.
+
+PARENT is NODE's parent."
+  (let ((level 0))
+    ;; If point is on an empty line, NODE would be nil, but we pretend
+    ;; there is a statement node.
+    (when (null node)
+      (setq node t))
+    (while (if (eq node t)
+               (setq node parent)
+             (setq node (treesit-node-parent node)))
+      (when (string-match-p c-ts-mode-indent-block-type-regexp
+                            (treesit-node-type node))
+        (cl-incf level)
+        (save-excursion
+          (goto-char (treesit-node-start node))
+          (cond ((bolp) nil)
+                ((looking-back (rx bol (* whitespace))
+                               (line-beginning-position))
+                 (cl-incf level))))))
+    (* level c-ts-mode-indent-offset)))
+
+(defun c-ts-mode--close-bracket-offset (node parent &rest _)
+  "Offset for the closing bracket, NODE.
+It's basically one level less that the statements in the block.
+PARENT is NODE's parent."
+  (- (c-ts-mode--statement-offset node parent)
+     c-ts-mode-indent-offset))
 
 (defun c-ts-mode--looking-at-star (_n _p bol &rest _)
   "A tree-sitter simple indent matcher.
@@ -254,14 +294,15 @@ PARENT should be a comment node."
          (back-to-indentation)
          (eq (point) (treesit-node-start parent)))))
 
-(defun c-ts-mode--comment-2nd-line-anchor (&rest _)
+(defun c-ts-mode--comment-2nd-line-anchor (_n _p bol &rest _)
   "Return appropriate anchor for the second line of a comment.
 
 If the first line is /* alone, return the position right after
 the star; if the first line is /* followed by some text, return
 the position right before the text minus 1.
 
-Use an offset of 1 with this anchor."
+Use an offset of 1 with this anchor.  BOL is the beginning of
+non-whitespace characters of the current line."
   (save-excursion
     (forward-line -1)
     (back-to-indentation)
@@ -270,8 +311,17 @@ Use an offset of 1 with this anchor."
       (if (looking-at (rx (* (or " " "\t")) eol))
           ;; Only /* at the first line.
           (progn (skip-chars-backward " \t")
-                 (point))
-        ;; There is something after /* at the first line.
+                 (if (save-excursion
+                       (goto-char bol)
+                       (looking-at (rx "*")))
+                     ;; The common case.  Checked by "Multiline Block
+                     ;; Comments 4".
+                     (point)
+                   ;; The "Multiline Block Comments 2" test in
+                   ;; c-ts-mode-resources/indent.erts checks this.
+                   (1- (point))))
+        ;; There is something after /* at the first line.  The
+        ;; "Multiline Block Comments 3" test checks this.
         (1- (point))))))
 
 ;;; Font-lock
@@ -671,79 +721,94 @@ the semicolon.  This function skips the semicolon."
 
 ;;; Filling
 
+(defvar c-ts-mode--comment-regexp
+  ;; These covers C/C++, Java, JavaScript, TypeScript, Rust, C#.
+  (rx (or "comment" "line_comment" "block_comment"))
+  "Regexp pattern that matches a comment in C-like languages.")
+
 (defun c-ts-mode--fill-paragraph (&optional arg)
   "Fillling function for `c-ts-mode'.
 ARG is passed to `fill-paragraph'."
   (interactive "*P")
   (save-restriction
     (widen)
-    (let* ((node (treesit-node-at (point)))
-           (start (treesit-node-start node))
-           (end (treesit-node-end node))
-           ;; Bind to nil to avoid infinite recursion.
-           (fill-paragraph-function nil)
-           (orig-point (point-marker))
-           (start-marker nil)
-           (end-marker nil)
-           (end-len 0))
-      ;; These covers C/C++, Java, JavaScript, TypeScript, Rust, C#.
-      (when (member (treesit-node-type node)
-                    '("comment" "line_comment" "block_comment"))
-        ;; We mask "/*" and the space before "*/" like
-        ;; `c-fill-paragraph' does.
-        (atomic-change-group
-          ;; Mask "/*".
-          (goto-char start)
-          (when (looking-at (rx (* (syntax whitespace))
-                                (group "/") "*"))
-            (goto-char (match-beginning 1))
-            (setq start-marker (point-marker))
-            (replace-match " " nil nil nil 1))
-          ;; Include whitespaces before /*.
-          (goto-char start)
-          (beginning-of-line)
-          (setq start (point))
-          ;; Mask spaces before "*/" if it is attached at the end
-          ;; of a sentence rather than on its own line.
-          (goto-char end)
-          (when (looking-back (rx (not (syntax whitespace))
-                                  (group (+ (syntax whitespace)))
-                                  "*/")
-                              (line-beginning-position))
-            (goto-char (match-beginning 1))
-            (setq end-marker (point-marker))
-            (setq end-len (- (match-end 1) (match-beginning 1)))
-            (replace-match (make-string end-len ?x)
-                           nil nil nil 1))
-          ;; If "*/" is on its own line, don't included it in the
-          ;; filling region.
-          (when (not end-marker)
-            (goto-char end)
-            (when (looking-back (rx "*/") 2)
-              (backward-char 2)
-              (skip-syntax-backward "-")
-              (setq end (point))))
-          ;; Let `fill-paragraph' do its thing.
-          (goto-char orig-point)
-          (narrow-to-region start end)
-          ;; We don't want to fill the region between START and
-          ;; START-MARKER, otherwise the filling function might delete
-          ;; some spaces there.
-          (fill-region start-marker end arg)
-          ;; Unmask.
-          (when start-marker
-            (goto-char start-marker)
-            (delete-char 1)
-            (insert "/"))
-          (when end-marker
-            (goto-char end-marker)
-            (delete-region (point) (+ end-len (point)))
-            (insert (make-string end-len ?\s))))
-        (goto-char orig-point))
+    (let ((node (treesit-node-at (point))))
+      (when (string-match-p c-ts-mode--comment-regexp
+                            (treesit-node-type node))
+        (if (save-excursion
+              (goto-char (treesit-node-start node))
+              (looking-at "//"))
+            (fill-comment-paragraph arg)
+          (c-ts-mode--fill-block-comment arg)))
       ;; Return t so `fill-paragraph' doesn't attempt to fill by
       ;; itself.
       t)))
 
+(defun c-ts-mode--fill-block-comment (&optional arg)
+  "Fillling function for block comments.
+ARG is passed to `fill-paragraph'.  Assume point is in a block
+comment."
+  (let* ((node (treesit-node-at (point)))
+         (start (treesit-node-start node))
+         (end (treesit-node-end node))
+         ;; Bind to nil to avoid infinite recursion.
+         (fill-paragraph-function nil)
+         (orig-point (point-marker))
+         (start-marker (point-marker))
+         (end-marker nil)
+         (end-len 0))
+    (move-marker start-marker start)
+    ;; We mask "/*" and the space before "*/" like
+    ;; `c-fill-paragraph' does.
+    (atomic-change-group
+      ;; Mask "/*".
+      (goto-char start)
+      (when (looking-at (rx (* (syntax whitespace))
+                            (group "/") "*"))
+        (goto-char (match-beginning 1))
+        (move-marker start-marker (point))
+        (replace-match " " nil nil nil 1))
+      ;; Include whitespaces before /*.
+      (goto-char start)
+      (beginning-of-line)
+      (setq start (point))
+      ;; Mask spaces before "*/" if it is attached at the end
+      ;; of a sentence rather than on its own line.
+      (goto-char end)
+      (when (looking-back (rx (not (syntax whitespace))
+                              (group (+ (syntax whitespace)))
+                              "*/")
+                          (line-beginning-position))
+        (goto-char (match-beginning 1))
+        (setq end-marker (point-marker))
+        (setq end-len (- (match-end 1) (match-beginning 1)))
+        (replace-match (make-string end-len ?x)
+                       nil nil nil 1))
+      ;; If "*/" is on its own line, don't included it in the
+      ;; filling region.
+      (when (not end-marker)
+        (goto-char end)
+        (when (looking-back (rx "*/") 2)
+          (backward-char 2)
+          (skip-syntax-backward "-")
+          (setq end (point))))
+      ;; Let `fill-paragraph' do its thing.
+      (goto-char orig-point)
+      (narrow-to-region start end)
+      ;; We don't want to fill the region between START and
+      ;; START-MARKER, otherwise the filling function might delete
+      ;; some spaces there.
+      (fill-region start-marker end arg)
+      ;; Unmask.
+      (when start-marker
+        (goto-char start-marker)
+        (delete-char 1)
+        (insert "/"))
+      (when end-marker
+        (goto-char end-marker)
+        (delete-region (point) (+ end-len (point)))
+        (insert (make-string end-len ?\s))))))
+
 (defun c-ts-mode-comment-setup ()
   "Set up local variables for C-like comment.
 
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index eac052ca4f..83c437d307 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -316,7 +316,8 @@ Return nil if there is no name or if NODE is not a defun 
node."
                             "enum_declaration"
                             "import_declaration"
                             "package_declaration"
-                            "module_declaration")))
+                            "module_declaration"
+                            "constructor_declaration")))
   (setq-local treesit-defun-name-function #'java-ts-mode--defun-name)
 
   (setq-local treesit-sentence-type-regexp
diff --git a/lisp/simple.el b/lisp/simple.el
index bbcb32cb04..4b09f41de5 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2228,8 +2228,8 @@ are available:
          This includes commands marked as specific to the current
          buffer's modes and commands that have keybindings in the
          current buffer's active local keymaps.  It also includes
-         several commands, like Cuztomize commands, which should
-         always be avaliable."
+         several commands, like Customize commands, which should
+         always be available."
   :version "28.1"
   :group 'completion
   :type '(choice (const :tag "Don't exclude any commands" nil)
@@ -9741,7 +9741,11 @@ the completions is popped up and down."
   "Move to the first item in the completion list."
   (interactive)
   (goto-char (point-min))
-  (unless (get-text-property (point) 'mouse-face)
+  (if (get-text-property (point) 'mouse-face)
+      (unless (get-text-property (point) 'first-completion)
+        (let ((inhibit-read-only t))
+          (add-text-properties (point) (min (1+ (point)) (point-max))
+                               '(first-completion t))))
     (when-let ((pos (next-single-property-change (point) 'mouse-face)))
       (goto-char pos))))
 
diff --git a/lisp/sqlite-mode.el b/lisp/sqlite-mode.el
index 83762b6194..c3047c786f 100644
--- a/lisp/sqlite-mode.el
+++ b/lisp/sqlite-mode.el
@@ -55,10 +55,14 @@
   (interactive "fSQLite file name: ")
   (unless (sqlite-available-p)
     (error "This Emacs doesn't have SQLite support, so it can't view SQLite 
files"))
+  (if (file-remote-p file)
+      (error "Remote SQLite files are not yet supported"))
   (pop-to-buffer (get-buffer-create
                   (format "*SQLite %s*" (file-name-nondirectory file))))
   (sqlite-mode)
   (setq-local sqlite--db (sqlite-open file))
+  (unless (sqlitep sqlite--db)
+    (error "`sqlite-open' failed to open SQLite file"))
   (sqlite-mode-list-tables))
 
 (defun sqlite-mode-list-tables ()
diff --git a/lisp/treesit.el b/lisp/treesit.el
index f2e1b4ac80..e9f5a8b37b 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1511,10 +1511,15 @@ OFFSET."
                return
                (let ((anchor-pos
                       (treesit--simple-indent-eval
-                       (list anchor node parent bol))))
-                 (cons anchor-pos (if (symbolp offset)
-                                      (symbol-value offset)
-                                    offset)))
+                       (list anchor node parent bol)))
+                     (offset-val
+                      (cond ((numberp offset) offset)
+                            ((and (symbolp offset)
+                                  (boundp offset))
+                             (symbol-value offset))
+                            (t (treesit--simple-indent-eval
+                                (list offset node parent bol))))))
+                 (cons anchor-pos offset-val))
                finally return
                (progn (when treesit--indent-verbose
                         (message "No matched rule"))
diff --git a/lisp/woman.el b/lisp/woman.el
index dfb5e69778..92cd425d32 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -2355,7 +2355,7 @@ Currently set only from \\='\\\" t in the first line of 
the source file.")
     (point-max)))
 
 (defun woman-horizontal-escapes (to)
-  "Process \\h'+/-N' local horizontal motion escapes upto TO.
+  "Process \\h'+/-N' local horizontal motion escapes up to TO.
 Implements arbitrary forward and non-overlapping backward motion.
 Preserves location of `point'."
   ;; Moved from `woman-decode-region' for version 0.50.
@@ -3346,7 +3346,7 @@ Ignore the default face and underline only word 
characters."
 
 (defun woman2-tr (to)
   ".tr abcde -- Translate a -> b, c -> d, ..., e -> space.
-Format paragraphs upto TO.  Supports special chars.
+Format paragraphs up to TO.  Supports special chars.
 \(Breaks, but should not.)"
   ;; This should be an update, but consing onto the front of the alist
   ;; has the same effect and match duplicates should not matter.
@@ -3402,7 +3402,7 @@ Format paragraphs upto TO.  Supports special chars.
 (defvar woman-registers                        ; these are all read-only
   '((".H" 24) (".V" 48)                        ; resolution in basic units
     (".g" 0)                           ; not groff
-    ;; (Iff emulating groff need to implement groff italic correction
+    ;; (If emulating groff need to implement groff italic correction
     ;; \/, e.g. for pic.1)
     (".i" left-margin)                 ; current indent
     (".j" woman-adjust)                        ; current adjustment
@@ -3432,7 +3432,7 @@ Handle numeric arguments specially if optional argument 
NUMERIC is non-nil."
 (defun woman2-nr (to)
   ".nr R +/-N M -- Assign +/-N (wrt to previous value, if any) to register R.
 The increment for auto-incrementing is set to M.
-Format paragraphs upto TO.  (Breaks, but should not!)"
+Format paragraphs up to TO.  (Breaks, but should not!)"
   (let* ((name (buffer-substring
                (point)
                (progn (skip-syntax-forward "^ ") (point))))
@@ -3699,7 +3699,7 @@ regexp, \"\\(\\\\c\\)?\\n[.\\=']\"."
 
 (defun woman2-PD (to)
   ".PD d -- Set the interparagraph distance to d.
-Round to whole lines, default 1 line.  Format paragraphs upto TO.
+Round to whole lines, default 1 line.  Format paragraphs up to TO.
 \(Breaks, but should not.)"
   ;; .ie \\n[.$] .nr PD (v;\\$1)
   ;; .el .nr PD .4v>?\n[.V]
@@ -3718,7 +3718,7 @@ Round to whole lines, default 1 line.  Format paragraphs 
upto TO.
   (setq woman-leave-blank-lines woman-interparagraph-distance))
 
 (defun woman2-TH (to)
-  ".TH n c x v m -- Begin a man page.  Format paragraphs upto TO.
+  ".TH n c x v m -- Begin a man page.  Format paragraphs up to TO.
 n is the name of the page in chapter c; x is extra commentary;
 v alters page foot left; m alters page head center.
 \(Should set prevailing indent and tabs to 5.)"
@@ -3748,7 +3748,7 @@ v alters page foot left; m alters page head center.
 
 (defun woman2-SH (to)
   ".SH -- Sub-head.  Leave blank line and subhead.
-Format paragraphs upto TO.  Set prevailing indent to 5."
+Format paragraphs up to TO.  Set prevailing indent to 5."
   (if (eolp)                           ; If no args then
       (delete-char 1)                  ; apply to next line
     (woman-unquote-args)               ; else unquote to end of heading
@@ -3767,7 +3767,7 @@ Format paragraphs upto TO.  Set prevailing indent to 5."
 
 (defun woman2-SS (to)
   ".SS -- Sub-sub-head.  Like .SH but indent heading 3 spaces.
-Format paragraphs upto TO."
+Format paragraphs up to TO."
   (if (eolp)                           ; If no args then
       (delete-char 1))                 ; apply to next line.
   (insert "   ")
@@ -3776,7 +3776,7 @@ Format paragraphs upto TO."
 
 (defun woman2-LP (to)
   ".LP,.PP -- Begin paragraph.  Set prevailing indent to 5.
-Leave 1 blank line.  Format paragraphs upto TO."
+Leave 1 blank line.  Format paragraphs up to TO."
   (woman-delete-line 1)                        ; ignore any arguments
   (woman-interparagraph-space)
   (setq woman-prevailing-indent woman-default-indent)
@@ -3786,21 +3786,21 @@ Leave 1 blank line.  Format paragraphs upto TO."
 (defalias 'woman2-P #'woman2-LP)
 
 (defun woman2-ns (to)
-  ".ns -- Turn on no-space mode.  Format paragraphs upto TO."
+  ".ns -- Turn on no-space mode.  Format paragraphs up to TO."
   ;; Should not cause a break!
   (woman-delete-line 1)                        ; ignore argument(s)
   (setq woman-nospace t)
   (woman2-format-paragraphs to))
 
 (defun woman2-rs (to)
-  ".rs -- Turn off no-space mode.  Format paragraphs upto TO."
+  ".rs -- Turn off no-space mode.  Format paragraphs up to TO."
   ;; Should not cause a break!
   (woman-delete-line 1)                        ; ignore argument(s)
   (setq woman-nospace nil)
   (woman2-format-paragraphs to))
 
 (defun woman2-sp (to)
-  ".sp N -- If N > 0 then leave 1 blank line.  Format paragraphs upto TO."
+  ".sp N -- If N > 0 then leave 1 blank line.  Format paragraphs up to TO."
   (let ((N (if (eolp) 1 (woman-get-numeric-arg))))
     (if (>= N 0)
        (woman-delete-line 1)           ; ignore argument(s)
@@ -3955,13 +3955,13 @@ Optional argument NUMERIC, if non-nil, means the 
argument is numeric."
 ;;; 4. Text Filling, Adjusting, and Centering
 
 (defun woman2-br (to)
-  ".br -- Break.  Leave no blank line.  Format paragraphs upto TO."
+  ".br -- Break.  Leave no blank line.  Format paragraphs up to TO."
   (woman-delete-line 1)                        ; ignore any arguments
   (woman2-format-paragraphs to))
 
 (defun woman2-fi (to)
   ".fi -- Fill subsequent output lines.  Leave no blank line.
-Format paragraphs upto TO."
+Format paragraphs up to TO."
   (setq woman-nofill nil)
   (woman-delete-line 1)                        ; ignore any arguments
   ;; Preserve any final blank line in the nofill region:
@@ -3981,7 +3981,7 @@ for the current line length.  Format paragraphs up to TO."
 (defun woman2-ad (to)
   ".ad c -- Line adjustment is begun (once fill mode is on).
 Set justification mode to c if specified.
-Format paragraphs upto TO.  (Breaks, but should not.)"
+Format paragraphs up to TO.  (Breaks, but should not.)"
   ;; c = l -- left, r -- right, c -- center, b or n -- both,
   ;; absent -- unchanged.  Initial mode adj,both.
   (setq woman-adjust
@@ -3997,7 +3997,7 @@ Format paragraphs upto TO.  (Breaks, but should not.)"
   (woman2-format-paragraphs to))
 
 (defun woman2-na (to)
-  ".na -- No adjusting.  Format paragraphs upto TO.
+  ".na -- No adjusting.  Format paragraphs up to TO.
 \(Breaks, but should not.)"
   (setq woman-adjust-previous woman-adjust
        woman-justify-previous woman-justify
@@ -4037,7 +4037,7 @@ non-nil and non-zero."
 (defvar woman-temp-indent nil)
 
 (defun woman2-format-paragraphs (to &optional new-left)
-  "Indent, fill and adjust paragraphs upto TO to current left margin.
+  "Indent, fill and adjust paragraphs up to TO to current left margin.
 If optional arg NEW-LEFT is non-nil then reset current left margin.
 If `woman-nofill' is non-nil then indent without filling or adjusting."
   ;; Blank space should only ever be output before text.
@@ -4103,7 +4103,7 @@ If `woman-nofill' is non-nil then indent without filling 
or adjusting."
 ;;; Tagged, indented and hanging paragraphs:
 
 (defun woman2-TP (to)
-  ".TP i -- Set prevailing indent to i.  Format paragraphs upto TO.
+  ".TP i -- Set prevailing indent to i.  Format paragraphs up to TO.
 Begin indented paragraph with hanging tag given by next text line.
 If tag doesn't fit, place it on a separate line."
   (let ((i (woman2-get-prevailing-indent)))
@@ -4111,7 +4111,7 @@ If tag doesn't fit, place it on a separate line."
     (woman2-tagged-paragraph to i)))
 
 (defun woman2-IP (to)
-  ".IP x i -- Same as .TP with tag x.  Format paragraphs upto TO."
+  ".IP x i -- Same as .TP with tag x.  Format paragraphs up to TO."
   (woman-interparagraph-space)
   (if (eolp)                           ; no args
       ;; Like LP without resetting prevailing indent
@@ -4152,7 +4152,7 @@ If tag doesn't fit, place it on a separate line."
 (defun woman2-tagged-paragraph (to i)
   "Begin indented paragraph with hanging tag given by current text line.
 If tag doesn't fit, leave it on separate line.
-Format paragraphs upto TO.  Set prevailing indent to I."
+Format paragraphs up to TO.  Set prevailing indent to I."
   (if (not (looking-at "\\s *$"))      ; non-empty tag
       (setq woman-leave-blank-lines nil))
 
@@ -4206,7 +4206,7 @@ Format paragraphs upto TO.  Set prevailing indent to I."
           (goto-char to)))))
 
 (defun woman2-HP (to)
-  ".HP i -- Set prevailing indent to i.  Format paragraphs upto TO.
+  ".HP i -- Set prevailing indent to i.  Format paragraphs up to TO.
 Begin paragraph with hanging indent."
   (let ((i (woman2-get-prevailing-indent)))
     (woman-interparagraph-space)
@@ -4228,7 +4228,7 @@ Delete line from point and eol unless LEAVE-EOL is 
non-nil."
 
 (defun woman2-RS (to)
   ".RS i -- Start relative indent, move left margin in distance i.
-Set prevailing indent to 5 for nested indents.  Format paragraphs upto TO."
+Set prevailing indent to 5 for nested indents.  Format paragraphs up to TO."
   (push woman-left-margin woman-RS-left-margin)
   (push woman-prevailing-indent woman-RS-prevailing-indent)
   (setq woman-left-margin (+ woman-left-margin
@@ -4237,7 +4237,7 @@ Set prevailing indent to 5 for nested indents.  Format 
paragraphs upto TO."
   (woman2-format-paragraphs to woman-left-margin))
 
 (defun woman2-RE (to)
-  ".RE -- End of relative indent.  Format paragraphs upto TO.
+  ".RE -- End of relative indent.  Format paragraphs up to TO.
 Set prevailing indent to amount of starting .RS."
   (when woman-RS-left-margin
     (setq woman-left-margin (pop woman-RS-left-margin)))
@@ -4274,18 +4274,18 @@ otherwise set PREVIOUS.  Delete the whole remaining 
control line."
 
 (defun woman2-ll (to)
   ".ll +/-N -- Set, increment or decrement line length.
-Format paragraphs upto TO.  (Breaks, but should not.)"
+Format paragraphs up to TO.  (Breaks, but should not.)"
   (woman-set-arg 'fill-column 'woman-ll-fill-column)
   (woman2-format-paragraphs to))
 
 (defun woman2-in (to)
   ".in +/-N -- Set, increment or decrement the indent.
-Format paragraphs upto TO."
+Format paragraphs up to TO."
   (woman-set-arg 'left-margin 'woman-in-left-margin)
   (woman2-format-paragraphs to))
 
 (defun woman2-ti (to)
-  ".ti +/-N -- Temporary indent.  Format paragraphs upto TO."
+  ".ti +/-N -- Temporary indent.  Format paragraphs up to TO."
   ;; Ignore if no argument.
   ;; Indent next output line only wrt current indent.
   ;; Current indent is not changed.
@@ -4300,7 +4300,7 @@ Format paragraphs upto TO."
   ".ta Nt ... -- Set tabs, left type, unless t=R(right), C(centered).
 \(Breaks, but should not.)  The tab stops are separated by spaces;
 a value preceded by + represents an increment to the previous stop value.
-Format paragraphs upto TO."
+Format paragraphs up to TO."
   (setq tab-stop-list nil)
   (woman2-process-escapes-to-eol 'numeric)
   (save-excursion
@@ -4350,7 +4350,7 @@ tab stop columns or pairs (COLUMN . TYPE) where TYPE is R 
or C."
       (insert ?\s))))
 
 (defun woman2-DT (to)
-  ".DT -- Restore default tabs.  Format paragraphs upto TO.
+  ".DT -- Restore default tabs.  Format paragraphs up to TO.
 \(Breaks, but should not.)"
   ;; Currently just terminates special tab processing.
   (setq tab-stop-list nil)
@@ -4359,7 +4359,7 @@ tab stop columns or pairs (COLUMN . TYPE) where TYPE is R 
or C."
 
 (defun woman2-fc (to)
   ".fc a b -- Set field delimiter a and pad character b.
-Format paragraphs upto TO.
+Format paragraphs up to TO.
 A VERY FIRST ATTEMPT to make fields at least readable!
 Needs doing properly!"
   (if (eolp)
@@ -4395,7 +4395,7 @@ Needs doing properly!"
 
 (defun woman2-TS (to)
   ".TS -- Start of table code for the tbl processor.
-Format paragraphs upto TO."
+Format paragraphs up to TO."
   (when woman-emulate-tbl
     ;; Assumes column separator is \t and intercolumn spacing is 3.
     ;; The first line may optionally be a list of options terminated by
diff --git a/src/ccl.c b/src/ccl.c
index c92684f4bc..6e780ef9f0 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1987,7 +1987,7 @@ ccl_get_compiled_code (Lisp_Object ccl_prog, ptrdiff_t 
*idx)
 /* Setup fields of the structure pointed by CCL appropriately for the
    execution of CCL program CCL_PROG.  CCL_PROG is the name (symbol)
    of the CCL program or the already compiled code (vector).
-   Return true iff successful.
+   Return true if successful.
 
    If CCL_PROG is nil, just reset the structure pointed by CCL.  */
 bool
diff --git a/src/keyboard.c b/src/keyboard.c
index 0ed2807033..6f0f075e54 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10010,7 +10010,7 @@ read_key_sequence (Lisp_Object *keybuf, Lisp_Object 
prompt,
 
       if (/* first_unbound < indec.start && first_unbound < fkey.start && */
          first_unbound < keytran.start)
-       { /* The prefix upto first_unbound has no binding and has
+       { /* The prefix up to first_unbound has no binding and has
             no translation left to do either, so we know it's unbound.
             If we don't stop now, we risk staying here indefinitely
             (if the user keeps entering fkey or keytran prefixes
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 6b2fa5df03..2dca0d16ad 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -223,7 +223,7 @@ typedef enum
           is followed by a range table:
               2 bytes of flags for character sets (low 8 bits, high 8 bits)
                   See RANGE_TABLE_WORK_BITS below.
-              2 bytes, the number of pairs that follow (upto 32767)
+              2 bytes, the number of pairs that follow (up to 32767)
               pairs, each 2 multibyte characters,
                   each multibyte character represented as 3 bytes.  */
   charset,
diff --git a/test/lisp/erc/resources/networks/merge-server/track.eld 
b/test/lisp/erc/resources/networks/merge-server/track.eld
index 4a97f92f72..19c37aaf40 100644
--- a/test/lisp/erc/resources/networks/merge-server/track.eld
+++ b/test/lisp/erc/resources/networks/merge-server/track.eld
@@ -21,7 +21,7 @@
  (0.00 ":irc.example.net 376 tester :End of message of the day."))
 
 ((mode 10 "MODE tester +i")
- (0.00 ":irc.example.net 501 tester x :is not a recognised user mode.")
+ (0.00 ":irc.example.net 501 tester x :is not a recognized user mode.")
  (0.00 ":NickServ!NickServ@services.int NOTICE tester :Welcome to FooNet, 
tester! Here on FooNet, we provide services to enable the registration of 
nicknames and channels! For details, type \2/msg NickServ help\2 and \2/msg 
ChanServ help\2.")
  (0.02 ":tester!user@10.0.2.100 MODE tester :+i"))
 
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index 2ac5e0f29d..1de8e56cbd 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -421,7 +421,7 @@
       (switch-to-completions)
       ;; Fixed in bug#55430
       (should (equal "aa" (get-text-property (point) 'completion--string)))
-      (next-completion 3)
+      (next-completion 2)
       (should (equal "ac" (get-text-property (point) 'completion--string)))
       (previous-completion 2)
       (should (equal "aa" (get-text-property (point) 'completion--string)))
diff --git a/test/lisp/progmodes/c-ts-mode-resources/filling.erts 
b/test/lisp/progmodes/c-ts-mode-resources/filling.erts
new file mode 100644
index 0000000000..e51e3658c8
--- /dev/null
+++ b/test/lisp/progmodes/c-ts-mode-resources/filling.erts
@@ -0,0 +1,198 @@
+Code:
+  (lambda ()
+    (c-ts-mode)
+    (setq-local indent-tabs-mode nil)
+    (fill-paragraph))
+
+Point-Char: |
+
+Name: Type 1
+
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=-=
+
+Name: Type 2
+
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=-=
+
+Name: Type 3
+
+=-=
+/*================================================================
+  woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+  woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+  woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+  ================================================================*/
+=-=
+/*================================================================
+  woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+  woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+  woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+  ================================================================*/
+=-=-=
+
+Name: Type 4
+
+=-=
+/*================================================================
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ woooomy woooomy woooomy woooomy woooomy
+ * ================================================================*/
+=-=
+/*================================================================
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy
+ * ================================================================*/
+=-=-=
+
+Name: Type 5
+
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ * woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=-=
+
+Name: Type 6
+
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=-=
+
+Name: Type 6
+
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+ */
+=-=-=
+
+Name: Type 7
+
+=-=
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+=-=
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+=-=-=
+
+Name: Type 8
+
+=-=
+// ================================================================
+//  woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+//  woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+//  woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+//  ================================================================
+=-=
+// ================================================================
+//  woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+//  woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+//  woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+//  ================================================================
+=-=-=
+
+Name: Type 9
+
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomyyy  */
+=-=
+/* woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+   woooomyyy  */
+=-=-=
+
+Name: Not Over Fill 1
+
+=-=
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+
+// |woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+=-=-=
+
+Name: Not Over Fill 2
+
+=-=
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+return; // woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+//| woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+return; // woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+=-=
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+return; // woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+return; // woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+=-=-=
+
+Name: Not Over Fill 3
+
+=-=
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+return; //| woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+return; // woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+=-=
+// woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+return; // woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+        // woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+        // woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+        // woooomy woooomy
+return; // woooomy woooomy woooomy woooomy woooomy woooomy woooomy woooomy
+=-=-=
diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts 
b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
index 5defcbd3c8..71524e273f 100644
--- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
@@ -1,8 +1,13 @@
 Code:
   (lambda ()
+    (setq indent-tabs-mode nil)
+    (setq c-ts-mode-indent-offset 2)
+    (setq c-ts-mode-indent-style 'gnu)
     (c-ts-mode)
     (indent-region (point-min) (point-max)))
 
+Point-Char: |
+
 Name: Basic
 
 =-=
@@ -25,6 +30,68 @@ main (void)
 }
 =-=-=
 
+Name: Labels (GNU Style)
+
+=-=
+int
+main (void)
+{
+ label:
+  return 0;
+  if (true)
+    {
+    label:
+      return 0;
+    }
+  else
+    {
+      if (true)
+        {
+        label:
+          return 0;
+        }
+    }
+}
+=-=-=
+
+Name: For Loop with Multi-line Condition (GNU Style)
+
+=-=
+int main()
+{
+  for (int i = 0;
+       i < b;
+       i++)
+    {
+      return 0;
+    }
+}
+=-=-=
+
+Name: If-Else (GNU Style)
+
+=-=
+int main()
+{
+  if (true)
+    {
+      return 0;
+    }
+  else
+    {
+      return 1;
+    }
+}
+=-=-=
+
+Name: Empty Line
+=-=
+int main()
+{
+  |
+}
+=-=-=
+
 Name: Multiline Parameter List (bug#60398)
 
 =-=
@@ -34,7 +101,7 @@ int f2(int x,
 };
 =-=-=
 
-Name: Multiline Block Comments (bug#60270)
+Name: Multiline Block Comments 1 (bug#60270)
 
 =-=
 /**
@@ -42,3 +109,55 @@ Name: Multiline Block Comments (bug#60270)
  * @arg1:
  */
 =-=-=
+
+Name: Multiline Block Comments 2 (bug#60270)
+
+=-=
+/*
+  some comment
+ */
+=-=-=
+
+Name: Multiline Block Comments 3 (bug#60270)
+
+=-=
+/* some comment
+ */
+=-=-=
+
+Name: Multiline Block Comments 4 (bug#60270)
+
+=-=
+/*
+ * Some comment
+ */
+=-=-=
+
+
+Code:
+  (lambda ()
+    (setq indent-tabs-mode nil)
+    (setq c-ts-mode-indent-offset 8)
+    (setq c-ts-mode-indent-style 'linux)
+    (c-ts-mode)
+    (indent-region (point-min) (point-max)))
+
+Name: Labels (Linux Style)
+
+=-=-=
+int main (void)
+{
+label:
+        return 0;
+        if (true) {
+label:
+                return 0;
+        }
+        else {
+                if (true) {
+label:
+                        return 0;
+                }
+        }
+}
+=-=-=
diff --git a/test/lisp/progmodes/c-ts-mode-tests.el 
b/test/lisp/progmodes/c-ts-mode-tests.el
index 8606faf991..3d0902fe50 100644
--- a/test/lisp/progmodes/c-ts-mode-tests.el
+++ b/test/lisp/progmodes/c-ts-mode-tests.el
@@ -27,5 +27,9 @@
   (skip-unless (treesit-ready-p 'c))
   (ert-test-erts-file (ert-resource-file "indent.erts")))
 
+(ert-deftest c-ts-mode-test-filling ()
+  (skip-unless (treesit-ready-p 'c))
+  (ert-test-erts-file (ert-resource-file "filling.erts")))
+
 (provide 'c-ts-mode-tests)
 ;;; c-ts-mode-tests.el ends here
diff --git a/test/manual/indent/octave.m b/test/manual/indent/octave.m
index 76cad09ad1..08b7fa58d5 100644
--- a/test/manual/indent/octave.m
+++ b/test/manual/indent/octave.m
@@ -1517,7 +1517,7 @@ function copy_files (desc, packdir, global_install)
     if (exist (fullfile (desc.dir, getarch ()), "dir") &&
        ! strcmp (fullfile (desc.dir, getarch ()), octfiledir))
       if (! exist (octfiledir, "dir"))
-        ## Can be required to create upto three levels of dirs.
+        ## Can be required to create up to three levels of dirs.
         octm1 = fileparts (octfiledir);
         if (! exist (octm1, "dir"))
           octm2 = fileparts (octm1);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]