aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii2024-09-21 07:32:31 -0400
committerEli Zaretskii2024-09-21 07:32:31 -0400
commit7a8f2a0beccbf7307f99cd18d1c2608ffbbc0906 (patch)
tree43e24b21bebf0b4474265a68ae106581e03da8db /lisp
parent1cf6ff4362ef2ba57d0b7811048fb67ff9a847dc (diff)
parentb7f6cde419f862dbbf25a8192f5f31ac557b60b5 (diff)
downloademacs-7a8f2a0beccbf7307f99cd18d1c2608ffbbc0906.tar.gz
emacs-7a8f2a0beccbf7307f99cd18d1c2608ffbbc0906.zip
Merge from origin/emacs-30
b7f6cde419f Disable xwidgets with recent webkitgtk versions (Bug#66068) a6dafbc2bc5 ; * lisp/editorconfig.el (editorconfig-indentation-alist)... 0834106a620 Fix treesit--merge-ranges (bug#73324) 76c6b4d2799 Fix midnight-mode documentation f7782522207 ; Fix my email address db22efca8d4 editorconfig.el: Fix too naive sync from upstream 0f12d6dd23c ; * etc/NEWS: Announce 'doc-view-mpdf--use-svg'. 29d50e245f8 * lisp/progmodes/eglot.el (eglot--signal-textDocument/did... # Conflicts: # etc/NEWS # lisp/treesit.el
Diffstat (limited to 'lisp')
-rw-r--r--lisp/editorconfig.el11
-rw-r--r--lisp/midnight.el4
-rw-r--r--lisp/progmodes/eglot.el3
-rw-r--r--lisp/treesit.el26
4 files changed, 35 insertions, 9 deletions
diff --git a/lisp/editorconfig.el b/lisp/editorconfig.el
index 931781007d9..8d239229dcb 100644
--- a/lisp/editorconfig.el
+++ b/lisp/editorconfig.el
@@ -211,7 +211,7 @@ This hook will be run even when there are no matching sections in
211 (mustache-mode mustache-basic-offset) 211 (mustache-mode mustache-basic-offset)
212 (nasm-mode nasm-basic-offset) 212 (nasm-mode nasm-basic-offset)
213 (nginx-mode nginx-indent-level) 213 (nginx-mode nginx-indent-level)
214 (nxml-mode nxml-child-indent (nxml-attribute-indent . 2)) 214 (nxml-mode . editorconfig--get-indentation-nxml-mode)
215 (objc-mode c-basic-offset) 215 (objc-mode c-basic-offset)
216 (octave-mode octave-block-offset) 216 (octave-mode octave-block-offset)
217 (perl-mode perl-indent-level) 217 (perl-mode perl-indent-level)
@@ -266,7 +266,9 @@ This is a fallback used for those modes which don't set
266`editorconfig-indent-size-vars'. 266`editorconfig-indent-size-vars'.
267 267
268Each element should look like (MODE . SETTING) where SETTING 268Each element should look like (MODE . SETTING) where SETTING
269should obey the same rules as `editorconfig-indent-size-vars'." 269should obey the same rules as `editorconfig-indent-size-vars',
270i.e. be either a list of variable names or a function returning
271a list of settings in the form (VARIABLE . VALUE)."
270 :type '(alist :key-type symbol 272 :type '(alist :key-type symbol
271 :value-type (choice function 273 :value-type (choice function
272 (repeat 274 (repeat
@@ -341,6 +343,11 @@ Make a message by passing ARGS to `format-message'."
341 (LaTeX-indent-level . ,size) 343 (LaTeX-indent-level . ,size)
342 (LaTeX-item-indent . ,(- size)))) 344 (LaTeX-item-indent . ,(- size))))
343 345
346(defun editorconfig--get-indentation-nxml-mode (size)
347 "Vars to set `nxml-mode' indent size to SIZE."
348 `((nxml-child-indent . ,size)
349 (nxml-attribute-indent . ,(* 2 size))))
350
344(defun editorconfig--get-indentation-lisp-mode (size) 351(defun editorconfig--get-indentation-lisp-mode (size)
345 "Set indent size to SIZE for Lisp mode(s)." 352 "Set indent size to SIZE for Lisp mode(s)."
346 (when (cond ((null editorconfig-lisp-use-default-indent) t) 353 (when (cond ((null editorconfig-lisp-use-default-indent) t)
diff --git a/lisp/midnight.el b/lisp/midnight.el
index 6e1e7b5ccb7..ea30f5462f2 100644
--- a/lisp/midnight.el
+++ b/lisp/midnight.el
@@ -1,6 +1,6 @@
1;;; midnight.el --- run something every midnight, e.g., kill old buffers -*- lexical-binding:t -*- 1;;; midnight.el --- run something every midnight, e.g., kill old buffers -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1998, 2001-2024 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2024 Free Software Foundation, Inc.
4 4
5;; Author: Sam Steingold <sds@gnu.org> 5;; Author: Sam Steingold <sds@gnu.org>
6;; Created: 1998-05-18 6;; Created: 1998-05-18
@@ -23,7 +23,7 @@
23 23
24;;; Commentary: 24;;; Commentary:
25 25
26;; To use the file, put (require 'midnight) into your .emacs. Then, at 26;; To use the file, put (midnight-mode) into your .emacs. Then, at
27;; midnight, Emacs will run the normal hook `midnight-hook'. You can 27;; midnight, Emacs will run the normal hook `midnight-hook'. You can
28;; put whatever you like there, say, `calendar'; by default there is 28;; put whatever you like there, say, `calendar'; by default there is
29;; only one function there - `clean-buffer-list'. It will kill the 29;; only one function there - `clean-buffer-list'. It will kill the
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 82e99a2c920..5f2f66c5384 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2106,6 +2106,7 @@ Use `eglot-managed-p' to determine if current buffer is managed.")
2106(defvar revert-buffer-preserve-modes) 2106(defvar revert-buffer-preserve-modes)
2107(defun eglot--after-revert-hook () 2107(defun eglot--after-revert-hook ()
2108 "Eglot's `after-revert-hook'." 2108 "Eglot's `after-revert-hook'."
2109 ;; FIXME: Do we really need this?
2109 (when revert-buffer-preserve-modes (eglot--signal-textDocument/didOpen))) 2110 (when revert-buffer-preserve-modes (eglot--signal-textDocument/didOpen)))
2110 2111
2111(defun eglot--maybe-activate-editing-mode () 2112(defun eglot--maybe-activate-editing-mode ()
@@ -2813,6 +2814,8 @@ When called interactively, use the currently active server"
2813 2814
2814(defun eglot--signal-textDocument/didOpen () 2815(defun eglot--signal-textDocument/didOpen ()
2815 "Send textDocument/didOpen to server." 2816 "Send textDocument/didOpen to server."
2817 ;; Flush any potential pending change.
2818 (eglot--track-changes-fetch eglot--track-changes)
2816 (setq eglot--recent-changes nil 2819 (setq eglot--recent-changes nil
2817 eglot--versioned-identifier 0 2820 eglot--versioned-identifier 0
2818 eglot--TextDocumentIdentifier-cache nil) 2821 eglot--TextDocumentIdentifier-cache nil)
diff --git a/lisp/treesit.el b/lisp/treesit.el
index d3e6efdeb14..6046563ae3e 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -634,13 +634,28 @@ Return the merged list of ranges."
634 (setq old-ranges (cdr old-ranges))) 634 (setq old-ranges (cdr old-ranges)))
635 (t ;; New and old range intersect, discard old. 635 (t ;; New and old range intersect, discard old.
636 (setq old-ranges (cdr old-ranges)))))) 636 (setq old-ranges (cdr old-ranges))))))
637 (let ((left-over (or new-ranges old-ranges))) 637 ;; At this point, either old-ranges has left-over or new-ranges has
638 (dolist (range left-over) 638 ;; left-over, but not both.
639 (push range result))) 639 (while old-ranges
640 ;; For each left-over old range, push to result unless it
641 ;; intersects with START-END.
642 (let ((old-beg (caar old-ranges))
643 (old-end (cdar old-ranges)))
644 (unless (or (and (< start old-end)
645 (< old-beg end))
646 (eq old-beg old-end))
647 (push (car old-ranges) result)))
648 (setq old-ranges (cdr old-ranges)))
649 ;; Unconditionally push left-over new ranges to result.
650 (while new-ranges
651 (unless (eq (caar new-ranges) (cdar new-ranges))
652 (push (car new-ranges) result))
653 (setq new-ranges (cdr new-ranges)))
640 (nreverse result))) 654 (nreverse result)))
641 655
642;; TODO: Instead of throwing away ranges that exceeds START and END, 656;; TODO: truncate ranges that exceeds START and END instead of
643;; truncate the head and tail ranges so they stay within START and END. 657;; discarding them. Merge into treesit--merge-ranges so we don't loop
658;; over the ranges twice (might be premature optimization tho).
644(defun treesit--clip-ranges (ranges start end) 659(defun treesit--clip-ranges (ranges start end)
645 "Clip RANGES in between START and END. 660 "Clip RANGES in between START and END.
646RANGES is a list of ranges of the form (BEG . END). Ranges 661RANGES is a list of ranges of the form (BEG . END). Ranges
@@ -883,6 +898,7 @@ t, nil, append, prepend, keep. See more in
883 (setf (nth 1 new-setting) t) 898 (setf (nth 1 new-setting) t)
884 new-setting)) 899 new-setting))
885 900
901;; FIXME: Rewrite this in more readable fashion.
886(defun treesit--font-lock-level-setter (sym val) 902(defun treesit--font-lock-level-setter (sym val)
887 "Custom setter for `treesit-font-lock-level'. 903 "Custom setter for `treesit-font-lock-level'.
888Set the default value of SYM to VAL, recompute fontification 904Set the default value of SYM to VAL, recompute fontification