1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

Merge from origin/emacs-30

b7f6cde419 Disable xwidgets with recent webkitgtk versions (Bug#66068)
a6dafbc2bc ; * lisp/editorconfig.el (editorconfig-indentation-alist)...
0834106a62 Fix treesit--merge-ranges (bug#73324)
76c6b4d279 Fix midnight-mode documentation
f778252220 ; Fix my email address
db22efca8d editorconfig.el: Fix too naive sync from upstream
0f12d6dd23 ; * etc/NEWS: Announce 'doc-view-mpdf--use-svg'.
29d50e245f * lisp/progmodes/eglot.el (eglot--signal-textDocument/did...

# Conflicts:
#	etc/NEWS
#	lisp/treesit.el
This commit is contained in:
Eli Zaretskii 2024-09-21 07:32:31 -04:00
commit 7a8f2a0bec
9 changed files with 1780 additions and 1743 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4518,10 +4518,11 @@ XWIDGETS_OBJ=
if test "$with_xwidgets" != "no"; then
if test "$USE_GTK_TOOLKIT" = "GTK3" && test "$window_system" != "none"; then
WEBKIT_REQUIRED=2.12
WEBKIT_MODULES="webkit2gtk-4.1 >= $WEBKIT_REQUIRED"
WEBKIT_BROKEN=2.41.92
WEBKIT_MODULES="webkit2gtk-4.1 >= $WEBKIT_REQUIRED webkit2gtk-4.1 < $WEBKIT_BROKEN"
EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES])
if test "$HAVE_WEBKIT" = "no"; then
WEBKIT_MODULES="webkit2gtk-4.0 >= $WEBKIT_REQUIRED"
WEBKIT_MODULES="webkit2gtk-4.0 >= $WEBKIT_REQUIRED webkit2gtk-4.0 < $WEBKIT_BROKEN"
EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES])
fi
HAVE_XWIDGETS=$HAVE_WEBKIT

View File

@ -1529,6 +1529,11 @@ value of this option for the current invocation of 'man'.
** DocView
---
*** New user option 'doc-view-mpdf-use-svg'.
If non-nil, DocView uses SVG images to display PDF documents. The
default is non-nil if your system supports display of SVG images.
---
*** New face 'doc-view-svg-face'.
This replaces 'doc-view-svg-foreground' and 'doc-view-svg-background'.

View File

@ -211,7 +211,7 @@ This hook will be run even when there are no matching sections in
(mustache-mode mustache-basic-offset)
(nasm-mode nasm-basic-offset)
(nginx-mode nginx-indent-level)
(nxml-mode nxml-child-indent (nxml-attribute-indent . 2))
(nxml-mode . editorconfig--get-indentation-nxml-mode)
(objc-mode c-basic-offset)
(octave-mode octave-block-offset)
(perl-mode perl-indent-level)
@ -266,7 +266,9 @@ This is a fallback used for those modes which don't set
`editorconfig-indent-size-vars'.
Each element should look like (MODE . SETTING) where SETTING
should obey the same rules as `editorconfig-indent-size-vars'."
should obey the same rules as `editorconfig-indent-size-vars',
i.e. be either a list of variable names or a function returning
a list of settings in the form (VARIABLE . VALUE)."
:type '(alist :key-type symbol
:value-type (choice function
(repeat
@ -341,6 +343,11 @@ Make a message by passing ARGS to `format-message'."
(LaTeX-indent-level . ,size)
(LaTeX-item-indent . ,(- size))))
(defun editorconfig--get-indentation-nxml-mode (size)
"Vars to set `nxml-mode' indent size to SIZE."
`((nxml-child-indent . ,size)
(nxml-attribute-indent . ,(* 2 size))))
(defun editorconfig--get-indentation-lisp-mode (size)
"Set indent size to SIZE for Lisp mode(s)."
(when (cond ((null editorconfig-lisp-use-default-indent) t)

View File

@ -1,6 +1,6 @@
;;; midnight.el --- run something every midnight, e.g., kill old buffers -*- lexical-binding:t -*-
;; Copyright (C) 1998, 2001-2024 Free Software Foundation, Inc.
;; Copyright (C) 1998-2024 Free Software Foundation, Inc.
;; Author: Sam Steingold <sds@gnu.org>
;; Created: 1998-05-18
@ -23,7 +23,7 @@
;;; Commentary:
;; To use the file, put (require 'midnight) into your .emacs. Then, at
;; To use the file, put (midnight-mode) into your .emacs. Then, at
;; midnight, Emacs will run the normal hook `midnight-hook'. You can
;; put whatever you like there, say, `calendar'; by default there is
;; only one function there - `clean-buffer-list'. It will kill the

View File

@ -2106,6 +2106,7 @@ Use `eglot-managed-p' to determine if current buffer is managed.")
(defvar revert-buffer-preserve-modes)
(defun eglot--after-revert-hook ()
"Eglot's `after-revert-hook'."
;; FIXME: Do we really need this?
(when revert-buffer-preserve-modes (eglot--signal-textDocument/didOpen)))
(defun eglot--maybe-activate-editing-mode ()
@ -2813,6 +2814,8 @@ When called interactively, use the currently active server"
(defun eglot--signal-textDocument/didOpen ()
"Send textDocument/didOpen to server."
;; Flush any potential pending change.
(eglot--track-changes-fetch eglot--track-changes)
(setq eglot--recent-changes nil
eglot--versioned-identifier 0
eglot--TextDocumentIdentifier-cache nil)

View File

@ -634,13 +634,28 @@ Return the merged list of ranges."
(setq old-ranges (cdr old-ranges)))
(t ;; New and old range intersect, discard old.
(setq old-ranges (cdr old-ranges))))))
(let ((left-over (or new-ranges old-ranges)))
(dolist (range left-over)
(push range result)))
;; At this point, either old-ranges has left-over or new-ranges has
;; left-over, but not both.
(while old-ranges
;; For each left-over old range, push to result unless it
;; intersects with START-END.
(let ((old-beg (caar old-ranges))
(old-end (cdar old-ranges)))
(unless (or (and (< start old-end)
(< old-beg end))
(eq old-beg old-end))
(push (car old-ranges) result)))
(setq old-ranges (cdr old-ranges)))
;; Unconditionally push left-over new ranges to result.
(while new-ranges
(unless (eq (caar new-ranges) (cdar new-ranges))
(push (car new-ranges) result))
(setq new-ranges (cdr new-ranges)))
(nreverse result)))
;; TODO: Instead of throwing away ranges that exceeds START and END,
;; truncate the head and tail ranges so they stay within START and END.
;; TODO: truncate ranges that exceeds START and END instead of
;; discarding them. Merge into treesit--merge-ranges so we don't loop
;; over the ranges twice (might be premature optimization tho).
(defun treesit--clip-ranges (ranges start end)
"Clip RANGES in between START and END.
RANGES is a list of ranges of the form (BEG . END). Ranges
@ -883,6 +898,7 @@ t, nil, append, prepend, keep. See more in
(setf (nth 1 new-setting) t)
new-setting))
;; FIXME: Rewrite this in more readable fashion.
(defun treesit--font-lock-level-setter (sym val)
"Custom setter for `treesit-font-lock-level'.
Set the default value of SYM to VAL, recompute fontification

View File

@ -686,6 +686,11 @@ visible_end.)"
(should (equal '((16 . 28)) (treesit-query-range
'javascript query nil nil '(1 . -1)))))))
(ert-deftest treesit-range-merge ()
"Test merging ranges."
(should (equal (treesit--merge-ranges '((1 . 1) (3 . 483)) nil 1 488)
nil)))
(ert-deftest treesit-range-fixup-after-edit ()
"Tests if Emacs can fix OOB ranges after deleting text or narrowing."
(skip-unless (treesit-language-available-p 'json))