1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Merge from origin/emacs-30

0f8f077318 ; * doc/emacs/search.texi (Word Search): Document 'dictio...
fb155bcfb6 ; * lisp/emacs-lisp/chart.el (chart-bar-quickie): Doc fix.
6dbe4e99ac ; * lisp/emacs-lisp/chart.el (chart-bar-quickie): Improve...
d664227f81 ; More accurate documentation of 'file-newer-than-file-p'
e49b479f86 Fix c-ts-mode indentation for initializer lists (bug#73661)
f520008744 Avoid segfaults in Rmail-MIME
6a5c2edd84 Eglot: use :immediate t when resolving completions (bug#7...
cd36e070c2 Eglot: minor changes to doc and docstrings
1ea0d9b891 Revert "Set treesit-primary-parser for tree-sitter modes"
52746ceb62 Remove duplicate indent rules in elixir-ts-mode
ed57faafc7 Set treesit-primary-parser for tree-sitter modes
37a6c859b0 ; * lisp/emacs-lisp/cl-macs.el (cl-once-only): Fix capita...
2d4d6dc43a Delete XIE X extension from TODO
This commit is contained in:
Eli Zaretskii 2024-10-12 05:53:27 -04:00
commit bb5b25181e
13 changed files with 135 additions and 40 deletions

View File

@ -792,6 +792,46 @@ search engine whose @acronym{URL} is specified by the variable
Wowser Manual}). If the region is not active, or doesn't contain any
words, this command prompts the user for a URL or keywords to search.
@findex dictionary-search
@findex dictionary
@findex dictionary-tooltip-mode
@cindex dictionary server protocol (DICT)
@cindex word definition search
@vindex dictionary-server
You can also search for definitions of a word by querying dictionary
servers via the @sc{dict} protocol defined by @acronym{RFC} 2229. Emacs
includes a client for this protocol. Type @w{@kbd{M-x dictionary-search
@key{RET}}} to connect to a @sc{dict} server and ask it to provide the
available definitions of a word. This command prompts for the word to
look up, using the word at point as the default, then asks the @sc{dict}
server to provide the definitions of that word in one or more
dictionaries. By default, the command first tries to connect to the
@sc{dict} server installed on the local host, and if that fails, it
tries @file{dict.org} after your confirmation; customize the variable
@code{dictionary-server} to specify, as a string, the URL of a single
server to use (use @samp{localhost} if you want to query only the local
server). Normally, @code{dictionary-search} tells the server to look up
the word in all the dictionaries available to the server, but if you
invoke the command with a prefix argument, it will prompt for a single
dictionary to look. The list of dictionaries available to a server can
be displayed by pressing the @samp{Select dictionary} button shown in
the @file{*Dictionary*} buffer, described below.
First time you use @code{dictionary-search}, it creates a new
@file{*Dictionary*} buffer and turns on a special mode in it. The
buffer shows buttons for selecting a dictionary, searching a definition
of another word, etc. Subsequent @code{dictionary-search} commands
reuse this buffer. To create another such buffer (e.g., too look up
other words, perhaps in another dictionary), type @w{@kbd{M-x dictionary
@key{RET}}}.
If you turn on @code{dictionary-tooltip-mode} in a buffer, Emacs will
look up the definitions of the word at mouse pointer and show those
definitions in a tool tip. This is handy when you are reading text with
many words about whose meaning you are unsure.
For other options of dictionary-search, see the @code{dictionary}
customization group (@pxref{Specific Customization}).
@node Symbol Search
@section Symbol Search

View File

@ -1299,7 +1299,8 @@ and modification.
This function returns @code{t} if the file @var{filename1} is
newer than file @var{filename2}. If @var{filename1} does not
exist, it returns @code{nil}. If @var{filename1} does exist, but
@var{filename2} does not, it returns @code{t}.
@var{filename2} does not, it returns @code{t}. Otherwise, it compares
the times of last modification of the files.
In the following example, assume that the file @file{aug-19} was written
on the 19th, @file{aug-20} was written on the 20th, and the file

View File

