mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 04:21:24 +00:00
Merge from origin/emacs-31
c3babe4b89Fix lax whitespace highlight during query-replace2e70b88623Fix fill-paragraph combining text with preceding commentea54c33950; * etc/PROBLEMS: Link to bug#81124.02897e208demacsclient quote_argument is voidc618178066; Mark process-test-stderr-buffer as :unstable when runni...2c1b45f5c5; Improve documentation of 'vc-dir-auto-hide-up-to-date'768c8bf004Revert "* admin/notes/documentation: Recommend not using ...a7414f1859native--compile-skip-on-battery-p: Try to fix ?b, ?B cond...7cee526a8cSave and restore original local keymap in grep-edit-mode4d87d203cfFix display of inline SVG images in Rmail4c55d04ebeAdd treesit-ready-p check back to tree-sitter major modes...7892ae5eafFix pathological slowness in flex completion12eec781edNo longer raise error on HTTP 402 (Payment Required) (bug...1800350b18Avoid compilation-mode matching rust as gnu
This commit is contained in:
commit
c7167f2a1e
34 changed files with 221 additions and 73 deletions
|
|
@ -106,7 +106,7 @@ For instance, this
|
|||
anywhere in sight is too confusing.
|
||||
|
||||
may not need mentioning, because --daemon will give an error message
|
||||
saying it is not implemented, and other cases aren't affected.
|
||||
saying it's not implemented, and other cases aren't affected.
|
||||
|
||||
The kind of change for which the user really needs help from Antinews
|
||||
is where a feature works _differently_ in the previous version.
|
||||
|
|
@ -164,5 +164,3 @@ like subr.el, which are not quoted.
|
|||
Call 'emacs-news-view-mode'. Lisp symbols and Info manual links shall
|
||||
be decorated, and clicking on them shall lead to the respective Help
|
||||
buffer or Info node.
|
||||
|
||||
*** Do not use "it's", "you're" and alike.
|
||||
|
|
|
|||
|
|
@ -1523,10 +1523,11 @@ on the current line if no files are marked.
|
|||
and their version control statuses. It lists files in the current
|
||||
directory (the one specified when you called @kbd{C-x v d}) and its
|
||||
subdirectories, but only those with a noteworthy status. Files
|
||||
that are up-to-date (i.e., the same as in the repository) are
|
||||
omitted. If all the files in a subdirectory are up-to-date, the
|
||||
that are up-to-date (i.e., the same as in the repository) or ignored
|
||||
are omitted. If all the files in a subdirectory are up-to-date, the
|
||||
subdirectory is not listed either. As an exception, if a file has
|
||||
become up-to-date as a direct result of a VC command, it is listed.
|
||||
become up-to-date as a direct result of a VC command, it is listed by
|
||||
default.
|
||||
|
||||
Here is an example of a VC Directory buffer listing:
|
||||
|
||||
|
|
@ -1565,6 +1566,16 @@ systems can show other statuses. For instance, CVS shows the
|
|||
been applied to the work file. RCS and SCCS show the name of the user
|
||||
locking a file as its status.
|
||||
|
||||
@vindex vc-dir-auto-hide-up-to-date
|
||||
As mentioned above, by default files and directories which become
|
||||
up-to-date or ignored after the VC Directory buffer is first displayed
|
||||
stay displayed. To automatically remove such files from display,
|
||||
customize the variable @code{vc-dir-auto-hide-up-to-date} to the value
|
||||
@code{t}. You can also customize it to the value @code{revert}, in
|
||||
which case such files will be removed only when you refresh the VC
|
||||
Directory display, e.g., by typing @kbd{g} (@pxref{VC Directory
|
||||
Commands}).
|
||||
|
||||
@ifnottex
|
||||
On CVS, the @code{vc-dir} command normally contacts the repository,
|
||||
which may be on a remote machine, to check for updates. If you change
|
||||
|
|
@ -1595,7 +1606,7 @@ cases Emacs must occasionally fetch from the remote repository in order
|
|||
to determine the count. If your connection to the remote repository is
|
||||
slow then this may cause unacceptable slowdowns in refreshing the VC
|
||||
Directory buffer. If this affects you, you can customize
|
||||
@code{vc-dir-show-outgoing-count} to nil to disable the unpushed
|
||||
@code{vc-dir-show-outgoing-count} to @code{nil} to disable the unpushed
|
||||
revisions count altogether. You can also set this on a per-repository
|
||||
basis using directory local variables (@pxref{Directory Variables}).
|
||||
|
||||
|
|
@ -1674,9 +1685,6 @@ the VC Directory buffer (@code{vc-dir-root-next-action}). This is like
|
|||
@w{@kbd{C-x v v}} (@pxref{Basic VC Editing}) except that it ignores any
|
||||
marks and the position of point.
|
||||
|
||||
@item q
|
||||
Quit the VC Directory buffer, and bury it (@code{quit-window}).
|
||||
|
||||
@item u
|
||||
Unmark the file or directory on the current line. If the region is
|
||||
active, unmark all the files in the region (@code{vc-dir-unmark}).
|
||||
|
|
@ -1691,6 +1699,12 @@ files and directories.
|
|||
Hide files with @samp{up-to-date} or @samp{ignored} status
|
||||
(@code{vc-dir-hide-up-to-date}). With a prefix argument, hide items
|
||||
whose state is that of the item at point.
|
||||
|
||||
@item g
|
||||
Refresh the VC Directory buffer display (@code{revert-buffer}).
|
||||
|
||||
@item q
|
||||
Quit the VC Directory buffer, and bury it (@code{quit-window}).
|
||||
@end table
|
||||
|
||||
@findex vc-dir-mark
|
||||
|
|
|
|||
|
|
@ -136,6 +136,9 @@ result in an endless loop.
|
|||
If you need Emacs to be able to recover from closing displays, compile
|
||||
it with the Lucid toolkit instead of GTK.
|
||||
|
||||
One possible mitigation for the problem is described in
|
||||
https://debbugs.gnu.org/81124
|
||||
|
||||
** Emacs compiled with GTK+ 3 crashes when run under some X servers.
|
||||
This happens when the X server does not provide certain display
|
||||
features that the underlying GTK+ 3 toolkit assumes. For example, this
|
||||
|
|
|
|||
|
|
@ -902,7 +902,7 @@ quote_argument_len (HSOCKET s, const char *str, ptrdiff_t len)
|
|||
static void
|
||||
quote_argument (HSOCKET s, const char *str)
|
||||
{
|
||||
return quote_argument_len (s, str, strlen (str));
|
||||
quote_argument_len (s, str, strlen (str));
|
||||
}
|
||||
|
||||
/* The inverse of quote_argument. Remove quoting in string STR by
|
||||
|
|
|
|||
|
|
@ -203,9 +203,10 @@ LOAD and SELECTOR work as described in `native--compile-async'."
|
|||
;; because power users often configure their batteries
|
||||
;; to stop charging at less than 100% as a way to
|
||||
;; extend the lifetime of their battery hardware.
|
||||
(string= (cdr (assq ?b res)) "+")
|
||||
(member (cdr (assq ?B res)) '("charging" "pending-charge"))
|
||||
(not (string= (cdr (assq ?B res)) "discharging")))))))
|
||||
;; Further discussion in bug#80922.
|
||||
(and (not (equal (cdr (assq ?b res)) "+"))
|
||||
(not (member (cdr (assq ?B res))
|
||||
'("charging" "pending-charge")))))))))
|
||||
|
||||
(defvar comp-files-queue ()
|
||||
"List of Emacs Lisp files to be compiled.")
|
||||
|
|
|
|||
|
|
@ -843,8 +843,11 @@ directly."
|
|||
((string-match "text/" content-type)
|
||||
(setq type 'text))
|
||||
((string-match "image/\\(.*\\)" content-type)
|
||||
(setq type (image-supported-file-p
|
||||
(concat "." (match-string 1 content-type))))
|
||||
(let ((fnext (match-string 1 content-type)))
|
||||
;; Ask about SVG support when Content-type is image/svg+xml.
|
||||
(if (equal fnext "svg+xml")
|
||||
(setq fnext "svg"))
|
||||
(setq type (image-supported-file-p (concat "." fnext))))
|
||||
(when (and type
|
||||
rmail-mime-show-images
|
||||
(not (eq rmail-mime-show-images 'button))
|
||||
|
|
|
|||
|
|
@ -5005,11 +5005,6 @@ usual. Returns (ALL PAT PREFIX SUFFIX)."
|
|||
(prefix (substring beforepoint 0 (car bounds)))
|
||||
(suffix (substring afterpoint (cdr bounds)))
|
||||
(pat2 (substring pat (car bounds) (+ point (cdr bounds))))
|
||||
(completion-regexp-list
|
||||
(cons (mapconcat (lambda (c) (regexp-quote (char-to-string c)))
|
||||
pat2
|
||||
".*")
|
||||
completion-regexp-list))
|
||||
(all (all-completions prefix table pred))
|
||||
(all
|
||||
(if (zerop (length pat2)) all
|
||||
|
|
|
|||
|
|
@ -1475,7 +1475,9 @@ in your init files, or customize `treesit-enabled-modes'."
|
|||
:group 'c
|
||||
:after-hook (c-ts-mode-set-modeline)
|
||||
|
||||
(when (treesit-ensure-installed 'c)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'c)
|
||||
(treesit-ready-p 'c))
|
||||
;; Create an "for-each" parser, see `c-ts-mode--emacs-set-ranges'
|
||||
;; for more.
|
||||
(when c-ts-mode-emacs-sources-support
|
||||
|
|
@ -1554,7 +1556,9 @@ recommended to enable `electric-pair-mode' with this mode."
|
|||
:group 'c++
|
||||
:after-hook (c-ts-mode-set-modeline)
|
||||
|
||||
(when (treesit-ensure-installed 'cpp)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'cpp)
|
||||
(treesit-ready-p 'cpp))
|
||||
(let ((primary-parser (treesit-parser-create 'cpp)))
|
||||
|
||||
;; Syntax.
|
||||
|
|
|
|||
|
|
@ -220,7 +220,9 @@ Return nil if there is no name or if NODE is not a defun node."
|
|||
:group 'cmake
|
||||
:syntax-table cmake-ts-mode--syntax-table
|
||||
|
||||
(when (treesit-ensure-installed 'cmake)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'cmake)
|
||||
(treesit-ready-p 'cmake))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'cmake))
|
||||
|
||||
;; Comments.
|
||||
|
|
|
|||
|
|
@ -421,6 +421,20 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
|
|||
nil
|
||||
(1 compilation-error-face))
|
||||
|
||||
;; This must precede the `gnu' rule or the latter would match instead.
|
||||
(rust
|
||||
,(rx bol (or (group-n 1 "error") (group-n 2 "warning") (group-n 3 "note"))
|
||||
(? "[" (+ (in "A-Z" "0-9")) "]") ":" (* nonl)
|
||||
"\n" (+ " ") "-->"
|
||||
" " (group-n 4 (+ nonl)) ; file
|
||||
":" (group-n 5 (+ (in "0-9"))) ; line
|
||||
":" (group-n 6 (+ (in "0-9")))) ; column
|
||||
4 5 6 (2 . 3)
|
||||
nil
|
||||
(1 compilation-error-face)
|
||||
(2 compilation-warning-face)
|
||||
(3 compilation-info-face))
|
||||
|
||||
;; Tested with Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT 2.1.
|
||||
(lua
|
||||
,(rx bol
|
||||
|
|
@ -582,19 +596,6 @@ during global destruction\\.$\\)" 1 2)
|
|||
"\\(?:Parse\\|Fatal\\) error: \\(.*\\) in \\(.*\\) on line \\([0-9]+\\)"
|
||||
2 3 nil nil)
|
||||
|
||||
(rust
|
||||
,(rx bol (or (group-n 1 "error") (group-n 2 "warning") (group-n 3 "note"))
|
||||
(? "[" (+ (in "A-Z" "0-9")) "]") ":" (* nonl)
|
||||
"\n" (+ " ") "-->"
|
||||
" " (group-n 4 (+ nonl)) ; file
|
||||
":" (group-n 5 (+ (in "0-9"))) ; line
|
||||
":" (group-n 6 (+ (in "0-9")))) ; column
|
||||
4 5 6 (2 . 3)
|
||||
nil
|
||||
(1 compilation-error-face)
|
||||
(2 compilation-warning-face)
|
||||
(3 compilation-info-face))
|
||||
|
||||
(rxp
|
||||
"^\\(?:Error\\|Warnin\\(g\\)\\):.*\n.* line \\([0-9]+\\) char\
|
||||
\\([0-9]+\\) of file://\\(.+\\)"
|
||||
|
|
|
|||
|
|
@ -167,7 +167,9 @@ Return nil if there is no name or if NODE is not a stage node."
|
|||
:group 'dockerfile
|
||||
:syntax-table dockerfile-ts-mode--syntax-table
|
||||
|
||||
(when (treesit-ensure-installed 'dockerfile)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'dockerfile)
|
||||
(treesit-ready-p 'dockerfile))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'dockerfile))
|
||||
|
||||
;; Comments.
|
||||
|
|
|
|||
|
|
@ -737,7 +737,9 @@ Return nil if NODE is not a defun node or doesn't have a name."
|
|||
(add-hook 'post-self-insert-hook
|
||||
#'elixir-ts--electric-pair-string-delimiter 'append t)
|
||||
|
||||
(when (treesit-ensure-installed 'elixir)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'elixir)
|
||||
(treesit-ready-p 'elixir))
|
||||
(setq-local treesit-primary-parser
|
||||
(treesit-parser-create 'elixir))
|
||||
|
||||
|
|
@ -762,7 +764,9 @@ Return nil if NODE is not a defun node or doesn't have a name."
|
|||
(setq-local treesit-defun-name-function #'elixir-ts--defun-name)
|
||||
|
||||
;; Embedded Heex.
|
||||
(when (treesit-ensure-installed 'heex)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'heex)
|
||||
(treesit-ready-p 'heex))
|
||||
(require 'heex-ts-mode)
|
||||
(treesit-parser-create 'heex)
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,9 @@
|
|||
:group 'go
|
||||
:syntax-table go-ts-mode--syntax-table
|
||||
|
||||
(when (treesit-ensure-installed 'go)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'go)
|
||||
(treesit-ready-p 'go))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'go))
|
||||
|
||||
;; Comments.
|
||||
|
|
@ -608,7 +610,9 @@ what the parent of the node would be if it were a node."
|
|||
:group 'go
|
||||
:syntax-table go-mod-ts-mode--syntax-table
|
||||
|
||||
(when (treesit-ensure-installed 'gomod)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'gomod)
|
||||
(treesit-ready-p 'gomod))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'gomod))
|
||||
|
||||
;; Comments.
|
||||
|
|
@ -712,7 +716,9 @@ what the parent of the node would be if it were a node."
|
|||
"Major mode for editing go.work files, powered by tree-sitter."
|
||||
:group 'go
|
||||
|
||||
(when (treesit-ensure-installed 'gowork)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'gowork)
|
||||
(treesit-ready-p 'gowork))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'gowork))
|
||||
|
||||
;; Comments.
|
||||
|
|
|
|||
|
|
@ -1120,6 +1120,8 @@ list is empty)."
|
|||
(defvar grep-edit-mode-hook nil
|
||||
"Hooks run when changing to Grep-Edit mode.")
|
||||
|
||||
(defvar grep-edit-original-mode-map nil)
|
||||
|
||||
(defun grep-edit-mode ()
|
||||
"Major mode for editing *grep* buffers.
|
||||
In this mode, changes to the *grep* buffer are applied to the
|
||||
|
|
@ -1140,6 +1142,7 @@ The only editable texts in a Grep-Edit buffer are the match results."
|
|||
(error "Not a Grep buffer"))
|
||||
(when (get-buffer-process (current-buffer))
|
||||
(error "Cannot switch when grep is running"))
|
||||
(setq-local grep-edit-original-mode-map (current-local-map))
|
||||
(use-local-map grep-edit-mode-map)
|
||||
(grep-edit--prepare-buffer)
|
||||
(setq buffer-read-only nil)
|
||||
|
|
@ -1159,7 +1162,7 @@ The only editable texts in a Grep-Edit buffer are the match results."
|
|||
(unless (derived-mode-p 'grep-edit-mode)
|
||||
(error "Not a Grep-Edit buffer"))
|
||||
(remove-hook 'after-change-functions #'occur-after-change-function t)
|
||||
(use-local-map grep-mode-map)
|
||||
(use-local-map grep-edit-original-mode-map)
|
||||
(setq buffer-read-only t)
|
||||
(setq major-mode 'grep-mode)
|
||||
(setq mode-name "Grep")
|
||||
|
|
|
|||
|
|
@ -201,7 +201,9 @@ Return nil if NODE is not a defun node or doesn't have a name."
|
|||
"Major mode for editing HEEx, powered by tree-sitter."
|
||||
:group 'heex-ts
|
||||
|
||||
(when (treesit-ensure-installed 'heex)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'heex)
|
||||
(treesit-ready-p 'heex))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'heex))
|
||||
|
||||
;; Comments
|
||||
|
|
@ -236,7 +238,9 @@ Return nil if NODE is not a defun node or doesn't have a name."
|
|||
(setq-local treesit-font-lock-feature-list
|
||||
heex-ts--font-lock-feature-list)
|
||||
|
||||
(when (treesit-ensure-installed 'elixir)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'elixir)
|
||||
(treesit-ready-p 'elixir))
|
||||
(require 'elixir-ts-mode)
|
||||
(treesit-parser-create 'elixir)
|
||||
|
||||
|
|
|
|||
|
|
@ -4041,7 +4041,9 @@ See `treesit-thing-settings' for more information.")
|
|||
\\<js-ts-mode-map>"
|
||||
:group 'js
|
||||
:syntax-table js-mode-syntax-table
|
||||
(when (treesit-ensure-installed 'javascript)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'javascript)
|
||||
(treesit-ready-p 'javascript))
|
||||
;; Borrowed from `js-mode'.
|
||||
(setq-local prettify-symbols-alist js--prettify-symbols-alist)
|
||||
(setq-local parse-sexp-ignore-comments t)
|
||||
|
|
@ -4073,7 +4075,9 @@ See `treesit-thing-settings' for more information.")
|
|||
(setq-local treesit-font-lock-settings (js--treesit-font-lock-settings))
|
||||
(setq-local treesit-font-lock-feature-list js--treesit-font-lock-feature-list)
|
||||
|
||||
(when (treesit-ensure-installed 'jsdoc)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'jsdoc)
|
||||
(treesit-ready-p 'jsdoc))
|
||||
(setq-local treesit-range-settings
|
||||
(treesit-range-rules
|
||||
:embed 'jsdoc
|
||||
|
|
|
|||
|
|
@ -675,7 +675,9 @@ Calls REPORT-FN directly."
|
|||
:syntax-table lua-ts--syntax-table
|
||||
(use-local-map lua-ts-mode-map)
|
||||
|
||||
(when (treesit-ensure-installed 'lua)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'lua)
|
||||
(treesit-ready-p 'lua))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'lua))
|
||||
|
||||
;; Comments.
|
||||
|
|
|
|||
|
|
@ -7477,9 +7477,11 @@ implementations: `python-mode' and `python-ts-mode'."
|
|||
|
||||
\\{python-ts-mode-map}"
|
||||
:syntax-table python-mode-syntax-table
|
||||
(when (if (fboundp 'treesit-ensure-installed) ; Emacs 31
|
||||
(treesit-ensure-installed 'python)
|
||||
(treesit-ready-p 'python))
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (if (fboundp 'treesit-ensure-installed) ; Emacs 31
|
||||
(treesit-ensure-installed 'python)
|
||||
t)
|
||||
(treesit-ready-p 'python))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'python))
|
||||
(setq-local treesit-font-lock-feature-list
|
||||
'(( comment definition)
|
||||
|
|
|
|||
|
|
@ -557,7 +557,9 @@ See `prettify-symbols-compose-predicate'."
|
|||
:group 'rust
|
||||
:syntax-table rust-ts-mode--syntax-table
|
||||
|
||||
(when (treesit-ensure-installed 'rust)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'rust)
|
||||
(treesit-ready-p 'rust))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'rust))
|
||||
|
||||
;; Syntax.
|
||||
|
|
|
|||
|
|
@ -1583,7 +1583,9 @@ with your script for an edit-interpret-debug cycle."
|
|||
This mode automatically falls back to `sh-mode' if the buffer is
|
||||
not written in Bash or sh."
|
||||
:syntax-table sh-mode-syntax-table
|
||||
(when (treesit-ensure-installed 'bash)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'bash)
|
||||
(treesit-ready-p 'bash))
|
||||
(sh-set-shell "bash" nil nil)
|
||||
(add-hook 'flymake-diagnostic-functions #'sh-shellcheck-flymake nil t)
|
||||
(add-hook 'hack-local-variables-hook
|
||||
|
|
|
|||
|
|
@ -701,7 +701,9 @@ This mode is intended to be inherited by concrete major modes."
|
|||
:group 'typescript
|
||||
:syntax-table typescript-ts-mode--syntax-table
|
||||
|
||||
(when (treesit-ensure-installed 'typescript)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'typescript)
|
||||
(treesit-ready-p 'typescript))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'typescript))
|
||||
|
||||
;; Indent.
|
||||
|
|
@ -757,7 +759,9 @@ at least 3 (which is the default value)."
|
|||
:group 'typescript
|
||||
:syntax-table typescript-ts-mode--syntax-table
|
||||
|
||||
(when (treesit-ensure-installed 'tsx)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'tsx)
|
||||
(treesit-ready-p 'tsx))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'tsx))
|
||||
|
||||
;; Comments.
|
||||
|
|
|
|||
|
|
@ -369,6 +369,8 @@ should a regexp."
|
|||
(replace--region-filter
|
||||
(funcall region-extract-function 'bounds)))
|
||||
:highlight (and query-replace-lazy-highlight (not no-highlight))
|
||||
:lax-whitespace (if regexp-flag replace-regexp-lax-whitespace
|
||||
replace-lax-whitespace)
|
||||
:regexp regexp-flag
|
||||
:regexp-function (or replace-regexp-function
|
||||
delimited-flag
|
||||
|
|
|
|||
|
|
@ -1888,7 +1888,9 @@ can also be used to fill comments.
|
|||
|
||||
\\{css-mode-map}"
|
||||
:syntax-table css-mode-syntax-table
|
||||
(when (treesit-ensure-installed 'css)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'css)
|
||||
(treesit-ready-p 'css))
|
||||
;; Borrowed from `css-mode'.
|
||||
(setq-local syntax-propertize-function
|
||||
css-syntax-propertize-function)
|
||||
|
|
|
|||
|
|
@ -911,6 +911,7 @@ region, instead of just filling the current paragraph."
|
|||
(fill-comment-paragraph justify)))
|
||||
;; 4. If it all fails, default to the good ol' text paragraph filling.
|
||||
(let ((before (point))
|
||||
(paragraph-start-orig paragraph-start)
|
||||
(paragraph-start paragraph-start)
|
||||
;; Fill prefix used for filling the paragraph.
|
||||
fill-pfx)
|
||||
|
|
@ -933,6 +934,18 @@ region, instead of just filling the current paragraph."
|
|||
(setq fill-pfx "")
|
||||
(let ((end (point))
|
||||
(beg (progn (fill-forward-paragraph -1) (point))))
|
||||
;; If the paragraph starts with a comment line preceding point
|
||||
;; on a non-comment line, skip such comment lines, so they
|
||||
;; are not filled together (bug#80449).
|
||||
(when (and fill-paragraph-handle-comment comment-start-skip
|
||||
(< beg before))
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(when (looking-at paragraph-start-orig)
|
||||
(goto-char (1+ (match-end 0))))
|
||||
(when (looking-at comment-start-skip)
|
||||
(forward-line 1)
|
||||
(setq beg (point)))))
|
||||
(goto-char before)
|
||||
(setq fill-pfx
|
||||
(if use-hard-newlines
|
||||
|
|
|
|||
|
|
@ -511,7 +511,9 @@ Powered by tree-sitter."
|
|||
|
||||
;; jsdoc is not mandatory for js-ts-mode, so we respect this by
|
||||
;; adding jsdoc range rules only when jsdoc is available.
|
||||
(when (treesit-ensure-installed 'jsdoc)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'jsdoc)
|
||||
(treesit-ready-p 'jsdoc))
|
||||
(setq-local c-ts-common--comment-regexp
|
||||
js--treesit-jsdoc-comment-regexp))
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,9 @@ Return nil if there is no name or if NODE is not a defun node."
|
|||
:group 'toml-mode
|
||||
:syntax-table toml-ts-mode--syntax-table
|
||||
|
||||
(when (treesit-ensure-installed 'toml)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'toml)
|
||||
(treesit-ready-p 'toml))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'toml))
|
||||
|
||||
;; Comments
|
||||
|
|
|
|||
|
|
@ -262,7 +262,9 @@ Calls REPORT-FN directly."
|
|||
:group 'yaml
|
||||
:syntax-table yaml-ts-mode--syntax-table
|
||||
|
||||
(when (treesit-ensure-installed 'yaml)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed 'yaml)
|
||||
(treesit-ready-p 'yaml))
|
||||
(setq treesit-primary-parser (treesit-parser-create 'yaml))
|
||||
|
||||
;; Comments.
|
||||
|
|
|
|||
|
|
@ -142,7 +142,9 @@ of `define-treesit-generic-mode'.
|
|||
;;;###autoload
|
||||
(defun treesit-generic-mode-setup (lang)
|
||||
"Go into the treesit generic mode MODE."
|
||||
(when (treesit-ensure-installed lang)
|
||||
;; `treesit-ready-p' also checks for buffer size.
|
||||
(when (and (treesit-ensure-installed lang)
|
||||
(treesit-ready-p lang))
|
||||
(setq treesit-primary-parser (treesit-parser-create lang))
|
||||
|
||||
(when-let* ((query (treesit-generic-mode-font-lock-query lang)))
|
||||
|
|
|
|||
|
|
@ -826,9 +826,12 @@ should be shown to the user."
|
|||
;; Authorization header field.
|
||||
(url-http-handle-authentication nil))
|
||||
('payment-required ; 402
|
||||
;; This code is reserved for future use
|
||||
(url-mark-buffer-as-dead buffer)
|
||||
(error "Somebody wants you to give them money"))
|
||||
;; This code is "reserved for future use", but in the
|
||||
;; mean time websites have been seen to use it, for
|
||||
;; instance anti-bot challenges requiring the "payment"
|
||||
;; of a click of a button to prove the visitor is human,
|
||||
;; so we no longer raise an `error' here.
|
||||
t)
|
||||
('forbidden ; 403
|
||||
;; The server understood the request, but is refusing to
|
||||
;; fulfill it. Authorization will not help and the request
|
||||
|
|
|
|||
|
|
@ -161,17 +161,23 @@ proceed to mark and unmark other entries, without asking."
|
|||
:version "31.1")
|
||||
|
||||
(defcustom vc-dir-auto-hide-up-to-date nil
|
||||
"If non-nil, VC-Dir automatically hides \\+`up-to-date' and \\+`ignored' items.
|
||||
"Whether VC-Dir automatically removes \\+`up-to-date'/\\+`ignored' files from display.
|
||||
|
||||
If the value of this variable is the symbol `revert', \
|
||||
\\<vc-dir-mode-map>\\[revert-buffer] in VC-Dir
|
||||
buffers also does \\[vc-dir-hide-up-to-date]. \
|
||||
That is, refreshing the VC-Dir buffer also hides
|
||||
\\+`up-to-date' and \\+`ignored' items.
|
||||
If the value is nil, files shown in the VC-Dir buffer will remain on
|
||||
display if they become \\+`up-to-date' or \\+`ignored'.
|
||||
If the value is t, files are automatically removed from display when
|
||||
they become \\+`up-to-date' or \\+`ignored'.
|
||||
If the value is the symbol `revert', any displayed files that
|
||||
are \\+`up-to-date' or \\+`ignored' are removed from display
|
||||
by \\<vc-dir-mode-map>\\[revert-buffer], but they are not automatically removed
|
||||
when they become \\+`up-to-date' or \\+`ignored'. That is,
|
||||
refreshing the VC-Dir buffer hides \\+`up-to-date' and \\+`ignored'
|
||||
files when the value is the symbol `revert'.
|
||||
Any other value is treated as t.
|
||||
|
||||
VC-Dir never shows \\+`up-to-date' and \\+`ignored' files when the
|
||||
directory is first displayed.
|
||||
|
||||
If the value of this variable is any other non-nil value, then in
|
||||
addition, hide items whenever their state would change to
|
||||
\\+`up-to-date' or \\+`ignored'.
|
||||
You can still use `vc-dir-show-fileentry' to manually add an entry for
|
||||
an \\+`up-to-date' or \\+`ignored' file."
|
||||
:type 'boolean
|
||||
|
|
|
|||
|
|
@ -2364,6 +2364,22 @@ STR the i-th character of PAT matched. */)
|
|||
if (patlen == 0 || strlen == 0 || size > FLEX_MAX_MATRIX_SIZE)
|
||||
return Qnil;
|
||||
|
||||
/* Also bail if PAT is not a subsequence of STR so bail "cheaply"
|
||||
before the O(N*M) DP algorithm. Walking both strings
|
||||
byte-by-byte for this purpose (and only for case-sensitive common
|
||||
case) should be valid even for multibyte strings. */
|
||||
if (!completion_ignore_case)
|
||||
{
|
||||
const unsigned char *p = SDATA (pat);
|
||||
const unsigned char *s = SDATA (str);
|
||||
int pi = 0;
|
||||
for (int si = 0; si < strlen && pi < patlen; si++)
|
||||
if (s[si] == p[pi])
|
||||
pi++;
|
||||
if (pi < patlen)
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
/* Initialize M and D with positive infinity... */
|
||||
for (int j = 0; j < size; j++)
|
||||
M[j] = D[j] = pos_inf;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
Point-Char: |
|
||||
|
||||
Name: fill-paragraph-handle-comment - non-comment line before comment line
|
||||
Code:
|
||||
(lambda ()
|
||||
(setq-local comment-start "# ")
|
||||
(setq-local fill-paragraph-handle-comment t)
|
||||
(setq-local fill-column 42)
|
||||
(fill-paragraph))
|
||||
|
||||
=-=
|
||||
|
||||
this is not part of the comment this is not part of the comment|
|
||||
# this is a comment this is a comment this is a comment
|
||||
|
||||
=-=
|
||||
|
||||
this is not part of the comment this is
|
||||
not part of the comment
|
||||
# this is a comment this is a comment this is a comment
|
||||
|
||||
=-=-=
|
||||
|
||||
Name: fill-paragraph-handle-comment - non-comment line after comment line
|
||||
|
||||
=-=
|
||||
|
||||
# this is a comment this is a comment this is a comment
|
||||
this is not part of the comment this is not part of the comment|
|
||||
|
||||
=-=
|
||||
|
||||
# this is a comment this is a comment this is a comment
|
||||
this is not part of the comment this is
|
||||
not part of the comment
|
||||
|
||||
=-=-=
|
||||
|
|
@ -163,6 +163,10 @@ eius. Foo")))
|
|||
(skip-unless (functionp 'markdown-mode))
|
||||
(ert-test-erts-file (ert-resource-file "fill-paragraph-semlf-markdown-mode.erts")))
|
||||
|
||||
(ert-deftest fill-test-fill-paragraph-handle-comment ()
|
||||
"Test the `fill-paragraph-handle-comment' variable."
|
||||
(ert-test-erts-file (ert-resource-file "fill-paragraph-handle-comment.erts")))
|
||||
|
||||
(provide 'fill-tests)
|
||||
|
||||
;;; fill-tests.el ends here
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ process to complete."
|
|||
(should (string= (buffer-string) "arg1=\"x &y\", arg2=\n"))))))
|
||||
|
||||
(ert-deftest process-test-stderr-buffer ()
|
||||
:tags (if (getenv "EMACS_EMBA_CI") '(:unstable))
|
||||
(skip-unless (executable-find "bash"))
|
||||
(with-timeout (60 (ert-fail "Test timed out"))
|
||||
(let* ((stdout-buffer (generate-new-buffer "*stdout*"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue