Merge remote-tracking branch 'origin/master' into feature/android

This commit is contained in:
Po Lu 2023-06-18 08:56:54 +08:00
commit 8412581f08
20 changed files with 478 additions and 177 deletions

View file

@ -981,6 +981,15 @@ Letter, Number, Punctuation, Symbol and Private-use
having their own escape syntax such as newline.
@end defvar
@defopt pp-default-function
This user variable specifies the function used by @code{pp} to prettify
its output. By default it uses @code{pp-fill} which attempts to
strike a good balance between speed and generating natural looking output
that fits within @code{fill-column}. The previous default was
@code{pp-28}, which tends to be faster but generate output that looks
less natural and is less compact.
@end defopt
@node Output Overrides
@section Overriding Output Variables
@cindex overrides, in output functions

View file

@ -413,6 +413,13 @@ name as a string. The new function
'dictionary-completing-read-dictionary' can be used to prompt with
completion based on dictionaries that the server supports.
** Pp
*** New 'pp-default-function' custom variable replaces 'pp-use-max-width'.
*** New default pretty printing function, which tries to obey 'fill-column'.
*** 'pp-to-string' takes an additional 'pp-function' argument.
This arg specifies the prettifying algorithm to use.
* New Modes and Packages in Emacs 30.1

View file

@ -876,7 +876,7 @@ complete sexp in the innermost containing list at position
2 (counting from 0). This is important for Lisp indentation."
(unless pos (setq pos (point)))
(let ((pss (syntax-ppss pos)))
(if (nth 9 pss)
(if (and (not (nth 2 pss)) (nth 9 pss))
(let ((sexp-start (car (last (nth 9 pss)))))
(parse-partial-sexp sexp-start pos nil nil (syntax-ppss sexp-start)))
pss)))

View file

