1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Merge from origin/emacs-29

9ae1c2762d EUDC: Outline deprecation plans in NEWS
6acf95cbea Fix admin/notes/tree-sitter/build-module/build.sh (bug#59...
cc63c08697 * doc/misc/eww.texi (Overview): Improve introduction.
b8790e320e Consistent fontification of using-directives in csharp-ts...
5257b9cda4 ; Rename c-ts-fontify-error to c-ts-mode--fontify-error
c6b454df33 ; Improve docstring of c-ts-mode--fontify-variable
6187d001f2 Fontify some keywords in type face in c-ts-mode
b3847c0208 ; Minor cleanup in treesit.c
40af27859e ; * lib-src/etags.c (escape_shell_arg_string): Minor doc ...
43b7e7efbf Fix etags builds on non-Windows non-MS-DOS machines
7e6d1d1c47 ; Fix last change in etags.c.
01a4035c86 Fix etags local command injection vulnerability
ed4734405d Avoid crashes in a build --without-modules
70a2eb4a0b Fix 'add-display-text-property' when OBJECT is non-nil
d58d1dd48a Do not run slow tests on EMBA
9b9b39a2d8 Lisp reader undefined behaviour excision

# Conflicts:
#	etc/NEWS
This commit is contained in:
Stefan Kangas 2022-12-07 06:30:51 +01:00
commit 82849f9a20
13 changed files with 187 additions and 75 deletions

View file

@ -12,6 +12,7 @@ languages=(
'python'
'rust'
'typescript'
'tsx'
)
for language in "${languages[@]}"

View file

@ -1,6 +1,7 @@
#!/bin/bash
lang=$1
topdir="$PWD"
if [ $(uname) == "Darwin" ]
then
@ -11,24 +12,33 @@ fi
echo "Building ${lang}"
# Retrieve sources.
git clone "https://github.com/tree-sitter/tree-sitter-${lang}.git" \
### Retrieve sources
repo="tree-sitter-${lang}"
sourcedir="tree-sitter-${lang}/src"
grammardir="tree-sitter-${lang}"
case "${lang}" in
"typescript")
sourcedir="tree-sitter-typescript/typescript/src"
grammardir="tree-sitter-typescript/typescript"
;;
"tsx")
repo="tree-sitter-typescript"
sourcedir="tree-sitter-typescript/tsx/src"
grammardir="tree-sitter-typescript/tsx"
;;
esac
git clone "https://github.com/tree-sitter/${repo}.git" \
--depth 1 --quiet
if [ "${lang}" == "typescript" ]
then
lang="typescript/tsx"
fi
cp tree-sitter-lang.in "tree-sitter-${lang}/src"
cp emacs-module.h "tree-sitter-${lang}/src"
cp "tree-sitter-${lang}/grammar.js" "tree-sitter-${lang}/src"
cd "tree-sitter-${lang}/src"
cp "${grammardir}"/grammar.js "${sourcedir}"
# We have to go into the source directory to compile, because some
# C files referes to files like "../../common/scanner.h".
cd "${sourcedir}"
if [ "${lang}" == "typescript/tsx" ]
then
lang="tsx"
fi
### Build
# Build.
cc -c -I. parser.c
# Compile scanner.c.
if test -f scanner.c
@ -48,15 +58,9 @@ else
cc -fPIC -shared *.o -o "libtree-sitter-${lang}.${soext}"
fi
# Copy out.
### Copy out
if [ "${lang}" == "typescript" ]
then
cp "libtree-sitter-${lang}.${soext}" ..
cd ..
fi
mkdir -p ../../dist
cp "libtree-sitter-${lang}.${soext}" ../../dist
cd ../../
rm -rf "tree-sitter-${lang}"
mkdir -p "${topdir}/dist"
cp "libtree-sitter-${lang}.${soext}" "${topdir}/dist"
cd "${topdir}"
rm -rf "${repo}"

View file

@ -67,9 +67,15 @@ Indices
@node Overview
@chapter Overview
@dfn{EWW}, the Emacs Web Wowser, is a web browser for GNU Emacs. It
can load, parse, and display various web pages using @dfn{shr.el}.
However, a GNU Emacs with @code{libxml2} support is required.
@dfn{EWW}, the Emacs Web Wowser, is a web browser for GNU Emacs that
provides a simple, no-frills experience that focuses on readability.
It loads, parses, and displays web pages using @dfn{shr.el}. It can
display images inline, if Emacs was built with image support, but
there is no support for CSS or JavaScript.
To use EWW, you need to use an Emacs built with @code{libxml2}
support.
@node Basics
@chapter Basic Usage

View file

