aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2024-10-12 05:53:27 -0400
committerEli Zaretskii2024-10-12 05:53:27 -0400
commitbb5b25181ea7a4393f019dc641a981bdb6687c62 (patch)
tree678a5f622075e4cb031764d67af0ec620276fd5d
parent16e835171a8ce388e581174925e47263e864727d (diff)
parent0f8f0773183a07a229b23d3f970723ceb9585aef (diff)
downloademacs-bb5b25181ea7a4393f019dc641a981bdb6687c62.tar.gz
emacs-bb5b25181ea7a4393f019dc641a981bdb6687c62.zip
Merge from origin/emacs-30
0f8f0773183 ; * doc/emacs/search.texi (Word Search): Document 'dictio... fb155bcfb6f ; * lisp/emacs-lisp/chart.el (chart-bar-quickie): Doc fix. 6dbe4e99ac4 ; * lisp/emacs-lisp/chart.el (chart-bar-quickie): Improve... d664227f81a ; More accurate documentation of 'file-newer-than-file-p' e49b479f869 Fix c-ts-mode indentation for initializer lists (bug#73661) f520008744b Avoid segfaults in Rmail-MIME 6a5c2edd84f Eglot: use :immediate t when resolving completions (bug#7... cd36e070c24 Eglot: minor changes to doc and docstrings 1ea0d9b891b Revert "Set treesit-primary-parser for tree-sitter modes" 52746ceb625 Remove duplicate indent rules in elixir-ts-mode ed57faafc74 Set treesit-primary-parser for tree-sitter modes 37a6c859b04 ; * lisp/emacs-lisp/cl-macs.el (cl-once-only): Fix capita... 2d4d6dc43a4 Delete XIE X extension from TODO
-rw-r--r--doc/emacs/search.texi40
-rw-r--r--doc/lispref/files.texi3
-rw-r--r--doc/misc/eglot.texi28
-rw-r--r--etc/TODO3
-rw-r--r--lisp/emacs-lisp/chart.el17
-rw-r--r--lisp/emacs-lisp/cl-macs.el2
-rw-r--r--lisp/mail/rmailmm.el12
-rw-r--r--lisp/progmodes/c-ts-mode.el9
-rw-r--r--lisp/progmodes/eglot.el12
-rw-r--r--lisp/progmodes/elixir-ts-mode.el3
-rw-r--r--src/coding.c4
-rw-r--r--src/fileio.c3
-rw-r--r--test/lisp/progmodes/c-ts-mode-resources/indent.erts39
13 files changed, 135 insertions, 40 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 3b52385347b..f23dc1fdb51 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -792,6 +792,46 @@ search engine whose @acronym{URL} is specified by the variable
792Wowser Manual}). If the region is not active, or doesn't contain any 792Wowser Manual}). If the region is not active, or doesn't contain any
793words, this command prompts the user for a URL or keywords to search. 793words, this command prompts the user for a URL or keywords to search.
794 794
795@findex dictionary-search
796@findex dictionary
797@findex dictionary-tooltip-mode
798@cindex dictionary server protocol (DICT)
799@cindex word definition search
800@vindex dictionary-server
801 You can also search for definitions of a word by querying dictionary
802servers via the @sc{dict} protocol defined by @acronym{RFC} 2229. Emacs
803includes a client for this protocol. Type @w{@kbd{M-x dictionary-search
804@key{RET}}} to connect to a @sc{dict} server and ask it to provide the
805available definitions of a word. This command prompts for the word to
806look up, using the word at point as the default, then asks the @sc{dict}
807server to provide the definitions of that word in one or more
808dictionaries. By default, the command first tries to connect to the
809@sc{dict} server installed on the local host, and if that fails, it
810tries @file{dict.org} after your confirmation; customize the variable
811@code{dictionary-server} to specify, as a string, the URL of a single
812server to use (use @samp{localhost} if you want to query only the local
813server). Normally, @code{dictionary-search} tells the server to look up
814the word in all the dictionaries available to the server, but if you
815invoke the command with a prefix argument, it will prompt for a single
816dictionary to look. The list of dictionaries available to a server can
817be displayed by pressing the @samp{Select dictionary} button shown in
818the @file{*Dictionary*} buffer, described below.
819
820 First time you use @code{dictionary-search}, it creates a new
821@file{*Dictionary*} buffer and turns on a special mode in it. The
822buffer shows buttons for selecting a dictionary, searching a definition
823of another word, etc. Subsequent @code{dictionary-search} commands
824reuse this buffer. To create another such buffer (e.g., too look up
825other words, perhaps in another dictionary), type @w{@kbd{M-x dictionary
826@key{RET}}}.
827
828 If you turn on @code{dictionary-tooltip-mode} in a buffer, Emacs will
829look up the definitions of the word at mouse pointer and show those
830definitions in a tool tip. This is handy when you are reading text with
831many words about whose meaning you are unsure.
832
833 For other options of dictionary-search, see the @code{dictionary}
834customization group (@pxref{Specific Customization}).
795 835
796@node Symbol Search 836@node Symbol Search
797@section Symbol Search 837@section Symbol Search
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 70db8521481..5c63f192447 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1299,7 +1299,8 @@ and modification.
1299This function returns @code{t} if the file @var{filename1} is 1299This function returns @code{t} if the file @var{filename1} is
1300newer than file @var{filename2}. If @var{filename1} does not 1300newer than file @var{filename2}. If @var{filename1} does not
1301exist, it returns @code{nil}. If @var{filename1} does exist, but 1301exist, it returns @code{nil}. If @var{filename1} does exist, but
1302@var{filename2} does not, it returns @code{t}. 1302@var{filename2} does not, it returns @code{t}. Otherwise, it compares
1303the times of last modification of the files.
1303 1304
1304In the following example, assume that the file @file{aug-19} was written 1305In the following example, assume that the file @file{aug-19} was written
1305on the 19th, @file{aug-20} was written on the 20th, and the file 1306on the 19th, @file{aug-20} was written on the 20th, and the file
diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi
index fb5b618bd84..959bbfa6857 100644
--- a/doc/misc/eglot.texi
+++ b/doc/misc/eglot.texi
@@ -123,14 +123,16 @@ Here's how to start using Eglot with your programming project:
123@item 123@item
124Select and install a language server. 124Select and install a language server.
125 125
126Eglot comes pre-configured with many popular language servers, see the 126Eglot comes pre-configured for many popular language servers, see the
127value of @code{eglot-server-programs}. If the server(s) mentioned 127value of @code{eglot-server-programs}. If the server(s) mentioned there
128there satisfy your needs for the programming language(s) with which 128satisfy your needs for the programming language(s) with which you want
129you want to use Eglot, you just need to make sure those servers are 129to use Eglot, you just need to make sure those servers are installed on
130installed on your system. Alternatively, install one or more servers 130your system and Eglot can find them.
131of your choice and add them to the value of 131
132Alternatively, install one or more servers of your choice and tell Eglot
133where to find them. To do that, you may add to the value of
132@code{eglot-server-programs}, as described in @ref{Setting Up LSP 134@code{eglot-server-programs}, as described in @ref{Setting Up LSP
133Servers}. 135Servers} or have Eglot prompt you about it (@pxref{Eglot Commands}).
134 136
135@item 137@item
136Turn on Eglot for your project. 138Turn on Eglot for your project.
@@ -197,7 +199,7 @@ particular server(s) you want to install.
197 199
198To use a language server, Eglot must know how to start it and which 200To use a language server, Eglot must know how to start it and which
199programming languages each server supports. This information is 201programming languages each server supports. This information is
200provided by the variable @code{eglot-server-programs}. 202commonly provided by the variable @code{eglot-server-programs}.
201 203
202@defvar eglot-server-programs 204@defvar eglot-server-programs
203This variable associates major modes with names and command-line 205This variable associates major modes with names and command-line
@@ -939,12 +941,16 @@ to @w{@code{(disallow-non-standard-keys enforce-required-keys)}}.
939 941
940@vindex eglot-server-initialized-hook 942@vindex eglot-server-initialized-hook
941@item eglot-server-initialized-hook 943@item eglot-server-initialized-hook
942A hook run after the server object is successfully initialized. 944A hook run after the server object is successfully initialized (which
945includes launching the process) but before any LSP communication is
946attempted. Each function receives a @code{eglot-lsp-server} instance as
947argument.
943 948
944@vindex eglot-connect-hook 949@vindex eglot-connect-hook
945@item eglot-connect-hook 950@item eglot-connect-hook
946A hook run after connection to the server is successfully 951A hook run after the LSP connection to the server is successfully
947established. @xref{Starting Eglot}. 952established. Each function receives a @code{eglot-lsp-server} instance
953as argument. @xref{Starting Eglot}.
948 954
949@item eglot-managed-mode-hook 955@item eglot-managed-mode-hook
950A hook run after Eglot started or stopped managing a buffer. 956A hook run after Eglot started or stopped managing a buffer.
diff --git a/etc/TODO b/etc/TODO
index 756ce49e2a4..f9918fede38 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -788,9 +788,6 @@ to ASCII.
788 788
789*** Provide a user friendly interface to specify fonts 789*** Provide a user friendly interface to specify fonts
790 790
791** Use the XIE X extension, if available, for image display
792This is obsolete, as XIE itself is now considered obsolete.
793
794** Make monochrome images honor the face 791** Make monochrome images honor the face
795Display those images using the foreground and background colors of the 792Display those images using the foreground and background colors of the
796applicable faces. 793applicable faces.
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index 3acf2588f24..ac2e0645f96 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -574,13 +574,16 @@ R1 and R2 are dotted pairs. Colorize it with FACE."
574 574
575(defun chart-bar-quickie (dir title namelst nametitle numlst numtitle 575(defun chart-bar-quickie (dir title namelst nametitle numlst numtitle
576 &optional max sort-pred) 576 &optional max sort-pred)
577 "Wash over the complex EIEIO stuff and create a nice bar chart. 577 "Create a bar chart named TITLE in direction DIR [`horizontal' `vertical'].
578Create it going in direction DIR [`horizontal' `vertical'] with TITLE 578NAMELST is the list of bar names and NAMETITLE is the name the of axis
579using a name sequence NAMELST labeled NAMETITLE with values NUMLST 579containing them.
580labeled NUMTITLE. 580NUMLST is the list of values and NUMTITLE is the name of the value
581Optional arguments: 581axis.
582Set the chart's max element display to MAX, and sort lists with 582Optional argument MAX limits the chart's max element display to MAX by
583SORT-PRED if desired." 583passing it as second argument to `chart-trim', otherwise the chart's
584display is unlimited.
585Optional argument SORT-PRED is a predicate function passed as second
586argument to `chart-sort' to sort the lists if desired."
584 (let ((nc (make-instance 'chart-bar 587 (let ((nc (make-instance 'chart-bar
585 :title title 588 :title title
586 :key-label "8-m" ; This is a text key pic 589 :key-label "8-m" ; This is a text key pic
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 2e501005bf7..b37f744b175 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2505,7 +2505,7 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...).
2505(defmacro cl-once-only (names &rest body) 2505(defmacro cl-once-only (names &rest body)
2506 "Generate code to evaluate each of NAMES just once in BODY. 2506 "Generate code to evaluate each of NAMES just once in BODY.
2507 2507
2508This macro helps with writing other macros. Each of names is 2508This macro helps with writing other macros. Each of NAMES is
2509either (NAME FORM) or NAME, which latter means (NAME NAME). 2509either (NAME FORM) or NAME, which latter means (NAME NAME).
2510During macroexpansion, each NAME is bound to an uninterned 2510During macroexpansion, each NAME is bound to an uninterned
2511symbol. The expansion evaluates each FORM and binds it to the 2511symbol. The expansion evaluates each FORM and binds it to the
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index a5ce5b65cd7..d86e48e6281 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -579,11 +579,13 @@ HEADER is a header component of a MIME-entity object (see
579 (ignore-errors (base64-decode-region pos (point)))) 579 (ignore-errors (base64-decode-region pos (point))))
580 ((string= transfer-encoding "quoted-printable") 580 ((string= transfer-encoding "quoted-printable")
581 (quoted-printable-decode-region pos (point)))))) 581 (quoted-printable-decode-region pos (point))))))
582 (decode-coding-region 582 ;; If the text is empty, we don't have anything to decode.
583 pos (point) 583 (and (/= pos (point))
584 ;; Use -dos decoding, to remove ^M characters left from base64 or 584 (decode-coding-region
585 ;; rogue qp-encoded text. 585 pos (point)
586 (coding-system-change-eol-conversion coding-system 1)) 586 ;; Use -dos decoding, to remove ^M characters left from base64
587 ;; or rogue qp-encoded text.
588 (coding-system-change-eol-conversion coding-system 1)))
587 (if (and 589 (if (and
588 (or (not rmail-mime-coding-system) (consp rmail-mime-coding-system)) 590 (or (not rmail-mime-coding-system) (consp rmail-mime-coding-system))
589 (not (eq (coding-system-base coding-system) 'us-ascii))) 591 (not (eq (coding-system-base coding-system) 'us-ascii)))
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 303c994637c..3f6a7422aa0 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -338,10 +338,13 @@ characters of the current line."
338 ;; If the start of the previous sibling isn't at the 338 ;; If the start of the previous sibling isn't at the
339 ;; beginning of a line, something's probably not quite 339 ;; beginning of a line, something's probably not quite
340 ;; right, go a step further. (E.g., comment after a 340 ;; right, go a step further. (E.g., comment after a
341 ;; statement.) 341 ;; statement.) If the previous sibling is the first named
342 ;; node then anchor to that, e.g. when returning an aggregate
343 ;; and starting the items on the same line as {.
342 (_ (goto-char (treesit-node-start prev-sibling)) 344 (_ (goto-char (treesit-node-start prev-sibling))
343 (if (looking-back (rx bol (* whitespace)) 345 (if (or (looking-back (rx bol (* whitespace))
344 (line-beginning-position)) 346 (line-beginning-position)))
347 (null (treesit-node-prev-sibling prev-sibling t))
345 (setq continue nil) 348 (setq continue nil)
346 (setq prev-sibling 349 (setq prev-sibling
347 (treesit-node-prev-sibling prev-sibling))))))) 350 (treesit-node-prev-sibling prev-sibling)))))))
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 3c0c23f1c45..0a1f9ee4481 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1480,18 +1480,21 @@ Use current server's or first available Eglot events buffer."
1480 1480
1481(defvar eglot-connect-hook 1481(defvar eglot-connect-hook
1482 '(eglot-signal-didChangeConfiguration) 1482 '(eglot-signal-didChangeConfiguration)
1483 "Hook run after connecting in `eglot--connect'.") 1483 "Hook run after connecting to a server.
1484Each function is passed an `eglot-lsp-server' instance
1485as argument.")
1484 1486
1485(defvar eglot-server-initialized-hook 1487(defvar eglot-server-initialized-hook
1486 '() 1488 '()
1487 "Hook run after a `eglot-lsp-server' instance is created. 1489 "Hook run after a `eglot-lsp-server' instance is created.
1488 1490
1489That is before a connection was established. Use 1491That is before a connection is established. Use
1490`eglot-connect-hook' to hook into when a connection was 1492`eglot-connect-hook' to hook into when a connection was
1491successfully established and the server on the other side has 1493successfully established and the server on the other side has
1492received the initializing configuration. 1494received the initializing configuration.
1493 1495
1494Each function is passed the server as an argument") 1496Each function is passed an `eglot-lsp-server' instance
1497as argument.")
1495 1498
1496(defun eglot--cmd (contact) 1499(defun eglot--cmd (contact)
1497 "Helper for `eglot--connect'." 1500 "Helper for `eglot--connect'."
@@ -3232,7 +3235,8 @@ for which LSP on-type-formatting should be requested."
3232 :resolveProvider) 3235 :resolveProvider)
3233 (plist-get lsp-comp :data)) 3236 (plist-get lsp-comp :data))
3234 (eglot--request server :completionItem/resolve 3237 (eglot--request server :completionItem/resolve
3235 lsp-comp :cancel-on-input t) 3238 lsp-comp :cancel-on-input t
3239 :immediate t)
3236 lsp-comp)))))) 3240 lsp-comp))))))
3237 (when (and (consp eglot--capf-session) 3241 (when (and (consp eglot--capf-session)
3238 (= (car bounds) (car (nth 0 eglot--capf-session))) 3242 (= (car bounds) (car (nth 0 eglot--capf-session)))
diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el
index a3e11658468..cacdb266298 100644
--- a/lisp/progmodes/elixir-ts-mode.el
+++ b/lisp/progmodes/elixir-ts-mode.el
@@ -734,9 +734,6 @@ Return nil if NODE is not a defun node or doesn't have a name."
734 (when (treesit-ready-p 'heex) 734 (when (treesit-ready-p 'heex)
735 (setq-local treesit-range-settings elixir-ts--treesit-range-rules) 735 (setq-local treesit-range-settings elixir-ts--treesit-range-rules)
736 736
737 (setq-local treesit-simple-indent-rules
738 (append treesit-simple-indent-rules heex-ts--indent-rules))
739
740 (setq-local treesit-font-lock-settings 737 (setq-local treesit-font-lock-settings
741 (append treesit-font-lock-settings 738 (append treesit-font-lock-settings
742 heex-ts--font-lock-settings)) 739 heex-ts--font-lock-settings))
diff --git a/src/coding.c b/src/coding.c
index 547fcbb8120..cd5a12972e6 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5270,7 +5270,9 @@ decode_coding_raw_text (struct coding_system *coding)
5270 coding->chars_at_source = 1; 5270 coding->chars_at_source = 1;
5271 coding->consumed_char = coding->src_chars; 5271 coding->consumed_char = coding->src_chars;
5272 coding->consumed = coding->src_bytes; 5272 coding->consumed = coding->src_bytes;
5273 if (eol_dos && coding->source[coding->src_bytes - 1] == '\r') 5273 if (eol_dos
5274 && coding->src_bytes > 0 /* empty source text? */
5275 && coding->source[coding->src_bytes - 1] == '\r')
5274 { 5276 {
5275 coding->consumed_char--; 5277 coding->consumed_char--;
5276 coding->consumed--; 5278 coding->consumed--;
diff --git a/src/fileio.c b/src/fileio.c
index 212d2ce6f98..291c316102f 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3788,7 +3788,8 @@ DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "",
3788DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_p, 2, 2, 0, 3788DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_p, 2, 2, 0,
3789 doc: /* Return t if file FILE1 is newer than file FILE2. 3789 doc: /* Return t if file FILE1 is newer than file FILE2.
3790If FILE1 does not exist, the answer is nil; 3790If FILE1 does not exist, the answer is nil;
3791otherwise, if FILE2 does not exist, the answer is t. */) 3791otherwise, if FILE2 does not exist, the answer is t.
3792For existing files, this compares their last-modified times. */)
3792 (Lisp_Object file1, Lisp_Object file2) 3793 (Lisp_Object file1, Lisp_Object file2)
3793{ 3794{
3794 struct stat st1, st2; 3795 struct stat st1, st2;
diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
index 599173832b5..a13a74cf8b3 100644
--- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
@@ -208,6 +208,21 @@ int main()
208} 208}
209=-=-= 209=-=-=
210 210
211Name: Return Compund Literal
212
213=-=
214struct pair { int fst, snd; };
215struct pair
216make_pair(int long_identifier_a[], int long_identifier_b[],
217 int offset_a, int offset_b)
218{
219 int base_offset = 10;
220 return (struct pair) { long_identifier_a[base_offset + offset_b],
221 long_identifier_b[base_offset + offset_b] };
222}
223
224=-=-=
225
211Name: Switch-Case statement 226Name: Switch-Case statement
212 227
213=-= 228=-=
@@ -486,6 +501,30 @@ namespace A {
486} 501}
487=-=-= 502=-=-=
488 503
504Name: Return Aggregate Initialized Struct
505
506=-=
507struct pair { int x, y; }
508pair
509make_pair(int long_identifier_a[], int long_identifier_b[],
510 int offset_a, int offset_b)
511{
512 int base_offset = 10;
513 return { long_identifier_a[base_offset + offset_b],
514 long_identifier_b[base_offset + offset_b] };
515}
516=-=
517struct pair { int x, y; }
518pair
519make_pair(int long_identifier_a[], int long_identifier_b[],
520 int offset_a, int offset_b)
521{
522 int base_offset = 10;
523 return { long_identifier_a[base_offset + offset_b],
524 long_identifier_b[base_offset + offset_b] };
525}
526=-=-=
527
489Code: 528Code:
490 (lambda () 529 (lambda ()
491 (c-ts-mode) 530 (c-ts-mode)