@ -52,53 +52,228 @@ Note that this could slow down `pp' considerably when formatting
large lists."
:type 'boolean
:version "29.1")
(make-obsolete-variable 'pp-use-max-width 'pp-default-function "30.1")
(defcustom pp-default-function #'pp-fill
;; FIXME: The best pretty printer to use depends on the use-case
;; so maybe we should allow callers to specify what they want (maybe with
;; options like `fast', `compact', `code', `data', ...) and these
;; can then be mapped to actual pretty-printing algorithms.
;; Then again, callers can just directly call the corresponding function.
"Function that `pp' should dispatch to for pretty printing.
That function can be called in one of two ways:
- with a single argument, which it should insert and pretty-print at point.
- with two arguments which delimit a region containing Lisp sexps
which should be pretty-printed.
In both cases, the function can presume that the buffer is setup for
Lisp syntax."
:type '(choice
(const :tag "Fit within `fill-column'" pp-fill)
(const :tag "Emacs<29 algorithm, fast and good enough" pp-28)
(const :tag "Work hard for code (slow on large inputs)"
pp-emacs-lisp-code)
(const :tag "`pp-emacs-lisp-code' if `pp-use-max-width' else `pp-28'"
pp-29)
function)
:version "30.1")
(defvar pp--inhibit-function-formatting nil)
;; There are basically two APIs for a pretty-printing function:
;;
;; - either the function takes an object (and prints it in addition to
;; prettifying it).
;; - or the function takes a region containing an already printed object
;; and prettifies its content.
;;
;; `pp--object' and `pp--region' are helper functions to convert one
;; API to the other.
(defun pp--object (object region-function)
"Pretty-print OBJECT at point.
The prettifying is done by REGION-FUNCTION which is
called with two positions as arguments and should fold lines
within that region. Returns the result as a string."
(let ((print-escape-newlines pp-escape-newlines)
(print-quoted t)
(beg (point)))
;; FIXME: In many cases it would be preferable to use `cl-prin1' here.
(prin1 object (current-buffer))
(funcall region-function beg (point))))
(defun pp--region (beg end object-function)
"Pretty-print the object(s) contained within BEG..END.
OBJECT-FUNCTION is called with a single object as argument
and should pretty print it at point into the current buffer."
(save-excursion
(with-restriction beg end
(goto-char (point-min))
(while
(progn
;; We'll throw away all the comments within objects, but let's
;; try at least to preserve the comments between objects.
(forward-comment (point-max))
(let ((beg (point))
(object (ignore-error end-of-buffer
(list (read (current-buffer))))))
(when (consp object)
(delete-region beg (point))
(funcall object-function (car object))
t)))))))
(defun pp-29 (beg-or-sexp &optional end) ;FIXME: Better name?
"Prettify the current region with printed representation of a Lisp object.
Uses the pretty-printing algorithm that was standard in Emacs-29,
which, depending on `pp-use-max-width', will either use `pp-28'
or `pp-emacs-lisp-code'."
(if pp-use-max-width
(let ((pp--inhibit-function-formatting t)) ;FIXME: Why?
(pp-emacs-lisp-code beg-or-sexp end))
(pp-28 beg-or-sexp end)))
;;;###autoload
(defun pp-to-string (object)
(defun pp-to-string (object &optional pp-function)
"Return a string containing the pretty-printed representation of OBJECT.
OBJECT can be any Lisp object. Quoting characters are used as needed
to make output that `read' can handle, whenever this is possible."
(if pp-use-max-width
(let ((pp--inhibit-function-formatting t))
(with-temp-buffer
(pp-emacs-lisp-code object)
(buffer-string)))
(with-temp-buffer
(lisp-mode-variables nil)
(set-syntax-table emacs-lisp-mode-syntax-table)
(let ((print-escape-newlines pp-escape-newlines)
(print-quoted t))
(prin1 object (current-buffer)))
(pp-buffer)
(buffer-string))))
to make output that `read' can handle, whenever this is possible.
Optional argument PP-FUNCTION overrides `pp-default-function'."
(with-temp-buffer
(lisp-mode-variables nil)
(set-syntax-table emacs-lisp-mode-syntax-table)
(funcall (or pp-function pp-default-function) object)
;; Preserve old behavior of (usually) finishing with a newline.
(unless (bolp) (insert "\n"))
(buffer-string)))
(defun pp--within-fill-column-p ()
"Return non-nil if point is within `fill-column'."
;; Try and make it O(fill-column) rather than O(current-column),
;; so as to avoid major slowdowns on long lines.
;; FIXME: This doesn't account for invisible text or `display' properties :-(
(and (save-excursion
(re-search-backward
"^\\|\n" (max (point-min) (- (point) fill-column)) t))
(<= (current-column) fill-column)))
(defun pp-fill (beg &optional end)
"Break lines in Lisp code between BEG and END so it fits within `fill-column'.
Presumes the current buffer has syntax and indentation properly
configured for that.
Designed under the assumption that the region occupies a single line,
tho it should also work if that's not the case.
Can also be called with a single argument, in which case
it inserts and pretty-prints that arg at point."
(interactive "r")
(if (null end) (pp--object beg #'pp-fill)
(goto-char beg)
(let ((end (copy-marker end t))
(newline (lambda ()
(skip-chars-forward ")]}")
(unless (save-excursion (skip-chars-forward " \t") (eolp))
(insert "\n")
(indent-according-to-mode)))))
(while (progn (forward-comment (point-max))
(< (point) end))
(let ((beg (point))
;; Whether we're in front of an element with paired delimiters.
;; Can be something funky like #'(lambda ..) or ,'#s(...).
(paired (when (looking-at "['`,#]*[[:alpha:]]*\\([({[\"]\\)")
(match-beginning 1))))
;; Go to the end of the sexp.
(goto-char (or (scan-sexps (or paired (point)) 1) end))
(unless
(and
;; The sexp is all on a single line.
(save-excursion (not (search-backward "\n" beg t)))
;; And its end is within `fill-column'.
(or (pp--within-fill-column-p)
;; If the end of the sexp is beyond `fill-column',
;; try to move the sexp to its own line.
(and
(save-excursion
(goto-char beg)
(if (save-excursion (skip-chars-backward " \t({[',")
(bolp))
;; The sexp was already on its own line.
nil
(skip-chars-backward " \t")
(setq beg (copy-marker beg t))
(if paired (setq paired (copy-marker paired t)))
;; We could try to undo this insertion if it
;; doesn't reduce the indentation depth, but I'm
;; not sure it's worth the trouble.
(insert "\n") (indent-according-to-mode)
t))
;; Check again if we moved the whole exp to a new line.
(pp--within-fill-column-p))))
;; The sexp is spread over several lines, and/or its end is
;; (still) beyond `fill-column'.
(when (and paired (not (eq ?\" (char-after paired))))
;; The sexp has sub-parts, so let's try and spread
;; them over several lines.
(save-excursion
(goto-char beg)
(when (looking-at "(\\([^][()\" \t\n;']+\\)")
;; Inside an expression of the form (SYM ARG1
;; ARG2 ... ARGn) where SYM has a `lisp-indent-function'
;; property that's a number, insert a newline after
;; the corresponding ARGi, because it tends to lead to
;; more natural and less indented code.
(let* ((sym (intern-soft (match-string 1)))
(lif (and sym (get sym 'lisp-indent-function))))
(if (eq lif 'defun) (setq lif 2))
(when (natnump lif)
(goto-char (match-end 0))
(forward-sexp lif)
(funcall newline)))))
(save-excursion
(pp-fill (1+ paired) (1- (point)))))
;; Now the sexp either ends beyond `fill-column' or is
;; spread over several lines (or both). Either way, the
;; rest of the line should be moved to its own line.
(funcall newline)))))))
;;;###autoload
(defun pp-buffer ()
"Prettify the current buffer with printed representation of a Lisp object."
(interactive)
(goto-char (point-min))
(while (not (eobp))
(cond
((ignore-errors (down-list 1) t)
(save-excursion
(backward-char 1)
(skip-chars-backward "'`#^")
(when (and (not (bobp)) (memq (char-before) '(?\s ?\t ?\n)))
(funcall pp-default-function (point-min) (point-max))
;; Preserve old behavior of (usually) finishing with a newline and
;; with point at BOB.
(goto-char (point-max))
(unless (bolp) (insert "\n"))
(goto-char (point-min)))
(defun pp-28 (beg &optional end) ;FIXME: Better name?
"Prettify the current region with printed representation of a Lisp object.
Uses the pretty-printing algorithm that was standard before Emacs-30.
Non-interactively can also be called with a single argument, in which
case that argument will be inserted pretty-printed at point."
(interactive "r")
(if (null end) (pp--object beg #'pp-29)
(save-restriction beg end
(goto-char (point-min))
(while (not (eobp))
(cond
((ignore-errors (down-list 1) t)
(save-excursion
(backward-char 1)
(skip-chars-backward "'`#^")
(when (and (not (bobp)) (memq (char-before) '(?\s ?\t ?\n)))
(delete-region
(point)
(progn (skip-chars-backward " \t\n") (point)))
(insert "\n"))))
((ignore-errors (up-list 1) t)
(skip-syntax-forward ")")
(delete-region
(point)
(progn (skip-chars-backward " \t\n") (point)))
(insert "\n"))))
((ignore-errors (up-list 1) t)
(skip-syntax-forward ")")
(delete-region
(point)
(progn (skip-chars-forward " \t\n") (point)))
(insert ?\n))
(t (goto-char (point-max)))))
(goto-char (point-min))
(indent-sexp))
(progn (skip-chars-forward " \t\n") (point)))
(insert ?\n))
(t (goto-char (point-max)))))
(goto-char (point-min))
(indent-sexp))))
;;;###autoload
(defun pp (object &optional stream)
@ -106,14 +281,20 @@ to make output that `read' can handle, whenever this is possible."
Quoting characters are printed as needed to make output that `read'
can handle, whenever this is possible.
This function does not apply special formatting rules for Emacs
Lisp code. See `pp-emacs-lisp-code' instead.
By default, this function won't limit the line length of lists
and vectors. Bind `pp-use-max-width' to a non-nil value to do so.
Uses the pretty-printing code specified in `pp-default-function'.
Output stream is STREAM, or value of `standard-output' (which see)."
(princ (pp-to-string object) (or stream standard-output)))
(cond
((and (eq (or stream standard-output) (current-buffer))
;; Make sure the current buffer is setup sanely.
(eq (syntax-table) emacs-lisp-mode-syntax-table)
(eq indent-line-function #'lisp-indent-line))
;; Skip the buffer->string->buffer middle man.
(funcall pp-default-function object)
;; Preserve old behavior of (usually) finishing with a newline.
(unless (bolp) (insert "\n")))
(t
(princ (pp-to-string object) (or stream standard-output)))))
;;;###autoload
(defun pp-display-expression (expression out-buffer-name &optional lisp)
@ -220,21 +401,24 @@ Ignores leading comment characters."
(pp-macroexpand-expression (pp-last-sexp))))
;;;###autoload
(defun pp-emacs-lisp-code (sexp)
(defun pp-emacs-lisp-code (sexp &optional end)
"Insert SEXP into the current buffer, formatted as Emacs Lisp code.
Use the `pp-max-width' variable to control the desired line length.
Note that this could be slow for large SEXPs."
Note that this could be slow for large SEXPs.
Can also be called with two arguments, in which case they're taken to be
the bounds of a region containing Lisp code to pretty-print."
(require 'edebug)
(let ((obuf (current-buffer)))
(with-temp-buffer
(emacs-lisp-mode)
(pp--insert-lisp sexp)
(insert "\n")
(goto-char (point-min))
(indent-sexp)
(while (re-search-forward " +$" nil t)
(replace-match ""))
(insert-into-buffer obuf))))
(if end (pp--region sexp end #'pp-emacs-lisp-code)
(let ((obuf (current-buffer)))
(with-temp-buffer
(emacs-lisp-mode)
(pp--insert-lisp sexp)
(insert "\n")
(goto-char (point-min))
(indent-sexp)
(while (re-search-forward " +$" nil t)
(replace-match ""))
(insert-into-buffer obuf)))))
(defun pp--insert-lisp (sexp)
(cl-case (type-of sexp)

View file

@ -8331,11 +8331,10 @@ url is put as the `gnus-button-url' overlay property on the button."
(when (looking-at "\\([A-Za-z]+\\):")
(setq scheme (match-string 1))
(goto-char (match-end 0)))
(when (looking-at "//\\([^:/]+\\)\\(:?\\)\\([0-9]+\\)?/")
(when (looking-at "//\\([^:/]+\\):?\\([0-9]+\\)?/")
(setq server (match-string 1))
(setq port (if (stringp (match-string 3))
(string-to-number (match-string 3))
(match-string 3)))
(setq port (and (match-beginning 2)
(string-to-number (match-string 2))))
(goto-char (match-end 0)))
(cond

View file

@ -2428,7 +2428,12 @@ narrowed.
(fn &optional BUFFER)" t)
(autoload 'browse-url-of-dired-file "browse-url" "\
In Dired, ask a WWW browser to display the file named on this line." t)
In Dired, ask a WWW browser to display the file named on this line.
With prefix arg, use the secondary browser instead (e.g. EWW if
`browse-url-secondary-browser-function' is set to
`eww-browse-url'.
(fn &optional SECONDARY)" t)
(autoload 'browse-url-of-region "browse-url" "\
Use a web browser to display the current region.
See `browse-url' for details.
@ -2918,6 +2923,11 @@ and corresponding effects.
(register-definition-prefixes "semantic/bovine/c" '("semantic"))
;;; Generated autoloads from progmodes/c-ts-common.el
(register-definition-prefixes "c-ts-common" '("c-ts-common-"))
;;; Generated autoloads from progmodes/c-ts-mode.el
@ -4919,6 +4929,16 @@ The variable `native-comp-async-jobs-number' specifies the number
of (commands) to run simultaneously.
(fn FILES &optional RECURSIVELY LOAD SELECTOR)")
(autoload 'comp-function-type-spec "comp" "\
Return the type specifier of FUNCTION.
This function returns a cons cell whose car is the function
specifier, and cdr is a symbol, either `inferred' or `know'.
If the symbol is `inferred', the type specifier is automatically
inferred from the code itself by the native compiler; if it is
`know', the type specifier comes from `comp-known-type-specifiers'.
(fn FUNCTION)")
(register-definition-prefixes "comp" '("comp-" "make-comp-edge" "native-" "no-native-compile"))
@ -7274,7 +7294,7 @@ the context menu will contain an item that searches
the word at mouse click.
(fn MENU CLICK)")
(register-definition-prefixes "dictionary" '("dictionary-" "global-dictionary-tooltip-mode"))
(register-definition-prefixes "dictionary" '("dictionary-" "global-dictionary-tooltip-mode" "help-word"))
;;; Generated autoloads from cedet/srecode/dictionary.el
@ -9225,7 +9245,7 @@ Turn on EDT Emulation." t)
;;; Generated autoloads from progmodes/eglot.el
(push (purecopy '(eglot 1 14)) package--builtin-versions)
(push (purecopy '(eglot 1 15)) package--builtin-versions)
(autoload 'eglot "eglot" "\
Start LSP server for PROJECT's buffers under MANAGED-MAJOR-MODES.
@ -9269,6 +9289,11 @@ INTERACTIVE is ignored and provided for backward compatibility.
(fn MANAGED-MAJOR-MODES PROJECT CLASS CONTACT LANGUAGE-IDS &optional INTERACTIVE)" t)
(autoload 'eglot-ensure "eglot" "\
Start Eglot session for current buffer if there isn't one.")
(autoload 'eglot-upgrade-eglot "eglot" "\
Update Eglot to latest version.
(fn &rest _)" t)
(define-obsolete-function-alias 'eglot-update 'eglot-upgrade-eglot "29.1")
(put 'eglot-workspace-configuration 'safe-local-variable 'listp)
(put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t)
(defun eglot--debbugs-or-github-bug-uri nil (format (if (string= (match-string 2) "github") "https://github.com/joaotavora/eglot/issues/%s" "https://debbugs.gnu.org/%s") (match-string 3)))
@ -9522,6 +9547,15 @@ optional prefix argument REINIT is non-nil.
(fn &optional REINIT)" t)
(register-definition-prefixes "elint" '("elint-"))
;;; Generated autoloads from progmodes/elixir-ts-mode.el
(autoload 'elixir-ts-mode "elixir-ts-mode" "\
Major mode for editing Elixir, powered by tree-sitter.
(fn)" t)
(register-definition-prefixes "elixir-ts-mode" '("elixir-ts-"))
;;; Generated autoloads from emacs-lisp/elp.el
@ -11327,7 +11361,7 @@ fourth arg NOSEP non-nil inhibits this.
;;; Generated autoloads from net/eww.el
(defvar eww-suggest-uris '(eww-links-at-point thing-at-point-url-at-point eww-current-url) "\
(defvar eww-suggest-uris '(eww-links-at-point thing-at-point-url-at-point eww-current-url eww-bookmark-urls) "\
List of functions called to form the list of default URIs for `eww'.
Each of the elements is a function returning either a string or a list
of strings. The results will be joined into a single list with
@ -15114,6 +15148,15 @@ Prefix arg sets default accept amount temporarily.
(fn &optional ARG)" t)
(register-definition-prefixes "hashcash" '("hashcash-"))
;;; Generated autoloads from progmodes/heex-ts-mode.el
(autoload 'heex-ts-mode "heex-ts-mode" "\
Major mode for editing HEEx, powered by tree-sitter.
(fn)" t)
(register-definition-prefixes "heex-ts-mode" '("heex-ts-"))
;;; Generated autoloads from help-at-pt.el
@ -16284,6 +16327,15 @@ values.
(register-definition-prefixes "semantic/html" '("semantic-"))
;;; Generated autoloads from textmodes/html-ts-mode.el
(autoload 'html-ts-mode "html-ts-mode" "\
Major mode for editing Html, powered by tree-sitter.
(fn)" t)
(register-definition-prefixes "html-ts-mode" '("html-ts-mode-"))
;;; Generated autoloads from htmlfontify.el
@ -20684,15 +20736,17 @@ Uppercasify ARG chars starting from point. Point doesn't move.
(fn ARG)" t)
(autoload 'forward-to-word "misc" "\
Move forward until encountering the beginning of a word.
With argument, do this that many times.
Move forward until encountering the beginning of the ARGth word.
ARG defaults to 1. When called interactively, ARG is the prefix
numeric argument.
(fn ARG)" t)
(fn &optional ARG)" t)
(autoload 'backward-to-word "misc" "\
Move backward until encountering the end of a word.
With argument, do this that many times.
Move backward until encountering the end of the ARGth word.
ARG defaults to 1. When called interactively, ARG is the prefix
numeric argument.
(fn ARG)" t)
(fn &optional ARG)" t)
(autoload 'butterfly "misc" "\
Use butterflies to flip the desired bit on the drive platter.
Open hands and let the delicate wings flap once. The disturbance
@ -22454,7 +22508,7 @@ Coloring:
;;; Generated autoloads from org/org.el
(push (purecopy '(org 9 6 4)) package--builtin-versions)
(push (purecopy '(org 9 6 6)) package--builtin-versions)
(autoload 'org-babel-do-load-languages "org" "\
Load the languages defined in `org-babel-load-languages'.
@ -23463,15 +23517,21 @@ upgrading of built-in packages, as if `package-install-upgrade-built-in'
had been enabled.
(fn PKG &optional DONT-SELECT)" t)
(autoload 'package-update "package" "\
Update package NAME if a newer version exists.
(autoload 'package-upgrade "package" "\
Upgrade package NAME if a newer version exists.
(fn NAME)" t)
(autoload 'package-update-all "package" "\
(autoload 'package-upgrade-all "package" "\
Refresh package list and upgrade all packages.
If QUERY, ask the user before updating packages. When called
If QUERY, ask the user before upgrading packages. When called
interactively, QUERY is always true.
Currently, packages which are part of the Emacs distribution are
not upgraded by this command. To enable upgrading such a package
using this command, first upgrade the package to a newer version
from ELPA by either using `\\[package-upgrade]' or
`\\<package-menu-mode-map>\\[package-menu-mark-install]' after `\\[list-packages]'.
(fn &optional QUERY)" t)
(autoload 'package-install-from-buffer "package" "\
Install a package from the current buffer.
@ -23556,10 +23616,10 @@ DESC must be a `package-desc' object.
(autoload 'package-vc-install-selected-packages "package-vc" "\
Ensure packages specified in `package-vc-selected-packages' are installed." t)
(autoload 'package-vc-update-all "package-vc" "\
Attempt to update all installed VC packages." t)
(autoload 'package-vc-update "package-vc" "\
Attempt to update the package PKG-DESC.
(autoload 'package-vc-upgrade-all "package-vc" "\
Attempt to upgrade all installed VC packages." t)
(autoload 'package-vc-upgrade "package-vc" "\
Attempt to upgrade the package PKG-DESC.
(fn PKG-DESC)" t)
(autoload 'package-vc-install "package-vc" "\
@ -23575,11 +23635,13 @@ indicating the package name and SPEC is a plist as described in
symbol whose name is the package name, and the URL for the
package will be taken from the package's metadata.
By default, this function installs the last version of the package
available from its repository, but if REV is given and non-nil, it
specifies the revision to install. If REV has the special value
`:last-release' (interactively, the prefix argument), that stands
for the last released version of the package.
By default, this function installs the last revision of the
package available from its repository. If REV is a string, it
describes the revision to install, as interpreted by the VC
backend. The special value `:last-release' (interactively, the
prefix argument), will use the commit of the latest release, if
it exists. The last release is the latest revision which changed
the \"Version:\" header of the package's main Lisp file.
Optional argument BACKEND specifies the VC backend to use for cloning
the package's repository; this is only possible if NAME-OR-URL is a URL,
@ -23616,7 +23678,7 @@ Rebuilding an installation means scraping for new autoload
cookies, re-compiling Emacs Lisp files, building and installing
any documentation, downloading any missing dependencies. This
command does not fetch new revisions from a remote server. That
is the responsibility of `package-vc-update'. Interactively,
is the responsibility of `package-vc-upgrade'. Interactively,
prompt for the name of the package to rebuild.
(fn PKG-DESC)" t)
@ -23671,7 +23733,9 @@ The values returned are identical to those of `decode-time', but
any unknown values other than DST are returned as nil, and an
unknown DST value is returned as -1.
(fn STRING)")
See `decode-time' for the meaning of FORM.
(fn STRING &optional FORM)")
(register-definition-prefixes "parse-time" '("parse-"))
@ -24504,7 +24568,7 @@ Create a plstore instance associated with FILE.
(fn FILE)")
(autoload 'plstore-mode "plstore" "\
Major mode for editing PLSTORE files.
Major mode for editing plstore files.
(fn)" t)
(register-definition-prefixes "plstore" '("plstore-"))
@ -25210,6 +25274,11 @@ See the doc string of `project-find-functions' for the general form
of the project instance object.
(fn &optional MAYBE-PROMPT DIRECTORY)")
(put 'project-vc-ignores 'safe-local-variable #'listp)
(put 'project-vc-merge-submodules 'safe-local-variable #'booleanp)
(put 'project-vc-include-untracked 'safe-local-variable #'booleanp)
(put 'project-vc-name 'safe-local-variable #'stringp)
(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (not (memq nil (mapcar #'stringp val))))))
(defvar project-prefix-map (let ((map (make-sparse-keymap))) (define-key map "!" 'project-shell-command) (define-key map "&" 'project-async-shell-command) (define-key map "f" 'project-find-file) (define-key map "F" 'project-or-external-find-file) (define-key map "b" 'project-switch-to-buffer) (define-key map "s" 'project-shell) (define-key map "d" 'project-find-dir) (define-key map "D" 'project-dired) (define-key map "v" 'project-vc-dir) (define-key map "c" 'project-compile) (define-key map "e" 'project-eshell) (define-key map "k" 'project-kill-buffers) (define-key map "p" 'project-switch-project) (define-key map "g" 'project-find-regexp) (define-key map "G" 'project-or-external-find-regexp) (define-key map "r" 'project-query-replace-regexp) (define-key map "x" 'project-execute-extended-command) (define-key map "\2" 'project-list-buffers) map) "\
Keymap for project commands.")
(define-key ctl-x-map "p" project-prefix-map)
@ -25359,6 +25428,7 @@ start with a space (which are for internal use). With prefix argument
ARG, show only buffers that are visiting files.
(fn &optional ARG)" t)
(put 'project-kill-buffers-display-buffer-list 'safe-local-variable #'booleanp)
(autoload 'project-kill-buffers "project" "\
Kill the buffers belonging to the current project.
Two buffers belong to the same project if their project
@ -26033,7 +26103,7 @@ ENCRYPTION, CERTFP, SERVER-ALIAS are interpreted as in
`rcirc-server-alist'. STARTUP-CHANNELS is a list of channels
that are joined after authentication.
(fn SERVER &optional PORT NICK USER-NAME FULL-NAME STARTUP-CHANNELS PASSWORD ENCRYPTION CERTFP SERVER-ALIAS)")
(fn SERVER &optional PORT NICK USER-NAME FULL-NAME STARTUP-CHANNELS PASSWORD ENCRYPTION SERVER-ALIAS CERTFP)")
(defvar rcirc-track-minor-mode nil "\
Non-nil if Rcirc-Track minor mode is enabled.
See the `rcirc-track-minor-mode' command
@ -26497,6 +26567,8 @@ This means the number of non-shy regexp grouping constructs
(parenthesized expressions) in REGEXP.
(fn REGEXP)")
(function-put 'regexp-opt-depth 'pure 't)
(function-put 'regexp-opt-depth 'side-effect-free 't)
(register-definition-prefixes "regexp-opt" '("regexp-opt-"))
@ -27433,6 +27505,16 @@ Major mode for editing Ruby code.
(dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8")) (add-to-list 'interpreter-mode-alist (cons (purecopy name) 'ruby-mode)))
(register-definition-prefixes "ruby-mode" '("ruby-"))
;;; Generated autoloads from progmodes/ruby-ts-mode.el
(push (purecopy '(ruby-ts-mode 0 2)) package--builtin-versions)
(autoload 'ruby-ts-mode "ruby-ts-mode" "\
Major mode for editing Ruby, powered by tree-sitter.
(fn)" t)
(register-definition-prefixes "ruby-ts-mode" '("ruby-ts-"))
;;; Generated autoloads from ruler-mode.el
@ -27481,6 +27563,7 @@ group.
For extending the `rx' notation in FORM, use `rx-define' or `rx-let-eval'.
(fn FORM &optional NO-GROUP)")
(function-put 'rx-to-string 'important-return-value 't)
(autoload 'rx "rx" "\
Translate regular expressions REGEXPS in sexp form to a regexp string.
Each argument is one of the forms below; RX is a subform, and RX... stands
@ -29240,7 +29323,7 @@ it is disabled.
;;; Generated autoloads from net/soap-client.el
(push (purecopy '(soap-client 3 2 1)) package--builtin-versions)
(push (purecopy '(soap-client 3 2 3)) package--builtin-versions)
(register-definition-prefixes "soap-client" '("soap-"))
@ -30313,6 +30396,7 @@ single space character, and leading/trailing whitespace is
removed.
(fn STRING)")
(function-put 'string-clean-whitespace 'important-return-value 't)
(autoload 'named-let "subr-x" "\
Looping construct taken from Scheme.
Like `let', bind variables in BINDINGS and then evaluate BODY,
@ -30326,6 +30410,7 @@ as the new values of the bound variables in the recursive invocation.
Return the width of STRING in pixels.
(fn STRING)")
(function-put 'string-pixel-width 'important-return-value 't)
(autoload 'string-glyph-split "subr-x" "\
Split STRING into a list of strings representing separate glyphs.
This takes into account combining characters and grapheme clusters:
@ -30334,6 +30419,7 @@ on display into a single grapheme cluster is treated as a single
indivisible unit.
(fn STRING)")
(function-put 'string-glyph-split 'side-effect-free 't)
(autoload 'add-display-text-property "subr-x" "\
Add display property PROP with VALUE to the text from START to END.
If any text in the region has a non-nil `display' property, those
@ -30347,7 +30433,7 @@ this defaults to the current buffer.
Query the user for a process and return the process object.
(fn PROMPT)")
(register-definition-prefixes "subr-x" '("emacs-etc--hide-local-variables" "hash-table-" "internal--thread-argument" "replace-region-contents" "string-" "thread-" "with-buffer-unmodified-if-unchanged"))
(register-definition-prefixes "subr-x" '("emacs-etc--hide-local-variables" "eval-command-interactive-spec" "hash-table-" "internal--thread-argument" "replace-region-contents" "string-" "thread-" "with-buffer-unmodified-if-unchanged"))
;;; Generated autoloads from progmodes/subword.el
@ -31762,7 +31848,7 @@ Entering Texinfo mode calls the value of `text-mode-hook', and then the
value of `texinfo-mode-hook'.
(fn)" t)
(register-definition-prefixes "texinfo" '("texinfo-"))
(register-definition-prefixes "texinfo" '("fill-paragraph-separate" "texinfo-"))
;;; Generated autoloads from textmodes/texnfo-upd.el
@ -32906,8 +32992,9 @@ Build and install the tree-sitter language grammar library for LANG.
Interactively, if `treesit-language-source-alist' doesn't already
have data for building the grammar for LANG, prompt for its
repository URL and the C/C++ compiler to use. Non-interactively,
signal an error when there's no recipe for LANG.
repository URL and the C/C++ compiler to use. The recipe built
by the prompts are saved for the current session if the
installation is successful and the grammar is loadable.
This command requires Git, a C compiler and (sometimes) a C++ compiler,
and the linker to be installed and on PATH. It also requires that the
@ -33993,6 +34080,8 @@ Usage:
:custom-face Call `custom-set-faces' with each face definition.
:ensure Loads the package using package.el if necessary.
:pin Pin the package to an archive.
:vc Install the package directly from a version control system
(using `package-vc.el').
(fn NAME &rest ARGS)" nil t)
(function-put 'use-package 'lisp-indent-function 'defun)
@ -34362,35 +34451,58 @@ Visit the next conflicted file in the current project." t)
(autoload 'vc-create-tag "vc" "\
Descending recursively from DIR, make a tag called NAME.
For each registered file, the working revision becomes part of
the named configuration. If the prefix argument BRANCHP is
given, the tag is made as a new branch and the files are
checked out in that new branch.
the configuration identified by the tag.
If BRANCHP is non-nil (interactively, the prefix argument), the
tag NAME is a new branch, and the files are checked out and
updated to reflect their revisions on that branch.
In interactive use, DIR is `default-directory' for repository-granular
VCSes (all the modern decentralized VCSes belong to this group),
otherwise the command will prompt for DIR.
(fn DIR NAME BRANCHP)" t)
(autoload 'vc-create-branch "vc" "\
Descending recursively from DIR, make a branch called NAME.
After a new branch is made, the files are checked out in that new branch.
Uses `vc-create-tag' with the non-nil arg `branchp'.
Make a branch called NAME in directory DIR.
After making the new branch, check out the branch, i.e. update the
files in the tree to their revisions on the branch.
Interactively, prompt for the NAME of the branch.
With VCSes that maintain version information per file, this command also
prompts for the directory DIR whose files, recursively, will be tagged
with the NAME of new branch. For VCSes that maintain version
information for the entire repository (all the modern decentralized
VCSes belong to this group), DIR is always the `default-directory'.
Finally, this command might prompt for the branch or tag from which to
start (\"fork\") the new branch, with completion candidates including
all the known branches and tags in the repository.
This command invokes `vc-create-tag' with the non-nil BRANCHP argument.
(fn DIR NAME)" t)
(autoload 'vc-retrieve-tag "vc" "\
For each file in or below DIR, retrieve their tagged version NAME.
For each file in or below DIR, retrieve their version identified by tag NAME.
NAME can name a branch, in which case this command will switch to the
named branch in the directory DIR.
Interactively, prompt for DIR only for VCS that works at file level;
otherwise use the repository root of the current buffer.
otherwise use the root directory of the current buffer's VC tree.
If NAME is empty, it refers to the latest revisions of the current branch.
If locking is used for the files in DIR, then there must not be any
locked files at or below DIR (but if NAME is empty, locked files are
allowed and simply skipped).
If the prefix argument BRANCHP is given, switch the branch
and check out the files in that branch.
If BRANCHP is non-nil (interactively, the prefix argument), switch to the
branch and check out and update the files to their version on that branch.
This function runs the hook `vc-retrieve-tag-hook' when finished.
(fn DIR NAME &optional BRANCHP)" t)
(autoload 'vc-switch-branch "vc" "\
Switch to the branch NAME in the directory DIR.
If NAME is empty, it refers to the latest revisions of the current branch.
If NAME is empty, it refers to the latest revision of the current branch.
Interactively, prompt for DIR only for VCS that works at file level;
otherwise use the root directory of the current buffer's VC tree.
Interactively, prompt for the NAME of the branch.
After switching to the branch, check out and update the files to their
version on that branch.
Uses `vc-retrieve-tag' with the non-nil arg `branchp'.
(fn DIR NAME)" t)
@ -34423,7 +34535,8 @@ with its diffs (if the underlying VCS backend supports that).
(fn &optional LIMIT REVISION)" t)
(autoload 'vc-print-branch-log "vc" "\
Show the change log for BRANCH root in a window.
Show the change log for BRANCH in another window.
The command prompts for the branch whose change log to show.
(fn BRANCH)" t)
(autoload 'vc-log-incoming "vc" "\
@ -34844,7 +34957,7 @@ Key bindings:
;;; Generated autoloads from progmodes/verilog-mode.el
(push (purecopy '(verilog-mode 2022 12 18 181110314)) package--builtin-versions)
(push (purecopy '(verilog-mode 2023 6 6 141322628)) package--builtin-versions)
(autoload 'verilog-mode "verilog-mode" "\
Major mode for editing Verilog code.
\\<verilog-mode-map>
@ -37161,57 +37274,15 @@ run a specific program. The program must be a member of
(fn &optional PGM)" t)
(register-definition-prefixes "zone" '("zone-"))
;;; Generated autoloads from progmodes/ruby-ts-mode.el
(push (purecopy '(ruby-ts-mode 0 2)) package--builtin-versions)
(autoload 'ruby-ts-mode "ruby-ts-mode" "\
Major mode for editing Ruby, powered by tree-sitter.
(fn)" t)
(register-definition-prefixes "ruby-ts-mode" '("ruby-ts-"))
;;; Generated autoloads from textmodes/html-ts-mode.el
(autoload 'html-ts-mode "html-ts-mode" "\
Major mode for editing Html, powered by tree-sitter.
(fn)" t)
(register-definition-prefixes "html-ts-mode" '("html-ts-mode-"))
;;; Generated autoloads from progmodes/c-ts-common.el
(register-definition-prefixes "c-ts-common" '("c-ts-common-"))
;;; Generated autoloads from progmodes/elixir-ts-mode.el
(autoload 'elixir-ts-mode "elixir-ts-mode" "\
Major mode for editing Elixir, powered by tree-sitter.
(fn)" t)
(register-definition-prefixes "elixir-ts-mode" '("elixir-ts-"))
;;; Generated autoloads from progmodes/heex-ts-mode.el
(autoload 'heex-ts-mode "heex-ts-mode" "\
Major mode for editing HEEx, powered by tree-sitter.
(fn)" t)
(register-definition-prefixes "heex-ts-mode" '("heex-ts-"))
;;; End of scraped data
(provide 'loaddefs)
;; Local Variables:
;; no-byte-compile: t
;; version-control: never
;; no-update-autoloads: t
;; no-byte-compile: t
;; no-native-compile: t
;; coding: utf-8-emacs-unix
;; End:

View file

@ -1355,7 +1355,7 @@ recommended to enable `electric-pair-mode' with this mode."
"\\|" id "::"
"\\|" id ws-maybe "=\\)"
"\\|" "\\(?:inline" ws "\\)?namespace"
"\\(:?" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{"
"\\(?:" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{"
"\\|" "class" ws id
"\\(?:" ws "final" "\\)?" ws-maybe "[:{;\n]"
"\\|" "struct" ws id "\\(?:" ws "final" ws-maybe "[:{\n]"

View file

@ -739,11 +739,11 @@ When non-nil, this variable should end in \"\\\\\\==\". Note that
such a backward search will match a minimal string, so a
\"context character\" is probably needed at the start of the
regexp. The value for csharp-mode would be something like
\"\\\\(:?\\\\`\\\\|[^\\\"]\\\\)\\\"*\\\\\\==\"."
\"\\\\(?:\\\\`\\\\|[^\\\"]\\\\)\\\"*\\\\\\==\"."
t nil
pike "\\(:?\\`\\|[^\\\"]\\)\\(:?\\\\.\\)*\\="
pike "\\(?:\\`\\|[^\\\"]\\)\\(?:\\\\.\\)*\\="
;;pike ;; 2
;; "\\(:?\\`\\|[^\"]\\)\"*\\="
;; "\\(?:\\`\\|[^\"]\\)\"*\\="
)
(c-lang-defvar c-ml-string-back-closer-re
(c-lang-const c-ml-string-back-closer-re))

View file

@ -2863,7 +2863,7 @@ Key bindings:
"\\|" id "::"
"\\|" id ws-maybe "=\\)"
"\\|" "\\(?:inline" ws "\\)?namespace"
"\\(:?" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{"
"\\(?:" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{"
"\\|" "class" ws id
"\\(?:" ws "final" "\\)?" ws-maybe "[:{;\n]"
"\\|" "struct" ws id "\\(?:" ws "final" ws-maybe "[:{\n]"

View file

@ -168,7 +168,7 @@ the available version of Tree-sitter for java."
:override t
:feature 'constant
`(((identifier) @font-lock-constant-face
(:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face))
(:match "\\`[A-Z_][0-9A-Z_]*\\'" @font-lock-constant-face))
[(true) (false)] @font-lock-constant-face)
:language 'java
:override t

View file

@ -106,7 +106,7 @@ name.")
(defconst js--plain-method-re
(concat "^\\s-*?\\(" js--dotted-name-re "\\)\\.prototype"
"\\.\\(" js--name-re "\\)\\s-*?=\\s-*?\\(\\(:?async[ \t\n]+\\)function\\)\\_>")
"\\.\\(" js--name-re "\\)\\s-*?=\\s-*?\\(\\(?:async[ \t\n]+\\)function\\)\\_>")
"Regexp matching an explicit JavaScript prototype \"method\" declaration.
Group 1 is a (possibly-dotted) class name, group 2 is a method name,
and group 3 is the `function' keyword.")
@ -3493,7 +3493,7 @@ This function is intended for use in `after-change-functions'."
:language 'javascript
:feature 'constant
'(((identifier) @font-lock-constant-face
(:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face))
(:match "\\`[A-Z_][0-9A-Z_]*\\'" @font-lock-constant-face))
[(true) (false) (null)] @font-lock-constant-face)
@ -3612,7 +3612,7 @@ This function is intended for use in `after-change-functions'."
:feature 'number
'((number) @font-lock-number-face
((identifier) @font-lock-number-face
(:match "\\`\\(:?NaN\\|Infinity\\)\\'" @font-lock-number-face)))
(:match "\\`\\(?:NaN\\|Infinity\\)\\'" @font-lock-number-face)))
:language 'javascript
:feature 'operator

View file

@ -1021,7 +1021,7 @@ leading double colon is not added."
(:match "\\`\\$[#\"'`:?]" @global_var))
;; ?' ?" ?` are character literals.
((character) @char
(:match "\\`?[#\"'`:?]" @char))
(:match "\\`\\?[#\"'`:?]" @char))
;; Symbols like :+, :<=> or :foo=.
((simple_symbol) @symbol
(:match "\\s." @symbol))

View file

@ -143,7 +143,7 @@
eol))
@font-lock-builtin-face)))
((identifier) @font-lock-type-face
(:match "\\`\\(:?Err\\|Ok\\|None\\|Some\\)\\'" @font-lock-type-face)))
(:match "\\`\\(?:Err\\|Ok\\|None\\|Some\\)\\'" @font-lock-type-face)))
:language 'rust
:feature 'comment
@ -232,9 +232,12 @@
(type_identifier) @font-lock-type-face
((scoped_identifier name: (identifier) @rust-ts-mode--fontify-tail))
((scoped_identifier path: (identifier) @font-lock-type-face)
(:match
"\\`\\(u8\\|u16\\|u32\\|u64\\|u128\\|usize\\|i8\\|i16\\|i32\\|i64\\|i128\\|isize\\|char\\|str\\)\\'"
@font-lock-type-face))
(:match ,(rx bos
(or "u8" "u16" "u32" "u64" "u128" "usize"
"i8" "i16" "i32" "i64" "i128" "isize"
"char" "str")
eos)
@font-lock-type-face))
((scoped_identifier path: (identifier) @rust-ts-mode--fontify-scope))
((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope))
(type_identifier) @font-lock-type-face)
@ -249,7 +252,7 @@
:feature 'constant
`((boolean_literal) @font-lock-constant-face
((identifier) @font-lock-constant-face
(:match "\\`[A-Z][A-Z\\d_]*\\'" @font-lock-constant-face)))
(:match "\\`[A-Z][0-9A-Z_]*\\'" @font-lock-constant-face)))
:language 'rust
:feature 'variable

View file

@ -153,7 +153,7 @@ Argument LANGUAGE is either `typescript' or `tsx'."
:language language
:feature 'constant
`(((identifier) @font-lock-constant-face
(:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face))
(:match "\\`[A-Z_][0-9A-Z_]*\\'" @font-lock-constant-face))
[(true) (false) (null)] @font-lock-constant-face)
:language language
@ -311,7 +311,7 @@ Argument LANGUAGE is either `typescript' or `tsx'."
:feature 'number
`((number) @font-lock-number-face
((identifier) @font-lock-number-face
(:match "\\`\\(:?NaN\\|Infinity\\)\\'" @font-lock-number-face)))
(:match "\\`\\(?:NaN\\|Infinity\\)\\'" @font-lock-number-face)))
:language language
:feature 'operator

View file

@ -1723,14 +1723,19 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"."
(declare-function vc-annotate-convert-time "vc-annotate" (&optional time))
(autoload 'decoded-time-set-defaults "time-date")
(autoload 'iso8601-parse "iso8601")
(defun vc-git-annotate-time ()
(and (re-search-forward "^[0-9a-f^]+[^()]+(.*?\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\(:?\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\)\\)? *[0-9]+) " nil t)
(vc-annotate-convert-time
(apply #'encode-time (mapcar (lambda (match)
(if (match-beginning match)
(string-to-number (match-string match))
0))
'(6 5 4 3 2 1 7))))))
(and (re-search-forward "^[0-9a-f^]+[^()]+(.*?\\([0-9]+-[0-9]+-[0-9]+\\)\\(?: \\([0-9]+:[0-9]+:[0-9]+\\) \\([-+0-9]+\\)\\)? +[0-9]+) " nil t)
(let* ((dt (match-string 1))
(dt (if (not (match-beginning 2)) dt
;; Format as ISO 8601.
(concat dt "T" (match-string 2) (match-string 3))))
(decoded (ignore-errors (iso8601-parse dt))))
(and decoded
(vc-annotate-convert-time
(encode-time (decoded-time-set-defaults decoded)))))))
(defun vc-git-annotate-extract-revision-at-line ()
(save-excursion

View file

@ -2312,7 +2312,8 @@ treesit_query_string_string (Lisp_Object str)
for (ptrdiff_t i = 0; i < nbytes; i++)
{
unsigned char c = SREF (str, i);
escapes += (c == '\0' || c == '\n' || c == '\r' || c == '\t' || c == '"');
escapes += (c == '\0' || c == '\n' || c == '\r' || c == '\t'
|| c == '"' || c == '\\');
}
ptrdiff_t nchars = SCHARS (str);
ptrdiff_t extra = escapes + 2; /* backslashes + double quotes */
@ -2331,7 +2332,8 @@ treesit_query_string_string (Lisp_Object str)
case '\n': *d++ = '\\'; *d++ = 'n'; break;
case '\r': *d++ = '\\'; *d++ = 'r'; break;
case '\t': *d++ = '\\'; *d++ = 't'; break;
case '"': *d++ = '\\'; *d++ = '"'; break;
case '"':
case '\\': *d++ = '\\'; *d++ = c; break;
default: *d++ = c; break;
}
}

View file

@ -226,6 +226,9 @@
"Forms in backtrace frames can be on a single line or on multiple lines."
(ert-with-test-buffer (:name "single-multi-line")
(let* ((arg '(lambda (x) ; Quote this so it isn't made into a closure.
;; Make the form long enough so `number' should not
;; appear on the first line once pretty-printed.
(interactive (region-beginning))
(let ((number (1+ x)))
(+ x number))))
(header-string "Test header: ")
@ -280,7 +283,8 @@ line contains the strings \"lambda\" and \"number\"."
;; Verify that the form is now back on one line,
;; and that point is at the same place.
(should (string= (backtrace-tests--get-substring
(- (point) 6) (point)) "number"))
(- (point) 6) (point))
"number"))
(should-not (= (point) (pos-bol)))
(should (string= (backtrace-tests--get-substring
(pos-bol) (1+ (pos-eol)))

View file

@ -23,8 +23,8 @@
(require 'ert-x)
(ert-deftest pp-print-quote ()
(should (string= (pp-to-string 'quote) "quote"))
(should (string= (pp-to-string ''quote) "'quote"))
(should (string= (pp-to-string 'quote) "quote\n"))
(should (string= (pp-to-string ''quote) "'quote\n"))
(should (string= (pp-to-string '('a 'b)) "('a 'b)\n"))
(should (string= (pp-to-string '(''quote 'quote)) "(''quote 'quote)\n"))
(should (string= (pp-to-string '(quote)) "(quote)\n"))

View file

@ -64,4 +64,21 @@
(actual-output (vc-git--program-version)))
(should (equal actual-output expected-output))))
(ert-deftest vc-git-test-annotate-time ()
"Test `vc-git-annotate-time'."
(require 'vc-annotate)
(with-temp-buffer
(insert "\
00000000 (Foo Bar 2023-06-14 1) a
00000001 (Foo Bar 2023-06-14 00:00:00 -0130 2) b
00000002 (Foo Bar 2023-06-14 00:00:00 +0145 3) c
00000003 (Foo Bar 2023-06-14 00:00:00 4) d
00000004 (Foo Bar 0-0-0 5) \n")
(goto-char (point-min))
(should (floatp (vc-git-annotate-time)))
(should (> (vc-git-annotate-time)
(vc-git-annotate-time)))
(should-not (vc-git-annotate-time))
(should-not (vc-git-annotate-time))))
;;; vc-git-tests.el ends here

View file

@ -465,8 +465,8 @@ BODY is the test body."
;; Test string conversion in `treesit-pattern-expand'.
(should (equal
(treesit-pattern-expand "a\nb\rc\td\0e\"f\1g")
"\"a\\nb\\rc\\td\\0e\\\"f\1g\"")))))
(treesit-pattern-expand "a\nb\rc\td\0e\"f\1g\\h\fi")
"\"a\\nb\\rc\\td\\0e\\\"f\1g\\\\h\fi\"")))))
;;; Narrow