@ -123,14 +123,16 @@ Here's how to start using Eglot with your programming project:
@item
Select and install a language server.
Eglot comes pre-configured with many popular language servers, see the
value of @code{eglot-server-programs}. If the server(s) mentioned
there satisfy your needs for the programming language(s) with which
you want to use Eglot, you just need to make sure those servers are
installed on your system. Alternatively, install one or more servers
of your choice and add them to the value of
Eglot comes pre-configured for many popular language servers, see the
value of @code{eglot-server-programs}. If the server(s) mentioned there
satisfy your needs for the programming language(s) with which you want
to use Eglot, you just need to make sure those servers are installed on
your system and Eglot can find them.
Alternatively, install one or more servers of your choice and tell Eglot
where to find them. To do that, you may add to the value of
@code{eglot-server-programs}, as described in @ref{Setting Up LSP
Servers}.
Servers} or have Eglot prompt you about it (@pxref{Eglot Commands}).
@item
Turn on Eglot for your project.
@ -197,7 +199,7 @@ particular server(s) you want to install.
To use a language server, Eglot must know how to start it and which
programming languages each server supports. This information is
provided by the variable @code{eglot-server-programs}.
commonly provided by the variable @code{eglot-server-programs}.
@defvar eglot-server-programs
This variable associates major modes with names and command-line
@ -939,12 +941,16 @@ to @w{@code{(disallow-non-standard-keys enforce-required-keys)}}.
@vindex eglot-server-initialized-hook
@item eglot-server-initialized-hook
A hook run after the server object is successfully initialized.
A hook run after the server object is successfully initialized (which
includes launching the process) but before any LSP communication is
attempted. Each function receives a @code{eglot-lsp-server} instance as
argument.
@vindex eglot-connect-hook
@item eglot-connect-hook
A hook run after connection to the server is successfully
established. @xref{Starting Eglot}.
A hook run after the LSP connection to the server is successfully
established. Each function receives a @code{eglot-lsp-server} instance
as argument. @xref{Starting Eglot}.
@item eglot-managed-mode-hook
A hook run after Eglot started or stopped managing a buffer.

View File

@ -788,9 +788,6 @@ to ASCII.
*** Provide a user friendly interface to specify fonts
** Use the XIE X extension, if available, for image display
This is obsolete, as XIE itself is now considered obsolete.
** Make monochrome images honor the face
Display those images using the foreground and background colors of the
applicable faces.

View File

