commit 870100a8b7172a5845369ec6a2c28c2b06b7eaee (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Wed Jun 5 09:38:39 2024 +0300 Rehighlight hi-lock patterns after reverting the buffer. * lisp/hi-lock.el (hi-lock-revert-buffer-rehighlight): New function. (hi-lock-mode): Add hi-lock-revert-buffer-rehighlight to revert-buffer-restore-functions, and remove after mode is disabled. https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00044.html diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 516bee67dd0..3c26cc84509 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -376,7 +376,9 @@ use (hi-lock-mode 1) for individual buffers."))) (hi-lock-find-patterns) (add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook nil t) ;; Remove regexps from font-lock-keywords (bug#13891). - (add-hook 'change-major-mode-hook (lambda () (hi-lock-mode -1)) nil t)) + (add-hook 'change-major-mode-hook (lambda () (hi-lock-mode -1)) nil t) + (add-hook 'revert-buffer-restore-functions + #'hi-lock-revert-buffer-rehighlight nil t)) ;; Turned off. (when (or hi-lock-interactive-patterns hi-lock-file-patterns) @@ -390,7 +392,9 @@ use (hi-lock-mode 1) for individual buffers."))) (remove-overlays nil nil 'hi-lock-overlay t) (font-lock-flush)) (define-key-after menu-bar-edit-menu [hi-lock] nil) - (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook t))) + (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook t) + (remove-hook 'revert-buffer-restore-functions + #'hi-lock-revert-buffer-rehighlight t))) ;;;###autoload (define-globalized-minor-mode global-hi-lock-mode @@ -859,6 +863,17 @@ SPACES-REGEXP is a regexp to substitute spaces in font-lock search." (font-lock-add-keywords nil hi-lock-file-patterns t) (font-lock-add-keywords nil hi-lock-interactive-patterns t))) +(defun hi-lock-revert-buffer-rehighlight () + "Rehighlight hi-lock patterns after `revert-buffer'. +Apply the previous patterns after reverting the buffer." + (when-let ((patterns hi-lock-interactive-lighters)) + (lambda () + (setq hi-lock-interactive-lighters nil + hi-lock-interactive-patterns nil) + (let ((hi-lock-auto-select-face t)) + (dolist (pattern (reverse patterns)) + (highlight-regexp (car pattern) (hi-lock-read-face-name))))))) + (defvar hi-lock--hashcons-hash (make-hash-table :test 'equal :weakness t) "Hash table used to hash cons regexps.") commit a2b6e18d6006e62525e71639771fb3bbf5e96a6c Author: Juri Linkov Date: Wed Jun 5 09:35:50 2024 +0300 Use revert-buffer-restore-functions in xref-revert-buffer (bug#49731) * lisp/progmodes/xref.el (xref-revert-buffer): When 'revert-buffer-restore-functions' is bound, use it in the same way as in 'revert-buffer'. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index beea2b8c1d6..fb6c9dad73b 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1277,13 +1277,18 @@ Return an alist of the form ((GROUP . (XREF ...)) ...)." "Refresh the search results in the current buffer." (interactive) (let ((inhibit-read-only t) - (buffer-undo-list t)) + (buffer-undo-list t) + restore-functions) + (when (boundp 'revert-buffer-restore-functions) + (run-hook-wrapped 'revert-buffer-restore-functions + (lambda (f) (push (funcall f) restore-functions) nil))) (save-excursion (condition-case err (let ((alist (xref--analyze (funcall xref--fetcher))) (inhibit-modification-hooks t)) (erase-buffer) - (xref--insert-xrefs alist)) + (prog1 (xref--insert-xrefs alist) + (mapc #'funcall (delq nil restore-functions)))) (user-error (erase-buffer) (insert commit 854552fd0d14c60877e59fd53007ecf5af72418a Author: Ulrich Müller Date: Wed Jun 5 08:19:56 2024 +0200 Reorder Calc units table * lisp/calc/calc-units.el (math-standard-units): Reorder the table, so that all CODATA values are grouped together. diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 9af6685cfa6..bb510ed8aef 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -269,9 +269,7 @@ ( Nav "6.02214076*10^(23) / mol" "Avogadro constant" nil "6.02214076 10^23 / mol") - ;; Other physical quantities - ;; Unless otherwise mentioned, the values are from CODATA, - ;; and are approximate. + ;; Derived physical constants ( hbar "h / (2 pi)" "*Reduced Planck constant" ) ;; After the 2018 SI redefinition, eps0 and mu0 are measured quantities, ;; and mu0 no longer has the previous exact value of 4 pi 10^(-7) H/m. @@ -279,6 +277,14 @@ ( ε0 "eps0" "Permittivity of vacuum" ) ( mu0 "1 / (eps0 c^2)" "Permeability of vacuum") ( μ0 "mu0" "Permeability of vacuum") + ( sigma "2 pi^5 k^4 / (15 h^3 c^2)" "Stefan-Boltzmann constant") + ( σ "sigma" "Stefan-Boltzmann constant") + ( R0 "Nav k" "Molar gas constant" ) + ( V0 "R0 273.15 K / 10^5 Pa" "Standard volume of ideal gas" ) + ;; IUPAC 1982 standard temperature and pressure + + ;; Other physical quantities + ;; Values are from CODATA, and are approximate. ( G "6.67430*10^(-11) m^3/(kg s^2)" "Gravitational constant" nil "6.67430 10^-11 m^3/(kg s^2) (*)") ( me "9.1093837139*10^(-31) kg" "Electron rest mass" nil @@ -293,8 +299,6 @@ "1.883531627 10^-28 kg (*)") ( Ryd "10973731.568157 /m" "Rydberg constant" nil "10973731.568157 /m (*)") - ( sigma "2 pi^5 k^4 / (15 h^3 c^2)" "Stefan-Boltzmann constant") - ( σ "sigma" "Stefan-Boltzmann constant") ( alpha "7.2973525643*10^(-3)" "Fine structure constant" nil "7.2973525643 10^-3 (*)") ( α "alpha" "Fine structure constant" nil @@ -307,9 +311,6 @@ "-9.2847646917 10^-24 J/T (*)") ( mup "1.41060679545*10^(-26) J/T" "Proton magnetic moment" nil "1.41060679545 10^-26 J/T (*)") - ( R0 "Nav k" "Molar gas constant" ) - ( V0 "R0 273.15 K / 10^5 Pa" "Standard volume of ideal gas" ) - ;; IUPAC 1982 standard temperature and pressure ;; Logarithmic units ( Np nil "*Neper") commit 4764c53580e2bb1d85daa26823a288dc1a5af6af Author: Ulrich Müller Date: Wed Jun 5 08:08:59 2024 +0200 ; * lisp/calc/calc-units.el: Update a comment. diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 2f86d7d0529..9af6685cfa6 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -32,7 +32,7 @@ ;;; Units operations. -;;; Units table last updated 9-Jan-91 by Ulrich Müller (ulm@vsnhd1.cern.ch) +;;; Units table updated 9-Jan-91 by Ulrich Müller (ulm@vsnhd1.cern.ch) ;;; with some additions by Przemek Klosowski (przemek@rrdstrad.nist.gov) ;;; Updated April 2002 by Jochen Küpper commit 3dcac22dd4225fdec0b97408da38f74de2a77bef Author: Paul Eggert Date: Tue Jun 4 22:13:47 2024 -0700 Spelling fixes diff --git a/ChangeLog.3 b/ChangeLog.3 index 2d20f535a1c..ef63f674b59 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -222922,7 +222922,7 @@ 2016-07-09 Jürgen Hötzel - Wrap around error in coreutil's ls + Wrap around error in coreutils ls * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Add switch "--quoting-style=literal" if remote host supports quoting style. diff --git a/ChangeLog.4 b/ChangeLog.4 index e3950461f5f..3eb2c16d6b1 100644 --- a/ChangeLog.4 +++ b/ChangeLog.4 @@ -81723,7 +81723,7 @@ * src/xfns.c (x_make_gc): Don't set FillOpaqueStippled on cursor GC. The reason is that some X servers break on such a fill - style if the operation being performed is not a stiple + style if the operation being performed is not a stipple operation. 2022-02-09 Po Lu diff --git a/admin/notes/kind-communication b/admin/notes/kind-communication index 80b2afb27b2..cacb5d40c25 100644 --- a/admin/notes/kind-communication +++ b/admin/notes/kind-communication @@ -7,7 +7,7 @@ views. People are sometimes discouraged from participating in GNU development because of certain patterns of communication that strike them as unfriendly, unwelcoming, rejecting, or harsh. This discouragement -particularly affects members of disprivileged demographics, but it is +particularly affects members of unprivileged demographics, but it is not limited to them. Therefore, we ask all contributors to make a conscious effort, in GNU Project discussions, to communicate in ways that avoid that outcome — to avoid practices that will predictably and diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 3425281febd..a9da6c75367 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2354,7 +2354,7 @@ window within a frame can also switch the selected window. @xref{Mouse Window Auto-selection}, which describes the behavior for different values. When the mouse is moved over a new window, a focus event for switching windows is generated. Focus events for windows are -reperesented in Lisp as lists that look like this: +represented in Lisp as lists that look like this: @example (select-window @var{new-window}) diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index c8c2fe80c03..1e91100e0d4 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -1582,7 +1582,7 @@ Here's an example @var{treesit-thing-settings} for C and C++: @end example @noindent -Note that this example is modified for didactical purposes, and isn't +Note that this example is modified for didactic purposes, and isn't exactly how C and C@t{++} modes define things. @end defvar diff --git a/doc/lispref/peg.texi b/doc/lispref/peg.texi index b85d0de048d..e496e1cf817 100644 --- a/doc/lispref/peg.texi +++ b/doc/lispref/peg.texi @@ -14,7 +14,7 @@ from regular expressions (@pxref{Regular Expressions}) to full left-to-right (a.k.a.@: @acronym{LL}) grammar parsers (@pxref{Top,, Bovine parser development,bovine}). @dfn{Parsing Expression Grammars} (@acronym{PEG}) are another approach to text parsing that offer more -structure and composibility than regular expressions, but less +structure and composability than regular expressions, but less complexity than context-free grammars. A Parsing Expression Grammar (@acronym{PEG}) describes a formal language diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index c8a04bfa33f..69f94fab469 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1549,7 +1549,7 @@ also specify the absolute path to the program, e.g.@: program whose file name would be interpreted as an explicitly-remote command, you can use @kbd{/:} to quote the name, e.g.@: @samp{/:/ssh:user@@remote:whoami} (@pxref{Quoted File Names,,, emacs, -The GNU Emacs Manual}). To disable explicity-remote commands entirely, +The GNU Emacs Manual}). To disable explicitly-remote commands entirely, you can set the option @code{eshell-explicit-remote-commands} to @code{nil}. diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index c3de15c35ad..33443487066 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org @@ -1251,7 +1251,7 @@ value in some other application. :END: #+findex: modus-themes-get-color-value -The fuction ~modus-themes-get-color-value~ can be called from Lisp to +The function ~modus-themes-get-color-value~ can be called from Lisp to return the value of a color from the active Modus theme palette. It takea a =COLOR= argument and an optional =OVERRIDES=. It also accepts a third =THEME= argument, to get the color from the given theme. @@ -2162,7 +2162,7 @@ until version 4.3.0. ;; was the default in versions of the Modus themes before 4.4.0 (setq modus-themes-common-palette-overrides '((bg-prose-block-contents unspecified) - (bg-prose-block-delimiter unspeficied) + (bg-prose-block-delimiter unspecified) (fg-prose-block-delimiter fg-dim))) #+end_src @@ -2806,7 +2806,7 @@ above: The reason we no longer provide this option is because it depends on a non-~nil~ value for ~x-underline-at-descent-line~. That variable affects ALL underlines, including those of links. The effect is -intrusive and looks awkard in prose. +intrusive and looks awkward in prose. As such, the Modus themes no longer provide that option but instead offer this piece of documentation to make the user fully aware of the @@ -3160,7 +3160,7 @@ specification of that variable looks like this: With the exception of ~org-verbatim~ and ~org-code~ faces, everything else uses the corresponding type of emphasis: a bold typographic weight, or -italicised, underlined, and struck through text. +italicized, underlined, and struck through text. The best way for users to add some extra attributes, such as a foreground color, is to define their own faces and assign them to the @@ -5074,7 +5074,7 @@ more effective than trying to do the same with either red or blue (the latter is the least effective in that regard). When we need to work with several colors, it is always better to have -sufficient manoeuvring space, especially since we cannot pick arbitrary +sufficient maneuvering space, especially since we cannot pick arbitrary colors but only those that satisfy the accessibility objectives of the themes. @@ -5128,7 +5128,7 @@ each of the three channels of light (red, green, blue). For example: : xrandr --output LVDS1 --brightness 1.0 --gamma 0.76:0.75:0.68 Typography is another variable. Some font families are blurry at small -point sizes. Others may have a regular weight that is lighter (thiner) +point sizes. Others may have a regular weight that is lighter (thinner) than that of their peers which may, under certain circumstances, cause a halo effect around each glyph. @@ -5180,7 +5180,7 @@ it is already understood that one must follow the indicator or headline to view its contents and (ii) underlining everything would make the interface virtually unusable. -Again, one must exercise judgement in order to avoid discrimination, +Again, one must exercise judgment in order to avoid discrimination, where "discrimination" refers to: + The treatment of substantially different magnitudes as if they were of @@ -5254,7 +5254,7 @@ the themes, which is partially fleshed out in this manual. With regard to the artistic aspect (where "art" qua skill may amount to an imprecise science), there is no hard-and-fast rule in effect as it -requires one to exercize discretion and make decisions based on +requires one to exercise discretion and make decisions based on context-dependent information or constraints. As is true with most things in life, when in doubt, do not cling on to the letter of the law but try to understand its spirit. diff --git a/doc/misc/transient.texi b/doc/misc/transient.texi index 3a6486903bf..0aa520237f7 100644 --- a/doc/misc/transient.texi +++ b/doc/misc/transient.texi @@ -1210,7 +1210,7 @@ described below. If you use the latter approach, you can use the transform them from the convenient to the expected form. If you explicitly specify children and then transform them using -@code{:setup-chilren}, then the class of the group is determined as usual, +@code{:setup-children}, then the class of the group is determined as usual, based on explicitly specified children. If you do not explicitly specify children and thus rely solely on diff --git a/etc/themes/modus-themes.el b/etc/themes/modus-themes.el index b776f12671e..b8be7f07a57 100644 --- a/etc/themes/modus-themes.el +++ b/etc/themes/modus-themes.el @@ -1389,7 +1389,7 @@ color that is combined with FG-FOR-BG." :foreground fg :weight ;; If we have `bold' specifically, we inherit the face of - ;; the same name. This allows the user to customise that + ;; the same name. This allows the user to customize that ;; face, such as to change its font family. (if (and weight (not (eq weight 'bold))) weight diff --git a/java/AndroidManifest.xml.in b/java/AndroidManifest.xml.in index ff811ddf3f1..644f154b53b 100644 --- a/java/AndroidManifest.xml.in +++ b/java/AndroidManifest.xml.in @@ -20,7 +20,7 @@ along with GNU Emacs. If not, see . --> diff --git a/java/INSTALL b/java/INSTALL index 94bf0b01a96..a4cc97e7710 100644 --- a/java/INSTALL +++ b/java/INSTALL @@ -170,7 +170,7 @@ In normal circumstances, Emacs should automatically detect and configure one of the C++ standard libraries part of the NDK when such a library is required to build a dependency specified under `--with-ndk-path'. -Nevertheless, this process is not infalliable, and with certain versions +Nevertheless, this process is not infallible, and with certain versions of the NDK is liable to fail to locate a C++ compiler, requiring that you run the `make_standalone_toolchain.py' script in the NDK distribution to create a ``standalone toolchain'' and substitute the diff --git a/java/org/gnu/emacs/EmacsDesktopNotification.java b/java/org/gnu/emacs/EmacsDesktopNotification.java index 72569631a8c..2bbfd867afa 100644 --- a/java/org/gnu/emacs/EmacsDesktopNotification.java +++ b/java/org/gnu/emacs/EmacsDesktopNotification.java @@ -83,7 +83,7 @@ public final class EmacsDesktopNotification notification. */ public final String[] actions, titles; - /* Delay in miliseconds after which this notification should be + /* Delay in milliseconds after which this notification should be automatically dismissed. */ public final long delay; diff --git a/java/org/gnu/emacs/EmacsGC.java b/java/org/gnu/emacs/EmacsGC.java index d400c23e067..0b0f09c7ab9 100644 --- a/java/org/gnu/emacs/EmacsGC.java +++ b/java/org/gnu/emacs/EmacsGC.java @@ -55,7 +55,7 @@ public final class EmacsGC extends EmacsHandleObject public EmacsPixmap clip_mask, stipple; public Paint gcPaint; - /* Drawable object for rendering the stiple bitmap. */ + /* Drawable object for rendering the stipple bitmap. */ public EmacsTileObject tileObject; /* ID incremented every time the clipping rectangles of any GC diff --git a/java/org/gnu/emacs/EmacsTileObject.java b/java/org/gnu/emacs/EmacsTileObject.java index a79ae826d51..93b09f5a8bc 100644 --- a/java/org/gnu/emacs/EmacsTileObject.java +++ b/java/org/gnu/emacs/EmacsTileObject.java @@ -27,7 +27,7 @@ import android.graphics.Rect; import android.graphics.Shader.TileMode; -/* This is a crude facsimilie of the BitmapDrawable class implementing +/* This is a crude facsimile of the BitmapDrawable class implementing just enough of its functionality to support displaying stipples in EmacsGC. */ diff --git a/java/org/gnu/emacs/EmacsWindowManager.java b/java/org/gnu/emacs/EmacsWindowManager.java index 23dc71dbd29..03487e853fb 100644 --- a/java/org/gnu/emacs/EmacsWindowManager.java +++ b/java/org/gnu/emacs/EmacsWindowManager.java @@ -137,7 +137,7 @@ interface WindowConsumer /* Don't attach this window to CONSUMER if incompatible. */ && isWindowEligible (consumer, window)) { - /* Permantly bind this window to the consumer. */ + /* Permanently bind this window to the consumer. */ window.attachmentToken = consumer.getAttachmentToken (); window.previouslyAttached = true; consumer.attachWindow (window); @@ -166,7 +166,7 @@ && isWindowEligible (consumer, window)) if (consumer.getAttachedWindow () == null && isWindowEligible (consumer, window)) { - /* Permantly bind this window to the consumer. */ + /* Permanently bind this window to the consumer. */ window.attachmentToken = consumer.getAttachmentToken (); window.previouslyAttached = true; consumer.attachWindow (window); @@ -186,7 +186,7 @@ && isWindowEligible (consumer, window)) intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); /* Intent.FLAG_ACTIVITY_NEW_DOCUMENT is lamentably unavailable on - older systems than Lolipop. */ + older systems than Lollipop. */ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { intent.addFlags (Intent.FLAG_ACTIVITY_NEW_DOCUMENT diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el index 17d9ca938a8..933ee24b620 100644 --- a/lisp/completion-preview.el +++ b/lisp/completion-preview.el @@ -465,7 +465,7 @@ completions list." (funcall efn string status))))) ;; The predicate is meant for the original completion ;; candidates, which may be symbols or cons cells, but - ;; now we only have strings, so it might be unapplicable. + ;; now we only have strings, so it might not be applicable. (props (plist-put props :predicate nil)) (completion-at-point-functions (list (lambda () `(,beg ,end ,col ,@props))))) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 1627294199a..032e49840a8 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -207,7 +207,7 @@ Useful to hook into pass checkers.") ;; cl-macs.el. We can't use `cl-deftype-satisfies' directly as the ;; relation type <-> predicate is not bijective (bug#45576). (defconst comp-known-predicates - ;; FIXME: Auto-generate (most of) it from `cl-deftype-satifies'? + ;; FIXME: Auto-generate (most of) it from `cl-deftype-satisfies'? '((arrayp array) (atom atom) (bool-vector-p bool-vector) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index fda855d2143..fac824d44a4 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2646,7 +2646,7 @@ will be deleted." (message "Nothing to autoremove"))))) (defun package-isolate (packages &optional temp-init) - "Start an uncustomised Emacs and only load a set of PACKAGES. + "Start an uncustomized Emacs and only load a set of PACKAGES. If TEMP-INIT is non-nil, or when invoked with a prefix argument, the Emacs user directory is set to a temporary directory." (interactive diff --git a/lisp/emacs-lisp/track-changes.el b/lisp/emacs-lisp/track-changes.el index 958def17a2f..92d14959763 100644 --- a/lisp/emacs-lisp/track-changes.el +++ b/lisp/emacs-lisp/track-changes.el @@ -177,7 +177,7 @@ This is used to try and detect cases where buffer modifications are \"lost\".") ;; presume that these might be too old to receive fixes, so better not ;; annoy the user too much about errors. (string-match "\\..*\\." emacs-version) - "If non-nil, keep track of errors in `before/after-chage-functions' calls. + "If non-nil, keep track of errors in `before/after-change-functions' calls. The errors are kept in `track-changes--error-log'.") (cl-defun track-changes-register ( signal &key nobefore disjoint immediate) @@ -500,9 +500,9 @@ Details logged to `track-changes--error-log'") (if track-changes--before-clean (progn - ;; Detect disjointness with previous changes here as well, + ;; Detect disjointedness with previous changes here as well, ;; so that if a client calls `track-changes-fetch' all the time, - ;; it doesn't prevent others from getting a disjointness signal. + ;; it doesn't prevent others from getting a disjointedness signal. (when (and track-changes--before-beg (let ((found nil)) (dolist (tracker track-changes--disjoint-trackers) diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el index 6e2ca7ca781..88dad840eaa 100644 --- a/lisp/eshell/em-script.el +++ b/lisp/eshell/em-script.el @@ -85,7 +85,7 @@ This includes when running `eshell-command'." t)))) (defun eshell--source-file (file &optional args subcommand-p) - "Return a Lisp form for executig the Eshell commands in FILE, passing ARGS. + "Return a Lisp form for executing the Eshell commands in FILE, passing ARGS. If SUBCOMMAND-P is non-nil, execute this as a subcommand." (let ((cmd (eshell-parse-command `(:file . ,file)))) (when subcommand-p diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index c7017ee1d70..0fe177d4c60 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -150,7 +150,7 @@ slot, passing the exit status of the redirected command. If PASS-MODE is non-nil, Eshell will pass the redirection mode as an argument (which is the symbol `overwrite', `append' or `insert') to OUTPUT-FUNCTION, which should return the real output function (either an -ordinary function or `eshell-generic-target' as desribed above)." +ordinary function or `eshell-generic-target' as described above)." :version "30.1" :type '(repeat (list (string :tag "Target") diff --git a/lisp/image.el b/lisp/image.el index c155cda125e..c75c8ff765a 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -568,7 +568,7 @@ loaded." (rotation (plist-get props :rotation))) (cond ;; The scale of the image won't be available until - ;; `image_set_transform', and as such, defer to its judgement. + ;; `image_set_transform', and as such, defer to its judgment. ((eq scaling 'default) 'lambda) ;; We always smooth when scaling down and small upwards scaling. ((and scaling (< scaling 2)) @@ -812,7 +812,7 @@ where FILE is the file from which to load the image, and DATA is a string containing the actual image data. If the property `:type TYPE' is omitted or nil, try to determine the image type from its first few bytes of image data. If that doesn't work, and the property `:file -FILE' provide a file name, use its file extension as idication of the +FILE' provide a file name, use its file extension as indication of the image type. If `:type TYPE' is provided, it must match the actual type determined for FILE or DATA by `create-image'. diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 9fb8b8ffaed..b12f3fa4368 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -1424,7 +1424,7 @@ via `dictionary-dictionaries'." ;; This function runs from the tooltip timer. We don't want to ;; signal errors from the timer due to "Unknown server answers", ;; we prefer not to show anything in that case. FIXME: Perhaps - ;; use with-demoted-errors, to show the unknonw answers in the + ;; use with-demoted-errors, to show the unknown answers in the ;; echo-area? (ignore-errors (let* ((word (dictionary-word-at-mouse-event diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 32e24f9e2e5..977210e9cc8 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2463,7 +2463,7 @@ If ERROR-OUT, signal user-error if there are no bookmarks." (defun eww-save-history () "Save the current page's data to the history. -If the current page is a historial one loaded from +If the current page is a historical one loaded from `eww-history' (e.g. by calling `eww-back-url'), this will update the page's entry in `eww-history' and return nil. Otherwise, add a new entry to `eww-history' and return t." diff --git a/lisp/net/tramp-container.el b/lisp/net/tramp-container.el index d0edbfea1e8..f29d55d78d9 100644 --- a/lisp/net/tramp-container.el +++ b/lisp/net/tramp-container.el @@ -168,7 +168,7 @@ If it is nil, the default context will be used." ;;;###tramp-autoload (defcustom tramp-distrobox-program "distrobox" - "Name of the Distrobxx client program." + "Name of the Distrobox client program." :group 'tramp :version "30.1" :type '(choice (const "distrobox") diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 87c1bc0b460..106149f5dce 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2705,7 +2705,7 @@ The method used must be an out-of-band method." (let ((dired (tramp-get-ls-command-with v "--dired"))) (when (stringp switches) (setq switches (split-string switches))) - ;; Newer coreutil versions of ls (9.5 and up) imply long format + ;; Newer coreutils versions of ls (9.5 and up) imply long format ;; output when "--dired" is given. Suppress this implicit rule. (when dired (let ((tem switches) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 21d563d6bfa..5c90f3680c1 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4851,7 +4851,7 @@ a connection-local variable." (defvar tramp-direct-async-process nil "Whether direct asynchronous processes should be used. It is not recommended to change this variable globally. Instead, it -should be set conmnection-local.") +should be set connection-local.") (defun tramp-direct-async-process-p (&rest args) "Whether direct async `make-process' can be called." diff --git a/lisp/outline.el b/lisp/outline.el index 373902e3f59..4d74b30dba4 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1726,7 +1726,7 @@ under `outline-minor-mode' is reverted by `revert-buffer'." (defun outline-revert-buffer-rehighlight () "Rehighlight outlines when reverting buffer under `outline-minor-mode'. -This function rehighlightes outlines after the buffer under +This function rehighlights outlines after the buffer under `outline-minor-mode' is reverted by `revert-buffer' when font-lock can't update highlighting for `outline-minor-mode-highlight'." (when (and outline-minor-mode-highlight diff --git a/lisp/progmodes/c-ts-common.el b/lisp/progmodes/c-ts-common.el index f027fc28c04..3882a697c48 100644 --- a/lisp/progmodes/c-ts-common.el +++ b/lisp/progmodes/c-ts-common.el @@ -291,7 +291,7 @@ and /* */ comments. SOFT works the same as in ;; I want to experiment with explicitly listing out all each cases and ;; handle them separately, as opposed to fiddling with `comment-start' ;; and friends. This will have more duplicate code and will be less - ;; generic, but in the same time might save us from writting cryptic + ;; generic, but in the same time might save us from writing cryptic ;; code to handle all sorts of edge cases. ;; ;; For this command, let's try to make it basic: if the current line diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 2e602658ea7..6301b77beca 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -188,7 +188,7 @@ See `flymake-error-bitmap' and `flymake-warning-bitmap'." The value can be nil (don't indicate errors but just highlight them), fringes (use fringes) or margins (use margins) -Difference between fringes and margin is that fringes support diplaying +Difference between fringes and margin is that fringes support displaying bitmaps on graphical displays and margins display text in a blank area from current buffer that works in both graphical and text displays. @@ -788,7 +788,7 @@ Return to original margin width if ORIG-WIDTH is non-nil." left-margin-width 2) (setq-local flymake--original-margin-width right-margin-width right-margin-width 2)))) - ;; Apply margin to all windows avalaibles + ;; Apply margin to all windows available. (mapc (lambda (x) (set-window-buffer x (window-buffer x))) (get-buffer-window-list nil nil 'visible)))) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 0025f1f9479..beea2b8c1d6 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -2117,7 +2117,7 @@ Such as the current syntax table and the applied syntax properties." ;; Using the temporary buffer is both a performance and a buffer ;; management optimization. (with-current-buffer tmp-buffer - ;; This let is fairly dangerouns, but improves performance + ;; This let is fairly dangerous, but improves performance ;; for large lists, see https://debbugs.gnu.org/53749#227 (let ((inhibit-modification-hooks t)) (erase-buffer) diff --git a/lisp/term/android-win.el b/lisp/term/android-win.el index 3538f41aa84..bab6b6b9ff0 100644 --- a/lisp/term/android-win.el +++ b/lisp/term/android-win.el @@ -305,7 +305,7 @@ names which represent them." (new-uri-list nil) (dnd-unescape-file-uris t)) (dolist (uri uri-list) - ;; If the URI is a preprepared file name, insert it directly. + ;; If the URI is a prepared file name, insert it directly. (if (string-match-p "^/content/by-authority\\(-named\\)?/" uri) (setq uri (concat "file:" uri) dnd-unescape-file-uris nil) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index fe9f5003f0b..a593b6c6241 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -792,7 +792,7 @@ Signal an error if the entire string was not used." (defvar thing-at-point-hexadecimal-regexp "\\(0x\\|#x\\)\\([a-fA-F0-9]+\\)" - "A regexp matchin a hexadecimal number.") + "A regexp matching a hexadecimal number.") ;;;###autoload (defun number-at-point () diff --git a/lisp/transient.el b/lisp/transient.el index c3b9448e2c4..c9b6e457d00 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3645,7 +3645,7 @@ have a history of their own.") (propertize "\n" 'face face 'line-height t)))) (defmacro transient-with-shadowed-buffer (&rest body) - "While in the transient buffer, temporarly make the shadowed buffer current." + "While in the transient buffer, temporarily make the shadowed buffer current." (declare (indent 0) (debug t)) `(with-current-buffer (or transient--shadowed-buffer (current-buffer)) ,@body)) diff --git a/lisp/treesit.el b/lisp/treesit.el index aa3beb86174..bcabf98f1d1 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -830,7 +830,7 @@ t, nil, append, prepend, keep. See more in `treesit-font-lock-rules'.") (defsubst treesit--font-lock-setting-feature (setting) - "Reutrn the feature of SETTING. + "Return the feature of SETTING. SETTING should be a setting in `treesit-font-lock-settings'." (nth 2 setting)) diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 4d2609cbb95..f41c5b07ffa 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -377,7 +377,7 @@ These characters are specified in RFC 3986, Appendix A.") (aset vec ?& nil) (aset vec ?\; nil) vec) - "Allowed-charcter byte mask for keys and values in the query segment of a URI. + "Allowed-character byte mask for keys and values in the query segment of a URI. url-query-allowed-chars minus '=', '&', and ';'.") ;;;###autoload diff --git a/lisp/window-tool-bar.el b/lisp/window-tool-bar.el index 395aa3aa9cc..a9d10650b98 100644 --- a/lisp/window-tool-bar.el +++ b/lisp/window-tool-bar.el @@ -66,7 +66,7 @@ ;; like to also generally make tool bars better. ;; ;; Targeting 0.3: -;; * Properly support reamining less frequently used tool bar item specs. From +;; * Properly support remaining less frequently used tool bar item specs. From ;; `parse_tool_bar_item': ;; * :visible ;; * :filter @@ -102,7 +102,7 @@ ;; lot of garbage. So this benchmarking focuses on garbage ;; generation. Since it has to run after most commands, generating ;; significantly more garbage will cause noticeable performance -;; degration. +;; degradation. ;; ;; The refresh has two steps: ;; @@ -111,7 +111,7 @@ ;; bar string. ;; ;; Additionally, we keep track of the percentage of commands that -;; acutally created a refresh. +;; actually created a refresh. (defvar window-tool-bar--memory-use-delta-step1 (make-list 7 0) "Absolute delta of memory use counters during step 1. This is a list in the same structure as `memory-use-counts'.") diff --git a/src/androidselect.c b/src/androidselect.c index 50982738743..d5783b75417 100644 --- a/src/androidselect.c +++ b/src/androidselect.c @@ -945,7 +945,7 @@ keywords is understood: No more than three actions defined here will be displayed, not counting any with "default" as its key. - :timeout Number of miliseconds from the display of the + :timeout Number of milliseconds from the display of the notification at which it will be automatically dismissed, or a value of zero or smaller if it is to remain until user action is taken to dismiss diff --git a/src/fns.c b/src/fns.c index 48607b2c5d0..371d2ae3a3a 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5359,7 +5359,7 @@ hash_string (char const *ptr, ptrdiff_t len) hash = sxhash_combine (hash, c); } while (p + sizeof hash <= end); - /* Hash the last wordful of bytes in the string, because that is + /* Hash the last word's worth of bytes in the string, because that is is often the part where strings differ. This may cause some bytes to be hashed twice but we assume that's not a big problem. */ EMACS_UINT c; diff --git a/src/itree.c b/src/itree.c index da51b3c61fd..9dae279db90 100644 --- a/src/itree.c +++ b/src/itree.c @@ -1211,7 +1211,7 @@ itree_node_intersects (const struct itree_node *node, `ITER->begin..ITER->end`) so it will also return some nodes which aren't in that narrowing simply because they may have children which are. - The code itself is very unsatifactory because the code of each one + The code itself is very unsatisfactory because the code of each one of the supported traversals seems completely different from the others. If someone knows how to make it more uniform and "obviously correct", please make yourself heard. */ diff --git a/src/json.c b/src/json.c index 140c3625d4d..21066d21328 100644 --- a/src/json.c +++ b/src/json.c @@ -405,7 +405,7 @@ json_out_nest (json_out_t *jo) { --jo->maxdepth; if (jo->maxdepth < 0) - error ("Maximum JSON serialisation depth exceeded"); + error ("Maximum JSON serialization depth exceeded"); } static void diff --git a/src/macros.c b/src/macros.c index 230195d9488..a4df125aafd 100644 --- a/src/macros.c +++ b/src/macros.c @@ -343,14 +343,14 @@ buffer before the macro is executed. */) restore Vexecuting_kbd_macro and executing_kbd_macro_index, and run 'kbd-macro-termination-hook'. - If read_char happens to be called at the end of a macro interation, + If read_char happens to be called at the end of a macro iteration, but before read_key_sequence could handle the end (e.g., when lisp code calls 'read-event', 'read-char', or 'read-char-exclusive'), read_char will simply continue reading other available input (Bug#68272). Vexecuting_kbd_macro and executing_kbd_macro remain untouched until the end of the iteration is handled. - This is similar (in observable behavior) to a posibly simpler + This is similar (in observable behavior) to a possibly simpler implementation of keyboard macros in which this function pushed all characters of the macro into the incoming event queue and returned immediately. Maybe this is the implementation that we ideally diff --git a/src/sort.c b/src/sort.c index dc9f49016aa..24c3e94f50c 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1130,7 +1130,7 @@ tim_sort (Lisp_Object predicate, Lisp_Object keyfunc, keys[i] = call1 (keyfunc, seq[i]); /* FIXME: This is where we would check the keys for interesting - properties for more optimised comparison (such as all being fixnums + properties for more optimized comparison (such as all being fixnums etc). */ /* March over the array once, left to right, finding natural runs, diff --git a/src/xdisp.c b/src/xdisp.c index 3d8651f4086..4df76baf92b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -19173,7 +19173,7 @@ try_scrolling (Lisp_Object window, bool just_this_one_p, /* Maybe forget recorded base line for line number display. */ /* FIXME: Why do we need this? `try_scrolling` can only be called from `redisplay_window` which should have flushed this cache already when - eeded. */ + needed. */ if (!BASE_LINE_NUMBER_VALID_P (w)) w->base_line_number = 0; @@ -35810,7 +35810,7 @@ note_fringe_highlight (struct frame *f, Lisp_Object window, int x, int y, /* NOTE: iterating over glyphs can only find text properties coming from visible text. This means that zero-length overlays and - invisibile text are NOT inspected. */ + invisible text are NOT inspected. */ for (; glyph_num; glyph_num--, glyph++) { Lisp_Object pos = make_fixnum (glyph->charpos); diff --git a/test/lisp/erc/erc-goodies-tests.el b/test/lisp/erc/erc-goodies-tests.el index ead0bf5a979..038434b3880 100644 --- a/test/lisp/erc/erc-goodies-tests.el +++ b/test/lisp/erc/erc-goodies-tests.el @@ -157,7 +157,7 @@ (search-forward "BlackOn") (should (eq (get-text-property (point) 'mouse-face) 'erc-spoiler-face))) - ;; Start wtih ERC default face. + ;; Start with ERC default face. (erc-goodies-tests--assert-face 0 "BEGIN " 'erc-default-face '(fg:erc-color-face0 bg:erc-color-face0)) @@ -168,7 +168,7 @@ ;; Masked in all black. (erc-goodies-tests--assert-face 20 "BlackOnBlack" '(fg:erc-color-face1 bg:erc-color-face1) nil) - ;; Explicit "default" code ignoerd. + ;; Explicit "default" code ignored. (erc-goodies-tests--assert-face 34 "Default" '(erc-default-face) '(fg:erc-color-face1 bg:erc-color-face1)) diff --git a/test/lisp/progmodes/peg-tests.el b/test/lisp/progmodes/peg-tests.el index e666e6f19d2..8fab549bcab 100644 --- a/test/lisp/progmodes/peg-tests.el +++ b/test/lisp/progmodes/peg-tests.el @@ -199,7 +199,7 @@ resp. succeeded instead of signaling an error." ;; peg-ex-parse-int recognizes integers and computes the corresponding ;; value. The grammar is the same as for `peg-ex-recognize-int' -;; augmented with parsing actions. Unfortunaletly, the actions add +;; augmented with parsing actions. Unfortunately, the actions add ;; quite a bit of clutter. ;; ;; The actions for the sign rule push -1 on the stack for a minus sign commit 636461686f1d36388d4523cbb10eb7ec3bbbd63e Author: Yuan Fu Date: Tue Jun 4 21:32:19 2024 -0700 Add manual entry for treesit-primary-parser * doc/lispref/parsing.texi (Multiple Languages): Add entry. * etc/NEWS (Example): Add news. diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index 645aad94a63..c8c2fe80c03 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -1683,16 +1683,34 @@ instead to specify regions of buffer text (i.e., ranges) in which a parser will operate. This section describes functions for setting and getting ranges for a parser. +@cindex primary parser +Generally when there are multiple languages at play, there is a +``primary'', or ``host'' language. The parser for this language---the +@dfn{primary parser}, parses the entire buffer. Parsers for other +languages are ``embedded'' or ``guest'' parsers, which only work on part +of the buffer. The parse tree of the primary parser is usually used to +determine the ranges in which the embedded parsers operate. + +@vindex treesit-primary-parser +Major modes should set @var{treesit-primary-parser} to the primary +parser before calling @code{treesit-major-mode-setup}, so that Emacs can +configure the primary parser correctly for font-lock and other features. + Lisp programs should call @code{treesit-update-ranges} to make sure the ranges for each parser are correct before using parsers in a buffer, and call @code{treesit-language-at} to figure out the language responsible for the text at some position. These two functions don't work by themselves, they need major modes to set -@code{treesit-range-settings} and -@code{treesit-language-at-point-function}, which do the actual work. +@var{treesit-range-settings} and +@var{treesit-language-at-point-function}, which do the actual work. These functions and variables are explained in more detail towards the end of the section. +@b{In short}, multi-language major modes should set +@var{treesit-primary-parser}, @var{treesit-range-settings}, and +@var{treesit-language-at-point-function} before calling +@code{treesit-major-mode-setup}. + @heading Getting and setting ranges @defun treesit-parser-set-included-ranges parser ranges diff --git a/etc/NEWS b/etc/NEWS index 3220a3f16e4..922721f143c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2872,6 +2872,12 @@ only return parsers for that language. If TAG is given, only return parsers with that tag. Note that passing nil as tag doesn't mean return all parsers, but rather "all parsers with no tags". ++++ +*** New variable 'treesit-primary-parser'. +This variable should be set by multi-langauge major modes before calling +'treesit-major-mode-setup', in order for tree-sitter integration +functionalities to operate correctly. + * Changes in Emacs 30.1 on Non-Free Operating Systems commit 2ee3edce3f5de55fc11997f522cbe2f00a4471fd Author: Yuan Fu Date: Tue Jun 4 19:55:33 2024 -0700 Revert "New function treesit-parser-changed-ranges" This reverts commit 996b9576713f9d63ea7ff7e9630a15cb0a0214eb. For reason see 760b54de080. diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index 35ee5cc648d..645aad94a63 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -540,26 +540,6 @@ symbol, rather than a lambda function. This function returns the list of @var{parser}'s notifier functions. @end defun -Sometimes a Lisp program might need to synchronously get the changed -ranges of the last reparse. The function -@code{treesit-parser-changed-ranges} exists for this purpose. It -returns the ranges which were passed to the notifier functions. - -@defun treesit-parser-changed-ranges parser &optional quiet -This function returns the ranges that has been changed since last -reparse. It returns a list of cons cells of the form -@w{@code{(@var{start} . @var{end})}}, where @var{start} and @var{end} -mark the start and the end positions of a range. - -This function should almost always be called immediately after -reparsing. If it's called when there are new buffer edits that hasn't -been reparsed, Emacs signals the @code{treesit-unparsed-edits} error, -unless the optional argument @var{quiet} is non-nil. - -Calling this function multiple times consecutively doesn't change its -return value; it always returns the ranges affected by the last reparse. -@end defun - @node Retrieving Nodes @section Retrieving Nodes @cindex retrieve node, tree-sitter diff --git a/etc/NEWS b/etc/NEWS index 302cd30a135..3220a3f16e4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2872,24 +2872,6 @@ only return parsers for that language. If TAG is given, only return parsers with that tag. Note that passing nil as tag doesn't mean return all parsers, but rather "all parsers with no tags". -+++ -*** New function 'treesit-parser-changed-ranges'. -This function returns buffer regions that are affected by the last -buffer edits. - -*** New function 'treesit-add-font-lock-rules'. -This function helps users to add custom font-lock rules to a tree-sitter -major mode. - ---- -** The variable 'rx-constituents' is now obsolete. -Use 'rx-define', 'rx-let' and 'rx-let-eval' instead. - ---- -** 'defvar-keymap' can specify hints for 'repeat-mode'. -Using ':repeat (:hints ((command . "hint") ...))' will show -the hint string in the echo area together with repeatable keys. - * Changes in Emacs 30.1 on Non-Free Operating Systems diff --git a/src/treesit.c b/src/treesit.c index 52d158b1bf8..d86ab501187 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1017,8 +1017,9 @@ treesit_check_buffer_size (struct buffer *buffer) static Lisp_Object treesit_make_ranges (const TSRange *, uint32_t, struct buffer *); -static Lisp_Object -treesit_get_changed_ranges (TSTree *old_tree, TSTree *new_tree, Lisp_Object parser) +static void +treesit_call_after_change_functions (TSTree *old_tree, TSTree *new_tree, + Lisp_Object parser) { /* If the old_tree is NULL, meaning this is the first parse, the changed range is the whole buffer. */ @@ -1038,13 +1039,7 @@ treesit_get_changed_ranges (TSTree *old_tree, TSTree *new_tree, Lisp_Object pars lisp_ranges = Fcons (Fcons (Fpoint_min (), Fpoint_max ()), Qnil); set_buffer_internal (oldbuf); } - return lisp_ranges; -} -static void -treesit_call_after_change_functions (Lisp_Object lisp_ranges, - Lisp_Object parser) -{ specpdl_ref count = SPECPDL_INDEX (); /* let's trust the after change functions and not clone a new ranges @@ -1096,17 +1091,13 @@ treesit_ensure_parsed (Lisp_Object parser) XTS_PARSER (parser)->tree = new_tree; XTS_PARSER (parser)->need_reparse = false; - Lisp_Object changed_ranges; - changed_ranges = treesit_get_changed_ranges (tree, new_tree, parser); - XTS_PARSER (parser)->last_changed_ranges = changed_ranges; - /* After-change functions should run at the very end, most crucially after need_reparse is set to false, this way if the function calls some tree-sitter function which invokes treesit_ensure_parsed again, it returns early and do not recursively call the after change functions again. (ref:notifier-inside-ensure-parsed) */ - treesit_call_after_change_functions (changed_ranges, parser); + treesit_call_after_change_functions (tree, new_tree, parser); ts_tree_delete (tree); } @@ -1180,7 +1171,6 @@ make_treesit_parser (Lisp_Object buffer, TSParser *parser, lisp_parser->after_change_functions = Qnil; lisp_parser->tag = tag; lisp_parser->last_set_ranges = Qnil; - lisp_parser->last_changed_ranges = Qnil; lisp_parser->buffer = buffer; lisp_parser->parser = parser; lisp_parser->tree = tree; @@ -1828,32 +1818,6 @@ positions. PARSER is the parser issuing the notification. */) return Qnil; } -DEFUN ("treesit-parser-changed-ranges", Ftreesit_parser_changed_ranges, - Streesit_parser_changed_ranges, - 1, 2, 0, - doc: /* Return the buffer regions affected by the last reparse of PARSER. - -Returns a list of cons cells (BEG . END), where each cons cell represents -a region in which changes in buffer contents affected the last reparse. - -This function should almost always be called immediately after -reparsing. If it's called when there are new buffer edits that hasn't -been reparsed, Emacs signals the `treesit-unparsed-edits' error, unless -optional argument QUIET is non-nil. - -Calling this function multiple times consecutively doesn't change its -return value; it always returns the ranges affected by the last -reparse. */) - (Lisp_Object parser, Lisp_Object quiet) -{ - treesit_check_parser (parser); - - if (XTS_PARSER (parser)->need_reparse && NILP (quiet)) - xsignal1 (Qtreesit_unparsed_edits, parser); - - return XTS_PARSER (parser)->last_changed_ranges; -} - /*** Node API */ @@ -4046,7 +4010,6 @@ syms_of_treesit (void) DEFSYM (Qtreesit_query_error, "treesit-query-error"); DEFSYM (Qtreesit_parse_error, "treesit-parse-error"); DEFSYM (Qtreesit_range_invalid, "treesit-range-invalid"); - DEFSYM (Qtreesit_unparsed_edits, "treesit-unparsed_edits"); DEFSYM (Qtreesit_buffer_too_large, "treesit-buffer-too-large"); DEFSYM (Qtreesit_load_language_error, @@ -4075,8 +4038,6 @@ syms_of_treesit (void) define_error (Qtreesit_range_invalid, "RANGES are invalid: they have to be ordered and should not overlap", Qtreesit_error); - define_error (Qtreesit_unparsed_edits, "There are unparsed edits in the buffer", - Qtreesit_error); define_error (Qtreesit_buffer_too_large, "Buffer too large (> 4GiB)", Qtreesit_error); define_error (Qtreesit_load_language_error, @@ -4217,8 +4178,6 @@ the symbol of that THING. For example, (or sexp sentence). */); defsubr (&Streesit_parser_add_notifier); defsubr (&Streesit_parser_remove_notifier); - defsubr (&Streesit_parser_changed_ranges); - defsubr (&Streesit_node_type); defsubr (&Streesit_node_start); defsubr (&Streesit_node_end); diff --git a/src/treesit.h b/src/treesit.h index aa71933fe8d..bb81bf0e2b3 100644 --- a/src/treesit.h +++ b/src/treesit.h @@ -49,9 +49,6 @@ struct Lisp_TS_Parser ranges the users wants to set, and avoid reparse if the new ranges is the same as the last set one. */ Lisp_Object last_set_ranges; - /* The range of buffer content that was affected by the last - re-parse. */ - Lisp_Object last_changed_ranges; /* The buffer associated with this parser. */ Lisp_Object buffer; /* The pointer to the tree-sitter parser. Never NULL. */ commit 24b7bf2746fd7bf097e04c5b9363cab197edbc7c Author: Paul Eggert Date: Tue Jun 4 11:54:24 2024 -0700 More-permanent fix for build with Android NDK r10b * configure.ac (gl_cv_header_working_endian_h): Remove temporary workaround for Android. * lib/endian.in.h: Copy latest version from Gnulib. diff --git a/configure.ac b/configure.ac index 369c9005c61..e3213f4ac79 100644 --- a/configure.ac +++ b/configure.ac @@ -49,12 +49,6 @@ if test "$XCONFIGURE" = "android"; then CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=32" enable_largefile=no enable_year2038=no]) - # Further, endian.h is not guaranteed to define every function that - # Gnulib seeks to replace, but Gnulib tests are not prepared for - # such versions of endian.h as only define a subset of the functions - # whose presence it tests. Force such tests to succeed as a stopgap - # measure. - gl_cv_header_working_endian_h=yes fi dnl Set emacs_config_options to the options of 'configure', quoted for the shell, diff --git a/lib/endian.in.h b/lib/endian.in.h index bd65ae8aaba..156fe49fbda 100644 --- a/lib/endian.in.h +++ b/lib/endian.in.h @@ -69,8 +69,9 @@ _GL_INLINE_HEADER_BEGIN # define BYTE_ORDER LITTLE_ENDIAN #endif -/* Make sure function-like macros get undefined. */ #if @HAVE_ENDIAN_H@ + +/* Make sure we don't have any system definitions. */ # undef be16toh # undef be32toh # undef be64toh @@ -83,6 +84,21 @@ _GL_INLINE_HEADER_BEGIN # undef htole16 # undef htole32 # undef htole64 + +/* Define our own. */ +# define be16toh rpl_endian_be16toh +# define be32toh rpl_endian_be32toh +# define be64toh rpl_endian_be64toh +# define htobe16 rpl_endian_htobe16 +# define htobe32 rpl_endian_htobe32 +# define htobe64 rpl_endian_htobe64 +# define le16toh rpl_endian_le16toh +# define le32toh rpl_endian_le32toh +# define le64toh rpl_endian_le64toh +# define htole16 rpl_endian_htole16 +# define htole32 rpl_endian_htole32 +# define htole64 rpl_endian_htole64 + #endif #ifdef __cplusplus commit 7f415f7d5e19ea3903500426a0724e49271ac699 Author: Juri Linkov Date: Tue Jun 4 19:53:47 2024 +0300 * lisp/outline.el (outline-revert-buffer-rehighlight): New function. (outline-minor-mode): Add 'outline-revert-buffer-rehighlight' to 'revert-buffer-restore-functions'. When mode is disabled, remove hooks from 'revert-buffer-restore-functions' and also from 'after-change-functions'. diff --git a/lisp/outline.el b/lisp/outline.el index 74c679797aa..373902e3f59 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -583,17 +583,17 @@ See the command `outline-mode' for more information on this mode." (add-hook 'revert-buffer-restore-functions #'outline-revert-buffer-restore-visibility nil t) (add-hook 'revert-buffer-restore-functions - (lambda () - (when (and outline-minor-mode outline-minor-mode-highlight - (not (and global-font-lock-mode - (font-lock-specified-p major-mode)))) - (lambda () - (outline-minor-mode-highlight-buffer)))) - nil t) + #'outline-revert-buffer-rehighlight nil t) (setq-local line-move-ignore-invisible t) ;; Cause use of ellipses for invisible text. (add-to-invisibility-spec '(outline . t)) (outline-apply-default-state)) + (remove-hook 'after-change-functions + #'outline--fix-buttons-after-change t) + (remove-hook 'revert-buffer-restore-functions + #'outline-revert-buffer-restore-visibility t) + (remove-hook 'revert-buffer-restore-functions + #'outline-revert-buffer-rehighlight t) (setq line-move-ignore-invisible nil) ;; Cause use of ellipses for invisible text. (remove-from-invisibility-spec '(outline . t)) @@ -1724,6 +1724,17 @@ under `outline-minor-mode' is reverted by `revert-buffer'." (lambda () (outline-hide-by-heading-regexp regexp))))) +(defun outline-revert-buffer-rehighlight () + "Rehighlight outlines when reverting buffer under `outline-minor-mode'. +This function rehighlightes outlines after the buffer under +`outline-minor-mode' is reverted by `revert-buffer' when font-lock +can't update highlighting for `outline-minor-mode-highlight'." + (when (and outline-minor-mode-highlight + (not (and global-font-lock-mode + (font-lock-specified-p major-mode)))) + (lambda () + (outline-minor-mode-highlight-buffer)))) + ;;; Visibility cycling commit 00d7845953b85345b031fa571396196d6844610c Author: Eli Zaretskii Date: Tue Jun 4 19:32:25 2024 +0300 ; * lisp/outline.el (outline-revert-buffer-restore-visibility): Doc fix. diff --git a/lisp/outline.el b/lisp/outline.el index 80621c78b3b..74c679797aa 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1716,7 +1716,9 @@ for example, after reverting the buffer." (nreverse headings) "\\|")))) (defun outline-revert-buffer-restore-visibility () - "Preserve visibility of outlines in `outline-minor-mode' for `revert-buffer'." + "Preserve visibility when reverting buffer under `outline-minor-mode'. +This function restores the visibility of outlines after the buffer +under `outline-minor-mode' is reverted by `revert-buffer'." (let ((regexp (outline-hidden-headings-regexp))) (when regexp (lambda () commit 43c354a0004145c04bbc6adf0cfaa8c21403ad8c Author: Eli Zaretskii Date: Tue Jun 4 19:12:38 2024 +0300 Fix the build with mingw.org's MinGW The change in boot-time.c imported from Gnulib broke the MinGW build using mingw.org's MinGW. It is wrong to include sysinfoapi.h, MS documentation says to include . * lib/boot-time.c: Don't include sysinfoapi.h. diff --git a/lib/boot-time.c b/lib/boot-time.c index 71562dcf751..515fc48069a 100644 --- a/lib/boot-time.c +++ b/lib/boot-time.c @@ -46,7 +46,6 @@ #if defined _WIN32 && ! defined __CYGWIN__ # define WIN32_LEAN_AND_MEAN # include -# include # include #endif commit 3656a81850e5fddd429b5bd91d06987185ddd6d6 Author: Robert Pluim Date: Tue Jun 4 15:56:41 2024 +0200 ; * src/cm.c (cmcheckmagic): Typo fix. diff --git a/src/cm.c b/src/cm.c index 85fc3e776c8..c6c64d95a2a 100644 --- a/src/cm.c +++ b/src/cm.c @@ -111,8 +111,8 @@ addcol (tty, n) { void cmcheckmagic (struct tty_display_info *tty) { - /* If we have unhandled SIGWINCH, we don't really know what are our - up-to-date frame diumensions. */ + /* If we have an unhandled SIGWINCH, we don't really know what our + up-to-date frame dimensions are. */ if (frame_size_change_delayed ()) return; if (curX (tty) == FrameCols (tty)) commit 820bc42357ede73aa667f4bc842ac2fb3d35973c Author: Ulrich Müller Date: Tue Jun 4 13:29:56 2024 +0200 Update Calc units table * lisp/calc/calc-units.el (math-standard-units): Update to 2022 CODATA adjustment. diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index fba2b9c50fb..2f86d7d0529 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -46,9 +46,9 @@ ;; Updated November 2018 for the redefinition of the SI ;; https://www.bipm.org/en/committees/cg/cgpm/26-2018/resolution-1 -;; CODATA values last updated November 2023, using 2018 adjustment: -;; E. Tiesinga, P. J. Mohr, D. B. Newell, and B. N. Taylor, -;; Rev. Mod. Phys. 93, 025010 (2021) +;; CODATA values last updated June 2024, using 2022 adjustment: +;; P. J. Mohr, E. Tiesinga, D. B. Newell, and B. N. Taylor (2024-05-08), +;; https://pml.nist.gov/cuu/Constants/ (defvar math-standard-units '( ;; Length @@ -143,8 +143,8 @@ "31.10347680 g") ;; ESUWM, 1/12 exact value for lbt ( ct "(2/10) g" "Carat" nil "0.2 g") ;; ESUWM - ( u "1.66053906660*10^(-27) kg" "Unified atomic mass" nil - "1.66053906660 10^-27 kg (*)") ;; (approx) CODATA + ( u "1.66053906892*10^(-27) kg" "Unified atomic mass" nil + "1.66053906892 10^-27 kg (*)") ;; (approx) CODATA ;; Force ( N "m kg/s^2" "*Newton" ) @@ -281,32 +281,32 @@ ( μ0 "mu0" "Permeability of vacuum") ( G "6.67430*10^(-11) m^3/(kg s^2)" "Gravitational constant" nil "6.67430 10^-11 m^3/(kg s^2) (*)") - ( me "9.1093837015*10^(-31) kg" "Electron rest mass" nil - "9.1093837015 10^-31 kg (*)") - ( mp "1.67262192369*10^(-27) kg" "Proton rest mass" nil - "1.67262192369 10^-27 kg (*)") - ( mn "1.67492749804*10^(-27) kg" "Neutron rest mass" nil - "1.67492749804 10^-27 kg (*)") + ( me "9.1093837139*10^(-31) kg" "Electron rest mass" nil + "9.1093837139 10^-31 kg (*)") + ( mp "1.67262192595*10^(-27) kg" "Proton rest mass" nil + "1.67262192595 10^-27 kg (*)") + ( mn "1.67492750056*10^(-27) kg" "Neutron rest mass" nil + "1.67492750056 10^-27 kg (*)") ( mmu "1.883531627*10^(-28) kg" "Muon rest mass" nil "1.883531627 10^-28 kg (*)") ( mμ "mmu" "Muon rest mass" nil "1.883531627 10^-28 kg (*)") - ( Ryd "10973731.568160 /m" "Rydberg constant" nil - "10973731.568160 /m (*)") + ( Ryd "10973731.568157 /m" "Rydberg constant" nil + "10973731.568157 /m (*)") ( sigma "2 pi^5 k^4 / (15 h^3 c^2)" "Stefan-Boltzmann constant") ( σ "sigma" "Stefan-Boltzmann constant") - ( alpha "7.2973525693*10^(-3)" "Fine structure constant" nil - "7.2973525693 10^-3 (*)") + ( alpha "7.2973525643*10^(-3)" "Fine structure constant" nil + "7.2973525643 10^-3 (*)") ( α "alpha" "Fine structure constant" nil - "7.2973525693 10^-3 (*)") - ( muB "9.2740100783*10^(-24) J/T" "Bohr magneton" nil - "9.2740100783 10^-24 J/T (*)") - ( muN "5.0507837461*10^(-27) J/T" "Nuclear magneton" nil - "5.0507837461 10^-27 J/T (*)") - ( mue "-9.2847647043*10^(-24) J/T" "Electron magnetic moment" nil - "-9.2847647043 10^-24 J/T (*)") - ( mup "1.41060679736*10^(-26) J/T" "Proton magnetic moment" nil - "1.41060679736 10^-26 J/T (*)") + "7.2973525643 10^-3 (*)") + ( muB "9.2740100657*10^(-24) J/T" "Bohr magneton" nil + "9.2740100657 10^-24 J/T (*)") + ( muN "5.0507837393*10^(-27) J/T" "Nuclear magneton" nil + "5.0507837393 10^-27 J/T (*)") + ( mue "-9.2847646917*10^(-24) J/T" "Electron magnetic moment" nil + "-9.2847646917 10^-24 J/T (*)") + ( mup "1.41060679545*10^(-26) J/T" "Proton magnetic moment" nil + "1.41060679545 10^-26 J/T (*)") ( R0 "Nav k" "Molar gas constant" ) ( V0 "R0 273.15 K / 10^5 Pa" "Standard volume of ideal gas" ) ;; IUPAC 1982 standard temperature and pressure commit d3bdf11d808d32de8bee54a14c73f72c834a31bb Author: Po Lu Date: Tue Jun 4 16:21:58 2024 +0800 Temporarily repair build with Android NDK r10b * configure.ac (gl_cv_header_working_endian_h): Unconditionally define to yes on Android. diff --git a/configure.ac b/configure.ac index e3213f4ac79..369c9005c61 100644 --- a/configure.ac +++ b/configure.ac @@ -49,6 +49,12 @@ if test "$XCONFIGURE" = "android"; then CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=32" enable_largefile=no enable_year2038=no]) + # Further, endian.h is not guaranteed to define every function that + # Gnulib seeks to replace, but Gnulib tests are not prepared for + # such versions of endian.h as only define a subset of the functions + # whose presence it tests. Force such tests to succeed as a stopgap + # measure. + gl_cv_header_working_endian_h=yes fi dnl Set emacs_config_options to the options of 'configure', quoted for the shell, commit 14d401167d07245077bfd0bc492287d0f7a1d605 Author: Po Lu Date: Tue Jun 4 15:16:01 2024 +0800 Correct previous change * msdos/sedlibmk.inp (NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H) (NEXT_ENDIAN_H): Define to machine/endian.h. diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 8a2b23c93a5..18f9d911c56 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -289,7 +289,7 @@ s/@PACKAGE@/emacs/ /^MKDIR_P *=/s/@MKDIR_P@/echo/ /^NEXT_AS_FIRST_DIRECTIVE_DIRENT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@// -/^NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H *=/s/@[^@\n]*@// +/^NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H *=/s/@[^@\n]*@// @@ -308,7 +308,7 @@ s/@PACKAGE@/emacs/ /^NEXT_DIRENT_H *=/s/@[^@\n]*@// /^NEXT_DIRENT_H *=/s/@[^@\n]*@// /^NEXT_ERRNO_H *=/s/@[^@\n]*@// -/^NEXT_ENDIAN_H *=/s/@[^@\n]*@// +/^NEXT_ENDIAN_H *=/s/@[^@\n]*@// /^NEXT_FCNTL_H *=/s/@[^@\n]*@// /^NEXT_FLOAT_H *=/s/@[^@\n]*@// /^NEXT_GETOPT_H *=/s/@[^@\n]*@// commit c826acd4e1e812453ee71c32748dc3b02df6dd54 Author: Po Lu Date: Tue Jun 4 15:12:18 2024 +0800 Fix the DJGPP build * config.bat: Update endian.in-h from endian.in.h. * msdos/sedlibmk.inp (HAVE_ENDIAN_H) (NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H, NEXT_ENDIAN_H, ENDIAN_H) (ENDIAN_H_JUST_MISSING_STDINT, GL_GENERATE_ENDIAN_H_CONDITION): Define appropriately for DJGPP. diff --git a/config.bat b/config.bat index 20dbfda5548..36bc5a022f2 100644 --- a/config.bat +++ b/config.bat @@ -280,6 +280,7 @@ If Exist assert.in.h update assert.in.h assert.in-h If Exist byteswap.in.h update byteswap.in.h byteswap.in-h If Exist dirent.in.h update dirent.in.h dirent.in-h If Exist errno.in.h update errno.in.h errno.in-h +If Exist endian.in.h update endian.in.h endian.in-h If Exist execinfo.in.h update execinfo.in.h execinfo.in-h If Exist fcntl.in.h update fcntl.in.h fcntl.in-h If Exist getopt.in.h update getopt.in.h getopt.in-h diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index d0b2da08656..8a2b23c93a5 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -219,6 +219,7 @@ s/@PACKAGE@/emacs/ /^HAVE_DECL_STRTOUMAX *=/s/@HAVE_DECL_STRTOUMAX@/1/ /^HAVE_DIRENT_H *=/s/@HAVE_DIRENT_H@/1/ /^HAVE_DUP2 *=/s/@HAVE_DUP2@/1/ +/^HAVE_ENDIAN_H *=/s/@HAVE_ENDIAN_H@/1/ /^HAVE_FSYNC *=/s/@HAVE_FSYNC@/1/ /^HAVE_FTRUNCATE *=/s/@HAVE_FTRUNCATE@/1/ /^HAVE_GETHOSTNAME *=/s/@HAVE_GETHOSTNAME@/1/ @@ -288,6 +289,7 @@ s/@PACKAGE@/emacs/ /^MKDIR_P *=/s/@MKDIR_P@/echo/ /^NEXT_AS_FIRST_DIRECTIVE_DIRENT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@// +/^NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H *=/s/@[^@\n]*@// @@ -306,6 +308,7 @@ s/@PACKAGE@/emacs/ /^NEXT_DIRENT_H *=/s/@[^@\n]*@// /^NEXT_DIRENT_H *=/s/@[^@\n]*@// /^NEXT_ERRNO_H *=/s/@[^@\n]*@// +/^NEXT_ENDIAN_H *=/s/@[^@\n]*@// /^NEXT_FCNTL_H *=/s/@[^@\n]*@// /^NEXT_FLOAT_H *=/s/@[^@\n]*@// /^NEXT_GETOPT_H *=/s/@[^@\n]*@// @@ -342,6 +345,8 @@ s/@PACKAGE@/emacs/ /^ALLOCA_H *=/s/@[^@\n]*@/alloca.h/ /^BYTESWAP_H *=/s/@[^@\n]*@/byteswap.h/ /^DIRENT_H *=/s/@[^@\n]*@// +/^ENDIAN_H *=/s/@[^@\n]*@/endian.h/ +/^ENDIAN_H_JUST_MISSING_STDINT *=/s/@[^@\n]*@/1/ /^ERRNO_H *=/s/@[^@\n]*@// /^EXECINFO_H *=/s/@[^@\n]*@/execinfo.h/ /^FLOAT_H *=/s/@[^@\n]*@// @@ -436,6 +441,7 @@ s/@echo /@djecho / s/= @GL_GENERATE_ASSERT_H_CONDITION@/= 1/ s/= @GL_GENERATE_ALLOCA_H_CONDITION@/= 1/ s/= @GL_GENERATE_BYTESWAP_H_CONDITION@/= 1/ +s/= @GL_GENERATE_ENDIAN_H_CONDITION@/= 1/ s/= @GL_GENERATE_EXECINFO_H_CONDITION@/= 1/ s/= @GL_GENERATE_IEEE754_H_CONDITION@/= 1/ s/= @GL_GENERATE_STDALIGN_H_CONDITION@/= 1/