@ -1996,6 +1996,26 @@ It narrows to the current node.
** EUDC
+++
*** Deprecations planned for next release.
After Emacs 29.1, some aspects of EUDC will be deprecated. The goal
of these deprecations is to simplify EUDC server configuration by
making 'eudc-server-hotlist' the only place to add servers. There
will not be a need to set the server using the 'eudc-set-server'
function. Instead, the 'eudc-server-hotlist' variable should be
customized to have an entry for the server. The plan is to obsolete
the 'eudc-hotlist' editor since Customize is sufficient for changing
'eudc-server-hotlist'. How the 'eudc-server' variable works in this
context is to-be-determined; it can't be removed, because that would
break compatibility, but it may become synchronized with
'eudc-server-hotlist' so that 'eudc-server' is always equal to (first
eudc-server-hotlist). The first entry in 'eudc-server-hotlist' is the
first server tried by 'eudc-expand-try-all'. The hotlist
simplification will allow 'eudc-query-form' to show a drop down of
possible servers, instead of requiring a call to 'eudc-set-server'
like it does in this release. The default value of
'eudc-ignore-options-file' will be changed from nil to t.
+++
*** New user option 'eudc-ignore-options-file' that defaults to nil.
The 'eudc-ignore-options-file' user option can be configured to ignore

View file

