Merge from savannah/emacs-30

679f7ccc49 Prevent accesses to /content files without a GUI connection
f0a7eec5a7 * lisp/net/tramp-integration.el (shortdoc): Use `tramp--w...
fb642d9cf5 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
f1e37ae423 Avoid crashes in very large buffers with long lines
4dc9e99349 Update description of string comparison functions
3817355aed Add sanity check when adding Tramp functions to shortdoc
1bbb322017 ; * lisp/erc/erc-fill.el (erc-fill-wrap-mode): Doc fix.
3f6e7e1da6 js-ts-mode: Make jsdoc's "description" block a comment (b...
1c7e00f4f6 Also condition cjk-misc font-spec on Android
b89d65df5f ; * etc/PROBLEMS: How to install sources on SUSE Linux (b...
729b17c202 ; * src/lread.c (Fload): Add comment.  (Bug#72433)
bfb1aee998 Fix ':defer nil' in 'use-package'
d787817076 Document unsupported color Emoji on OpenBSD
db1f749db5 Fix regressions in Customize caused by 'widget-unselected...
f94d58008e Avoid inserting extra space in SVG data
292fcd2009 Fix c-ts-common filling function (bug#71760)
e50d597f45 Fix missing type checks before specbind

# Conflicts:
#	lisp/progmodes/c-ts-common.el
This commit is contained in:
Po Lu 2024-08-07 09:21:27 +08:00
commit 1a4c26d413
16 changed files with 156 additions and 89 deletions

View file

@ -468,8 +468,9 @@ Specifically:
@item
Numbers are compared using @code{<} (@pxref{definition of <}).
@item
Strings are compared using @code{string<} (@pxref{definition of
string<}) and symbols are compared by comparing their names as strings.
Strings are compared using @code{string-lessp} (@pxref{definition of
string-lessp}) and symbols are compared by comparing their names as
strings.
@item
Conses, lists, vectors and records are compared lexicographically. This
means that the two sequences are compared element-wise from left to

View file

@ -502,7 +502,7 @@ in case if @code{case-fold-search} is non-@code{nil}.
@end example
@end defun
@defun string= string1 string2
@defun string-equal string1 string2
This function returns @code{t} if the characters of the two strings
match exactly. Symbols are also allowed as arguments, in which case
the symbol names are used. Case is always significant, regardless of
@ -513,25 +513,25 @@ This function is equivalent to @code{equal} for comparing two strings
the two strings are ignored; use @code{equal-including-properties} if
you need to distinguish between strings that differ only in their text
properties. However, unlike @code{equal}, if either argument is not a
string or symbol, @code{string=} signals an error.
string or symbol, @code{string-equal} signals an error.
@example
(string= "abc" "abc")
(string-equal "abc" "abc")
@result{} t
(string= "abc" "ABC")
(string-equal "abc" "ABC")
@result{} nil
(string= "ab" "ABC")
(string-equal "ab" "ABC")
@result{} nil
@end example
A unibyte and a multibyte string are equal in the sense of
@code{string=} if and only if they contain the same sequence of
@code{string-equal} if and only if they contain the same sequence of
character codes all being in the range 0--127 (@acronym{ASCII}).
@xref{Text Representations}.
@end defun
@defun string-equal string1 string2
@code{string-equal} is another name for @code{string=}.
@defun string= string1 string2
@code{string=} is another name for @code{string-equal}.
@end defun
@defun string-equal-ignore-case string1 string2
@ -597,9 +597,8 @@ that collation implements.
@end defun
@cindex lexical comparison of strings
@anchor{definition of string<}
@defun string< string1 string2
@c (findex string< causes problems for permuted index!!)
@anchor{definition of string-lessp}
@defun string-lessp string1 string2
This function compares two strings a character at a time. It
scans both the strings at the same time to find the first pair of corresponding
characters that do not match. If the lesser character of these two is
@ -618,11 +617,11 @@ multibyte non-@acronym{ASCII} character (@pxref{Text Representations}).
@example
@group
(string< "abc" "abd")
(string-lessp "abc" "abd")
@result{} t
(string< "abd" "abc")
(string-lessp "abd" "abc")
@result{} nil
(string< "123" "abc")
(string-lessp "123" "abc")
@result{} t
@end group
@end example
@ -634,15 +633,15 @@ no characters is less than any other string.
@example
@group
(string< "" "abc")
(string-lessp "" "abc")
@result{} t
(string< "ab" "abc")
(string-lessp "ab" "abc")
@result{} t
(string< "abc" "")
(string-lessp "abc" "")
@result{} nil
(string< "abc" "ab")
(string-lessp "abc" "ab")
@result{} nil
(string< "" "")
(string-lessp "" "")
@result{} nil
@end group
@end example
@ -651,8 +650,8 @@ Symbols are also allowed as arguments, in which case their print names
are compared.
@end defun
@defun string-lessp string1 string2
@code{string-lessp} is another name for @code{string<}.
@defun string< string1 string2
@code{string<} is another name for @code{string-lessp}.
@end defun
@defun string-greaterp string1 string2
@ -661,6 +660,10 @@ This function returns the result of comparing @var{string1} and
@code{(string-lessp @var{string2} @var{string1})}.
@end defun
@defun string> string1 string2
@code{string>} is another name for @code{string-greaterp}.
@end defun
@cindex locale-dependent string comparison
@defun string-collate-lessp string1 string2 &optional locale ignore-case
This function returns @code{t} if @var{string1} is less than

View file

@ -456,6 +456,26 @@ However, the exact directory name will depend on the system, and you
will need to both upgrade source and debug info when your system
upgrades or patches Emacs, and change your startup file accordingly.
** SUSE based distributions (openSUSE, SUSE Linux Enterprise)
On systems with distributions, you can install source and debug info via
superuser commands like the following:
# Install Emacs source and debuginfo by using --plus-content
zypper --plus-content debug,source install \
emacs-debuginfo emacs-debugsource
To get describe-function and similar commands to work, you can then add
something like the following to your startup file:
(setq find-function-C-source-directory
"/usr/src/debug/emacs-27.1-1/src/")
The line above should work for all systems using zypper besides SUSE
based ones, however it could be that you have to adjust the path to the
sources slightly depending on the version of the distribution you have
installed.
** Source and debuginfo for other systems
If your system follows neither the Debian nor the Red Hat patterns,
@ -1274,6 +1294,27 @@ Emacs will select some other font instead.
The only workaround is not to choose such font variants as the default
font when running Emacs on MS-Windows.
** On OpenBSD, color Emoji are not supported by default.
The system's FreeType library is not built with libpng support, so it
can't display color emoji. This is due to the fact that, on OpenBSD,
libpng is provided through ports and that a base component cannot depend
on that.
However, you can add support for PNG in the system's FreeType library by
following those steps:
1. Install the 'png' package.
2. Read the release(8) man page for how to get Xenocara sources.
3. Patch the file
"/usr/xenocara/lib/freetype/include/freetype/config/ftoption.h"
by uncommenting the "#define FT_CONFIG_OPTION_USE_PNG" line.
4. Patch the file "/usr/xenocara/lib/freetype/Makefile" by
appending "-L/usr/local/lib -lpng" to LDADD and appending
"-I/usr/local/include" to CPPFLAGS.
5. Build and install Xenocara (also, see release(8)).
Note that this support will be gone after each OpenBSD's system upgrade.
* Internationalization problems
** M-{ does not work on a Spanish PC keyboard.

View file

@ -490,16 +490,15 @@ option `erc-fill-wrap-margin-width'. To use it, either include
`erc-fill-wrap'.
Once enabled, use \\[erc-fill-wrap-nudge] to adjust the width of
the indent and the stamp margin. And For cycling between
the indent and the stamp margin. For cycling between
logical- and screen-line oriented command movement, see
\\[erc-fill-wrap-toggle-truncate-lines]. Similarly, use
\\[erc-fill-wrap-refill-buffer] to fix alignment problems after
running certain commands, like `text-scale-adjust'. Also see
related stylistic options `erc-fill-wrap-merge', and
related stylistic options `erc-fill-wrap-merge' and
`erc-fill-wrap-merge-indicator'. (Hint: in narrow windows, try
setting `erc-fill-static-center' to 1, and if you use
`erc-fill-wrap-merge-indicator', choose \"Leading MIDDLE DOT sans
gap\" or one of the \"trailing\" items from the Customize menu.)
setting `erc-fill-static-center' to 1 and choosing \"Leading
MIDDLE DOT sans gap\" for `erc-fill-wrap-merge-indicator'.)
This module imposes various restrictions on the appearance of
timestamps. Most notably, it insists on displaying them in the
@ -510,12 +509,11 @@ Additionally, this module assumes that users providing their own
`erc-insert-timestamp-function' have also customized the option
`erc-fill-wrap-margin-side' to an explicit side. When stamps
appear in the right margin, which they do by default, users may
find that ERC actually appends them to copy-as-killed messages
without an intervening space. This normally poses at most a
minor inconvenience, however users of the `log' module may prefer
a workaround provided by `erc-stamp-prefix-log-filter', which
strips trailing stamps from logged messages and instead prepends
them to every line.
find that ERC actually appends them to copy-as-killed messages.
This normally poses at most a minor inconvenience. Users of the
`log' module wanting to avoid this effect in logs should see
`erc-stamp-prefix-log-filter', which strips trailing stamps from
logged messages and instead prepends them to every line.
A so-called \"local\" module, `fill-wrap' depends on the global
modules `fill', `stamp', `button', and `scrolltobottom'. It

View file

@ -726,7 +726,9 @@
;; This is required, as otherwise many TrueType fonts
;; with CJK characters but no corresponding ``design
;; language'' declaration can't be found.
,(font-spec :registry "iso10646-1" :script 'cjk-misc))
,@(and (featurep 'android)
(list (font-spec :registry "iso10646-1"
:script 'cjk-misc))))
(hangul (nil . "KSC5601.1987-0")
,(font-spec :registry "iso10646-1" :lang 'ko))

View file

@ -274,35 +274,38 @@ NAME must be equal to `tramp-current-connection'."
;;; Integration of shortdoc.el:
(with-eval-after-load 'shortdoc
(dolist (elem `((file-remote-p
:eval (file-remote-p "/ssh:user@host:/tmp/foo")
:eval (file-remote-p "/ssh:user@host:/tmp/foo" 'method)
:eval (file-remote-p "/ssh:user@[::1]#1234:/tmp/foo" 'host)
;; We don't want to see the text properties.
:no-eval (file-remote-p "/sudo::/tmp/foo" 'user)
:result ,(substring-no-properties
(file-remote-p "/sudo::/tmp/foo" 'user)))
(file-local-name
:eval (file-local-name "/ssh:user@host:/tmp/foo"))
(file-local-copy
:no-eval (file-local-copy "/ssh:user@host:/tmp/foo")
:eg-result "/tmp/tramp.8ihLbO"
:eval (file-local-copy "/tmp/foo"))))
(unless (assoc (car elem)
(member "Remote Files" (assq 'file shortdoc--groups)))
(shortdoc-add-function 'file "Remote Files" elem)))
(tramp--with-startup
(with-eval-after-load 'shortdoc
;; Some packages deactivate Tramp. They don't deserve a shortdoc entry then.
(when (file-remote-p "/ssh:user@host:/tmp/foo")
(dolist (elem `((file-remote-p
:eval (file-remote-p "/ssh:user@host:/tmp/foo")
:eval (file-remote-p "/ssh:user@host:/tmp/foo" 'method)
:eval (file-remote-p "/ssh:user@[::1]#1234:/tmp/foo" 'host)
;; We don't want to see the text properties.
:no-eval (file-remote-p "/sudo::/tmp/foo" 'user)
:result ,(substring-no-properties
(file-remote-p "/sudo::/tmp/foo" 'user)))
(file-local-name
:eval (file-local-name "/ssh:user@host:/tmp/foo"))
(file-local-copy
:no-eval (file-local-copy "/ssh:user@host:/tmp/foo")
:eg-result "/tmp/tramp.8ihLbO"
:eval (file-local-copy "/tmp/foo"))))
(unless (assoc (car elem)
(member "Remote Files" (assq 'file shortdoc--groups)))
(shortdoc-add-function 'file "Remote Files" elem)))
(add-hook
'tramp-integration-unload-hook
(lambda ()
(let ((glist (assq 'file shortdoc--groups)))
(while (and (consp glist)
(not (and (stringp (cadr glist))
(string-equal (cadr glist) "Remote Files"))))
(setq glist (cdr glist)))
(when (consp glist)
(setcdr glist nil))))))
(add-hook
'tramp-integration-unload-hook
(lambda ()
(let ((glist (assq 'file shortdoc--groups)))
(while (and (consp glist)
(not (and (stringp (cadr glist))
(string-equal (cadr glist) "Remote Files"))))
(setq glist (cdr glist)))
(when (consp glist)
(setcdr glist nil))))))))
;;; Integration of compile.el:

View file

@ -151,7 +151,9 @@ comment."
(orig-point (point-marker))
(start-marker (point-marker))
(end-marker nil)
(end-len 0))
(end-len 0)
(start-mask-done nil)
(end-mask-done nil))
(move-marker start-marker start)
;; If the first line is /* followed by non-text, exclude this line
;; from filling.
@ -179,6 +181,7 @@ comment."
(goto-char (match-beginning 1))
(setq end-marker (point-marker))
(setq end-len (- (match-end 1) (match-beginning 1)))
(setq end-mask-done t)
(replace-match (make-string end-len ?x)
nil nil nil 1))

View file

@ -3946,7 +3946,9 @@ See `treesit-thing-settings' for more information.")
:embed 'jsdoc
:host 'javascript
:local t
`(((comment) @capture (:match ,js--treesit-jsdoc-beginning-regexp @capture))))))
`(((comment) @capture (:match ,js--treesit-jsdoc-beginning-regexp @capture)))))
(setq c-ts-common--comment-regexp (rx (or "comment" "line_comment" "block_comment" "description"))))
;; Imenu
(setq-local treesit-simple-imenu-settings

View file

@ -331,7 +331,6 @@ If the SVG is later changed, the image will also be updated."
(insert (format " %s=\"%s\"" (car attr) (cdr attr)))))
(insert ">")
(dolist (elem (nthcdr 2 dom))
(insert " ")
(svg-print elem))
(insert (format "</%s>" (car dom)))))

View file

@ -726,9 +726,9 @@ extending any keys already present."
;; If at this point no :load, :defer or :no-require has been seen, then
;; :load the package itself.
(when (and (not (plist-member args :load))
(not (plist-member args :defer))
(not (plist-member args :no-require)))
(when (and (not (plist-get args :load))
(not (plist-get args :defer))
(not (plist-get args :no-require)))
(setq args (append args `(:load (,name)))))
;; Sort the list of keywords based on the order of `use-package-keywords'.

View file

@ -2549,7 +2549,10 @@ If the item is checked, CHOSEN is a cons whose cdr is the value."
(t
(widget-create-child-value
widget type (car (cdr chosen)))
(widget-specify-selected child)))))
;; This somehow breaks :options and other
;; Custom features.
;; (widget-specify-selected child)
))))
(t
(error "Unknown escape `%c'" escape)))))
;; Update properties.

View file

@ -2599,9 +2599,10 @@ android_content_name (struct android_vnode *vnode, char *name,
component_end++;
/* Now, find out if the first component is a special vnode; if so,
call its root lookup function with the rest of NAME there. */
call its root lookup function with the rest of NAME there. What is
more, content files are inaccessible in the absence of a GUI. */
if (api < 19)
if (api < 19 || !android_init_gui)
i = 3;
else if (api < 21)
i = 1;

View file

@ -1018,8 +1018,8 @@ usage: (let* VARLIST BODY...) */)
}
var = maybe_remove_pos_from_symbol (var);
if (!NILP (lexenv) && BARE_SYMBOL_P (var)
&& !XBARE_SYMBOL (var)->u.s.declared_special
CHECK_TYPE (BARE_SYMBOL_P (var), Qsymbolp, var);
if (!NILP (lexenv) && !XBARE_SYMBOL (var)->u.s.declared_special
&& NILP (Fmemq (var, Vinternal_interpreter_environment)))
/* Lexically bind VAR by adding it to the interpreter's binding
alist. */
@ -1090,10 +1090,10 @@ usage: (let VARLIST BODY...) */)
varlist = XCDR (varlist);
Lisp_Object var = maybe_remove_pos_from_symbol (SYMBOLP (elt) ? elt
: Fcar (elt));
CHECK_TYPE (BARE_SYMBOL_P (var), Qsymbolp, var);
tem = temps[argnum];
if (!NILP (lexenv) && SYMBOLP (var)
&& !XSYMBOL (var)->u.s.declared_special
if (!NILP (lexenv) && !XBARE_SYMBOL (var)->u.s.declared_special
&& NILP (Fmemq (var, Vinternal_interpreter_environment)))
/* Lexically bind VAR by adding it to the lexenv alist. */
lexenv = Fcons (Fcons (var, tem), lexenv);
@ -1492,7 +1492,7 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform,
ptrdiff_t CACHEABLE clausenb = 0;
var = maybe_remove_pos_from_symbol (var);
CHECK_SYMBOL (var);
CHECK_TYPE (BARE_SYMBOL_P (var), Qsymbolp, var);
Lisp_Object success_handler = Qnil;
@ -3272,18 +3272,18 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, Lisp_Object *arg_vector)
{
maybe_quit ();
Lisp_Object next = XCAR (syms_left);
if (!SYMBOLP (next))
Lisp_Object next = maybe_remove_pos_from_symbol (XCAR (syms_left));
if (!BARE_SYMBOL_P (next))
xsignal1 (Qinvalid_function, fun);
if (EQ (next, Qand_rest))
if (BASE_EQ (next, Qand_rest))
{
if (rest || previous_rest)
xsignal1 (Qinvalid_function, fun);
rest = 1;
previous_rest = true;
}
else if (EQ (next, Qand_optional))
else if (BASE_EQ (next, Qand_optional))
{
if (optional || rest || previous_rest)
xsignal1 (Qinvalid_function, fun);
@ -3305,12 +3305,12 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, Lisp_Object *arg_vector)
arg = Qnil;
/* Bind the argument. */
if (!NILP (lexenv) && SYMBOLP (next))
if (!NILP (lexenv))
/* Lexically bind NEXT by adding it to the lexenv alist. */
lexenv = Fcons (Fcons (next, arg), lexenv);
else
/* Dynamically bind NEXT. */
specbind (maybe_remove_pos_from_symbol (next), arg);
specbind (next, arg);
previous_rest = false;
}
}

View file

@ -1748,6 +1748,9 @@ Return t if the file exists and loads successfully. */)
saved_strings[i].size = 0;
}
/* The "...done" messages are shown only in interactive mode, because
the echo-area can display only the last message, and we want to
avoid the impression that the load is still in progress. */
if (!noninteractive && (NILP (nomessage) || force_load_messages))
{
if (is_module)

View file

@ -3647,14 +3647,14 @@ get_narrowed_len (struct window *w)
static ptrdiff_t
get_medium_narrowing_begv (struct window *w, ptrdiff_t pos)
{
int len = get_narrowed_len (w);
ptrdiff_t len = get_narrowed_len (w);
return max ((pos / len - 1) * len, BEGV);
}
static ptrdiff_t
get_medium_narrowing_zv (struct window *w, ptrdiff_t pos)
{
int len = get_narrowed_len (w);
ptrdiff_t len = get_narrowed_len (w);
return min ((pos / len + 1) * len, ZV);
}
@ -3704,9 +3704,9 @@ get_large_narrowing_begv (ptrdiff_t pos)
{
if (long_line_optimizations_region_size <= 0)
return BEGV;
int len = long_line_optimizations_region_size / 2;
int begv = max (pos - len, BEGV);
int limit = long_line_optimizations_bol_search_limit;
ptrdiff_t len = long_line_optimizations_region_size / 2;
ptrdiff_t begv = max (pos - len, BEGV);
ptrdiff_t limit = long_line_optimizations_bol_search_limit;
while (limit > 0)
{
if (begv == BEGV || FETCH_BYTE (CHAR_TO_BYTE (begv) - 1) == '\n')
@ -3722,7 +3722,7 @@ get_large_narrowing_zv (ptrdiff_t pos)
{
if (long_line_optimizations_region_size <= 0)
return ZV;
int len = long_line_optimizations_region_size / 2;
ptrdiff_t len = long_line_optimizations_region_size / 2;
return min (pos + len, ZV);
}

View file

@ -362,5 +362,13 @@ expressions works for identifiers starting with period."
(error err))))
(should (eq inner-error outer-error))))
(ert-deftest eval-bad-specbind ()
(should-error (eval '(let (((a b) 23)) (+ 1 2)) t)
:type 'wrong-type-argument)
(should-error (eval '(let* (((a b) 23)) (+ 1 2)) t)
:type 'wrong-type-argument)
(should-error (eval '(condition-case (a b) (+ 1 2) (:success 'ok)))
:type 'wrong-type-argument)
(should-error (eval '(funcall '(lambda ((a b) 3.15) 84) 5 4))))
;;; eval-tests.el ends here