@ -574,13 +574,16 @@ R1 and R2 are dotted pairs. Colorize it with FACE."
(defun chart-bar-quickie (dir title namelst nametitle numlst numtitle
&optional max sort-pred)
"Wash over the complex EIEIO stuff and create a nice bar chart.
Create it going in direction DIR [`horizontal' `vertical'] with TITLE
using a name sequence NAMELST labeled NAMETITLE with values NUMLST
labeled NUMTITLE.
Optional arguments:
Set the chart's max element display to MAX, and sort lists with
SORT-PRED if desired."
"Create a bar chart named TITLE in direction DIR [`horizontal' `vertical'].
NAMELST is the list of bar names and NAMETITLE is the name the of axis
containing them.
NUMLST is the list of values and NUMTITLE is the name of the value
axis.
Optional argument MAX limits the chart's max element display to MAX by
passing it as second argument to `chart-trim', otherwise the chart's
display is unlimited.
Optional argument SORT-PRED is a predicate function passed as second
argument to `chart-sort' to sort the lists if desired."
(let ((nc (make-instance 'chart-bar
:title title
:key-label "8-m" ; This is a text key pic

View File

@ -2505,7 +2505,7 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...).
(defmacro cl-once-only (names &rest body)
"Generate code to evaluate each of NAMES just once in BODY.
This macro helps with writing other macros. Each of names is
This macro helps with writing other macros. Each of NAMES is
either (NAME FORM) or NAME, which latter means (NAME NAME).
During macroexpansion, each NAME is bound to an uninterned
symbol. The expansion evaluates each FORM and binds it to the

View File

@ -579,11 +579,13 @@ HEADER is a header component of a MIME-entity object (see
(ignore-errors (base64-decode-region pos (point))))
((string= transfer-encoding "quoted-printable")
(quoted-printable-decode-region pos (point))))))
;; If the text is empty, we don't have anything to decode.
(and (/= pos (point))
(decode-coding-region
pos (point)
;; Use -dos decoding, to remove ^M characters left from base64 or
;; rogue qp-encoded text.
(coding-system-change-eol-conversion coding-system 1))
;; Use -dos decoding, to remove ^M characters left from base64
;; or rogue qp-encoded text.
(coding-system-change-eol-conversion coding-system 1)))
(if (and
(or (not rmail-mime-coding-system) (consp rmail-mime-coding-system))
(not (eq (coding-system-base coding-system) 'us-ascii)))

View File

@ -338,10 +338,13 @@ characters of the current line."
;; If the start of the previous sibling isn't at the
;; beginning of a line, something's probably not quite
;; right, go a step further. (E.g., comment after a
;; statement.)
;; statement.) If the previous sibling is the first named
;; node then anchor to that, e.g. when returning an aggregate
;; and starting the items on the same line as {.
(_ (goto-char (treesit-node-start prev-sibling))
(if (looking-back (rx bol (* whitespace))
(line-beginning-position))
(if (or (looking-back (rx bol (* whitespace))
(line-beginning-position)))
(null (treesit-node-prev-sibling prev-sibling t))
(setq continue nil)
(setq prev-sibling
(treesit-node-prev-sibling prev-sibling)))))))

View File

@ -1480,18 +1480,21 @@ Use current server's or first available Eglot events buffer."
(defvar eglot-connect-hook
'(eglot-signal-didChangeConfiguration)
"Hook run after connecting in `eglot--connect'.")
"Hook run after connecting to a server.
Each function is passed an `eglot-lsp-server' instance
as argument.")
(defvar eglot-server-initialized-hook
'()
"Hook run after a `eglot-lsp-server' instance is created.
That is before a connection was established. Use
That is before a connection is established. Use
`eglot-connect-hook' to hook into when a connection was
successfully established and the server on the other side has
received the initializing configuration.
Each function is passed the server as an argument")
Each function is passed an `eglot-lsp-server' instance
as argument.")
(defun eglot--cmd (contact)
"Helper for `eglot--connect'."
@ -3232,7 +3235,8 @@ for which LSP on-type-formatting should be requested."
:resolveProvider)
(plist-get lsp-comp :data))
(eglot--request server :completionItem/resolve
lsp-comp :cancel-on-input t)
lsp-comp :cancel-on-input t
:immediate t)
lsp-comp))))))
(when (and (consp eglot--capf-session)
(= (car bounds) (car (nth 0 eglot--capf-session)))

View File

@ -734,9 +734,6 @@ Return nil if NODE is not a defun node or doesn't have a name."
(when (treesit-ready-p 'heex)
(setq-local treesit-range-settings elixir-ts--treesit-range-rules)
(setq-local treesit-simple-indent-rules
(append treesit-simple-indent-rules heex-ts--indent-rules))
(setq-local treesit-font-lock-settings
(append treesit-font-lock-settings
heex-ts--font-lock-settings))

View File

@ -5270,7 +5270,9 @@ decode_coding_raw_text (struct coding_system *coding)
coding->chars_at_source = 1;
coding->consumed_char = coding->src_chars;
coding->consumed = coding->src_bytes;
if (eol_dos && coding->source[coding->src_bytes - 1] == '\r')
if (eol_dos
&& coding->src_bytes > 0 /* empty source text? */
&& coding->source[coding->src_bytes - 1] == '\r')
{
coding->consumed_char--;
coding->consumed--;

View File

@ -3788,7 +3788,8 @@ DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "",
DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_p, 2, 2, 0,
doc: /* Return t if file FILE1 is newer than file FILE2.
If FILE1 does not exist, the answer is nil;
otherwise, if FILE2 does not exist, the answer is t. */)
otherwise, if FILE2 does not exist, the answer is t.
For existing files, this compares their last-modified times. */)
(Lisp_Object file1, Lisp_Object file2)
{
struct stat st1, st2;

View File

@ -208,6 +208,21 @@ int main()
}
=-=-=
Name: Return Compund Literal
=-=
struct pair { int fst, snd; };
struct pair
make_pair(int long_identifier_a[], int long_identifier_b[],
int offset_a, int offset_b)
{
int base_offset = 10;
return (struct pair) { long_identifier_a[base_offset + offset_b],
long_identifier_b[base_offset + offset_b] };
}
=-=-=
Name: Switch-Case statement
=-=
@ -486,6 +501,30 @@ namespace A {
}
=-=-=
Name: Return Aggregate Initialized Struct
=-=
struct pair { int x, y; }
pair
make_pair(int long_identifier_a[], int long_identifier_b[],
int offset_a, int offset_b)
{
int base_offset = 10;
return { long_identifier_a[base_offset + offset_b],
long_identifier_b[base_offset + offset_b] };
}
=-=
struct pair { int x, y; }
pair
make_pair(int long_identifier_a[], int long_identifier_b[],
int offset_a, int offset_b)
{
int base_offset = 10;
return { long_identifier_a[base_offset + offset_b],
long_identifier_b[base_offset + offset_b] };
}
=-=-=
Code:
(lambda ()
(c-ts-mode)