@ -401,6 +401,9 @@ static void invalidate_nodes (fdesc *, node **);
static void put_entries (node *);
static void cleanup_tags_file (char const * const, char const * const);
#if !MSDOS && !defined (DOS_NT)
static char *escape_shell_arg_string (char *);
#endif
static void do_move_file (const char *, const char *);
static char *concat (const char *, const char *, const char *);
static char *skip_spaces (char *);
@ -1413,7 +1416,7 @@ main (int argc, char **argv)
setenv ("LC_COLLATE", "C", 1);
setenv ("LC_ALL", "C", 1); */
char *cmd = xmalloc (8 * strlen (tagfile) + sizeof "sort -u -o '' ''");
#if defined WINDOWSNT || defined MSDOS
#if defined WINDOWSNT || MSDOS
/* Quote "like this". No need to escape the quotes in the file name,
since it is not allowed in file names on these systems. */
char *z = stpcpy (cmd, "sort -u -o \"");
@ -1713,13 +1716,23 @@ process_file_name (char *file, language *lang)
else
{
#if MSDOS || defined (DOS_NT)
char *cmd1 = concat (compr->command, " \"", real_name);
char *cmd = concat (cmd1, "\" > ", tmp_name);
int buf_len =
strlen (compr->command)
+ strlen (" \"\" > \"\"") + strlen (real_name)
+ strlen (tmp_name) + 1;
char *cmd = xmalloc (buf_len);
snprintf (cmd, buf_len, "%s \"%s\" > \"%s\"",
compr->command, real_name, tmp_name);
#else
char *cmd1 = concat (compr->command, " '", real_name);
char *cmd = concat (cmd1, "' > ", tmp_name);
char *new_real_name = escape_shell_arg_string (real_name);
char *new_tmp_name = escape_shell_arg_string (tmp_name);
int buf_len =
strlen (compr->command) + strlen (" > ") + strlen (new_real_name)
+ strlen (new_tmp_name) + 1;
char *cmd = xmalloc (buf_len);
snprintf (cmd, buf_len, "%s %s > %s",
compr->command, new_real_name, new_tmp_name);
#endif
free (cmd1);
inf = (system (cmd) == -1
? NULL
: fopen (tmp_name, "r" FOPEN_BINARY));
@ -7707,6 +7720,57 @@ etags_mktmp (void)
return templt;
}
#if !MSDOS && !defined (DOS_NT)
/*
* Add single quotes around a string, and escape any single quotes.
* Return a newly-allocated string.
*
* For example:
* escape_shell_arg_string ("test.txt") => "'test.txt'"
* escape_shell_arg_string ("'test.txt") => "''\''test.txt'"
*/
static char *
escape_shell_arg_string (char *str)
{
char *p = str;
int need_space = 2; /* ' at begin and end */
while (*p != '\0')
{
if (*p == '\'')
need_space += 4; /* ' to '\'', length is 4 */
else
need_space++;
p++;
}
char *new_str = xnew (need_space + 1, char);
new_str[0] = '\'';
new_str[need_space-1] = '\'';
int i = 1; /* skip first byte */
p = str;
while (*p != '\0')
{
new_str[i] = *p;
if (*p == '\'')
{
new_str[i+1] = '\\';
new_str[i+2] = '\'';
new_str[i+3] = '\'';
i += 3;
}
i++;
p++;
}
new_str[need_space] = '\0';
return new_str;
}
#endif
static void
do_move_file(const char *src_file, const char *dst_file)
{

View file

@ -370,7 +370,8 @@ this defaults to the current buffer."
(min end (point-max)))))
(if (not (setq disp (get-text-property sub-start 'display object)))
;; No old properties in this range.
(put-text-property sub-start sub-end 'display (list prop value))
(put-text-property sub-start sub-end 'display (list prop value)
object)
;; We have old properties.
(let ((vector nil))
;; Make disp into a list.
@ -390,7 +391,7 @@ this defaults to the current buffer."
(when vector
(setq disp (seq-into disp 'vector)))
;; Finally update the range.
(put-text-property sub-start sub-end 'display disp)))
(put-text-property sub-start sub-end 'display disp object)))
(setq sub-start sub-end))))
;;;###autoload

View file

@ -169,9 +169,9 @@ MODE is either `c' or `cpp'."
'("break" "case" "const" "continue"
"default" "do" "else" "enum"
"extern" "for" "goto" "if" "inline"
"long" "register" "return" "short"
"signed" "sizeof" "static" "struct"
"switch" "typedef" "union" "unsigned"
"register" "return"
"sizeof" "static" "struct"
"switch" "typedef" "union"
"volatile" "while")))
(if (eq mode 'cpp)
(append c-keywords
@ -188,6 +188,10 @@ MODE is either `c' or `cpp'."
"xor" "xor_eq"))
(append '("auto") c-keywords))))
(defvar c-ts-mode--type-keywords
'("long" "short" "signed" "unsigned")
"Keywords that should be considered as part of a type.")
(defvar c-ts-mode--operators
'("=" "-" "*" "/" "+" "%" "~" "|" "&" "^" "<<" ">>" "->"
"." "<" "<=" ">=" ">" "==" "!=" "!" "&&" "||" "-="
@ -263,7 +267,8 @@ MODE is either `c' or `cpp'."
(qualified_identifier
scope: (namespace_identifier) @font-lock-type-face)
(operator_cast) type: (type_identifier) @font-lock-type-face)))
(operator_cast) type: (type_identifier) @font-lock-type-face))
[,@c-ts-mode--type-keywords] @font-lock-type-face)
:language mode
:feature 'definition
@ -314,7 +319,7 @@ MODE is either `c' or `cpp'."
:language mode
:feature 'error
'((ERROR) @c-ts-fontify-error)
'((ERROR) @c-ts-mode--fontify-error)
:feature 'escape-sequence
:language mode
@ -367,8 +372,8 @@ For NODE, OVERRIDE, START, END, and ARGS, see
override start end))))
(defun c-ts-mode--fontify-variable (node override start end &rest _)
"Fontify an identifier node.
Fontify it if NODE is not a function identifier. For NODE,
"Fontify an identifier node if it is a variable.
Don't fontify if it is a function identifier. For NODE,
OVERRIDE, START, END, and ARGS, see `treesit-font-lock-rules'."
(when (not (equal (treesit-node-type
(treesit-node-parent node))
@ -416,7 +421,7 @@ This function corrects the fontification on the colon in
(treesit-node-start arg) (treesit-node-end arg)
'default override start end))))))
(defun c-ts-fontify-error (node override start end &rest _)
(defun c-ts-mode--fontify-error (node override start end &rest _)
"Fontify the error nodes.
For NODE, OVERRIDE, START, and END, see
`treesit-font-lock-rules'."

View file

@ -748,8 +748,11 @@ compilation and evaluation time conflicts."
:language 'c-sharp
:feature 'definition
:override t
'((qualified_name (identifier) @font-lock-variable-name-face)
'((qualified_name (identifier) @font-lock-type-face)
(using_directive (identifier) @font-lock-type-face)
(using_directive (name_equals
(identifier) @font-lock-type-face
["="] @default-face))
(enum_declaration (identifier) @font-lock-type-face)
(enum_member_declaration (identifier) @font-lock-variable-name-face)

View file

@ -3375,7 +3375,7 @@ read_bool_vector (Lisp_Object readcharfun)
break;
}
if (INT_MULTIPLY_WRAPV (length, 10, &length)
| INT_ADD_WRAPV (length, c - '0', &length))
|| INT_ADD_WRAPV (length, c - '0', &length))
invalid_syntax ("#&", readcharfun);
}
@ -3421,7 +3421,7 @@ skip_lazy_string (Lisp_Object readcharfun)
break;
}
if (INT_MULTIPLY_WRAPV (nskip, 10, &nskip)
| INT_ADD_WRAPV (nskip, c - '0', &nskip))
|| INT_ADD_WRAPV (nskip, c - '0', &nskip))
invalid_syntax ("#@", readcharfun);
digits++;
if (digits == 2 && nskip == 0)
@ -5468,6 +5468,14 @@ to the specified file name if a suffix is allowed or required. */);
Vload_suffixes =
Fcons (build_pure_c_string (MODULES_SECONDARY_SUFFIX), Vload_suffixes);
#endif
#endif
DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix,
doc: /* Suffix of loadable module file, or nil if modules are not supported. */);
#ifdef HAVE_MODULES
Vmodule_file_suffix = build_pure_c_string (MODULES_SUFFIX);
#else
Vmodule_file_suffix = Qnil;
#endif
DEFVAR_LISP ("dynamic-library-suffixes", Vdynamic_library_suffixes,
doc: /* A list of suffixes for loadable dynamic libraries. */);
@ -5477,14 +5485,6 @@ to the specified file name if a suffix is allowed or required. */);
Fcons (build_pure_c_string (DYNAMIC_LIB_SUFFIX),
Vdynamic_library_suffixes);
#endif
DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix,
doc: /* Suffix of loadable module file, or nil if modules are not supported. */);
#ifdef HAVE_MODULES
Vmodule_file_suffix = build_pure_c_string (MODULES_SUFFIX);
#else
Vmodule_file_suffix = Qnil;
#endif
DEFVAR_LISP ("load-file-rep-suffixes", Vload_file_rep_suffixes,
doc: /* List of suffixes that indicate representations of \
the same file.

View file

@ -1501,9 +1501,9 @@ buffer. */)
for (int idx = 0; !NILP (ranges); idx++, ranges = XCDR (ranges))
{
Lisp_Object range = XCAR (ranges);
EMACS_INT beg_byte = buf_charpos_to_bytepos (buffer,
ptrdiff_t beg_byte = buf_charpos_to_bytepos (buffer,
XFIXNUM (XCAR (range)));
EMACS_INT end_byte = buf_charpos_to_bytepos (buffer,
ptrdiff_t end_byte = buf_charpos_to_bytepos (buffer,
XFIXNUM (XCDR (range)));
/* Shouldn't violate assertion since we just checked for
buffer size at the beginning of this function. */
@ -2507,10 +2507,8 @@ the query. */)
/* Set query range. */
if (!NILP (beg) && !NILP (end))
{
EMACS_INT beg_byte = buf_charpos_to_bytepos (current_buffer,
XFIXNUM (beg));
EMACS_INT end_byte = buf_charpos_to_bytepos (current_buffer,
XFIXNUM (end));
ptrdiff_t beg_byte = CHAR_TO_BYTE (XFIXNUM (beg));
ptrdiff_t end_byte = CHAR_TO_BYTE (XFIXNUM (end));
/* We never let tree-sitter run on buffers too large, so these
assertion should never hit. */
eassert (beg_byte - visible_beg <= UINT32_MAX);

View file

@ -155,7 +155,7 @@ default:
.filenotify-gio-template:
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
# - if: '$CI_PIPELINE_SOURCE == "schedule"'
changes:
- "**.in"
- lisp/autorevert.el
@ -252,17 +252,17 @@ build-native-comp-speed0:
variables:
target: emacs-native-comp-speed0
build-native-comp-speed1:
stage: native-comp-images
extends: [.job-template, .build-template, .native-comp-template]
variables:
target: emacs-native-comp-speed1
# build-native-comp-speed1:
# stage: native-comp-images
# extends: [.job-template, .build-template, .native-comp-template]
# variables:
# target: emacs-native-comp-speed1
build-native-comp-speed2:
stage: native-comp-images
extends: [.job-template, .build-template, .native-comp-template]
variables:
target: emacs-native-comp-speed2
# build-native-comp-speed2:
# stage: native-comp-images
# extends: [.job-template, .build-template, .native-comp-template]
# variables:
# target: emacs-native-comp-speed2
test-native-comp-speed0:
stage: native-comp

View file

@ -707,7 +707,16 @@
(should (equal (get-text-property 2 'display) '(raise 0.5)))
(should (equal (get-text-property 5 'display)
[(raise 0.5) (height 2.0)]))
(should (equal (get-text-property 9 'display) '(raise 0.5)))))
(should (equal (get-text-property 9 'display) '(raise 0.5))))
(with-temp-buffer
(should (equal (let ((str "some useless string"))
(add-display-text-property 4 8 'height 2.0 str)
(add-display-text-property 2 12 'raise 0.5 str)
str)
#("some useless string"
2 4 (display (raise 0.5))
4 8 (display ((raise 0.5) (height 2.0)))
8 12 (display (raise 0.5)))))))
(ert-deftest subr-x-named-let ()
(let ((funs ()))

View file

@ -255,7 +255,8 @@ Must be called with `ucs-normalize-tests--norm-buf' as current buffer."
(ert-deftest ucs-normalize-part1 ()
:tags '(:expensive-test)
(skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 1800s
(skip-unless (not (or (getenv "EMACS_HYDRA_CI")
(getenv "EMACS_EMBA_CI")))) ; SLOW ~ 1800s
;; This takes a long time, so make sure we're compiled.
(dolist (fun '(ucs-normalize-tests--part1-rule2
ucs-normalize-tests--rule1-failing-for-partX