Handle ;;;###theme-autoload comments in etc/themes
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch):
Extract the autoloads and have them loaded along with loaddefs.el.
* etc/NEWS: Mention the new feature. (Bug#57639)
Stefan Kangas [Sat, 15 Oct 2022 08:52:13 +0000 (10:52 +0200)]
Delete broken link to Network Theory Ltd.
Sadly, their website has been down for several months already.
I was unable to find a new link, but it seems like they haven't
published anything new for over a decade.
* doc/misc/org.org (Summary): Remove broken link to Network Theory Ltd.
Po Lu [Sat, 15 Oct 2022 08:25:22 +0000 (16:25 +0800)]
Remove redundant call to expensive function XOpenDisplay
* src/xterm.c (x_term_init): Speed up opening Emacs over a slow
network connection by an order of magnitude on no toolkit builds
by avoiding a redundant call to XOpenDisplay.
* test/manual/image-circular-tests.el
(image-test-duplicate-keywords): Skip unless images are supported.
(image-test-circular-plist, image-test-:type-property-value): Ditto.
Wrap only failing forms in should[-error] rather than entire test
bodies. Use simpler printed notation in place of function calls.
(image-test-circular-specs): Ditto. Wrap overly wide docstring.
Mark as failing since shortly after its introduction (bug#36403#63).
Alan Mackenzie [Fri, 14 Oct 2022 17:40:26 +0000 (17:40 +0000)]
Correctly fontify C++'s operator"" _tag (...)
Give both the "" and _tag font-lock-function-name-face. Also correct the
fontification of an inherited class name when there is an attribute between
the class name being declared and the colon introducing the inheritance.
* lisp/progmodes/cc-engine.el (c-forward-over-colon-type-list): New function.
(c-forward-keyword-clause): Use the above new function instead of a
looking-at.
(c-forward-name, c-forward-declarator): Accept both the "" and the tag as part
of the name.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Fontify the "" (which
already has font-lock-string-face) and the tag with
font-lock-function-name-face.
* lisp/progmodes/cc-langs.el (c-overloadable-operators): Add "" to this list.
(c-sub-colon-type-list-re): New lang-const and lang-var.
* lisp/files-x.el (modify-dir-local-variable): Add a 'no-byte-compile'
file local variable when generating a .dir-locals.el
file.
* .dir-locals.el: Add 'no-byte-compile'. (Bug#58486)
Po Lu [Fri, 14 Oct 2022 11:04:44 +0000 (19:04 +0800)]
Fix bug#56153
* src/nsterm.m (get_keysym_name)
(ns_draw_glyphless_glyph_string_foreground): Fix new Mac OS
deprecations.
([EmacsApp terminate:]): Use kbd_buffer_store_event instead
of emacs_event. (bug#56153)
([EmacsView windowDidChangeBackingProperties:]): Fix new Mac
OS deprecation.
Po Lu [Fri, 14 Oct 2022 07:52:16 +0000 (15:52 +0800)]
Avoid redundant creation of XRender pictures
* src/xterm.c (x_composite_image): Take arg DESTINATION. Do not
create a picture if it is set.
(x_draw_image_foreground, x_draw_image_foreground_1): Pass
destination where appropriate.
Fix misleading "File exists, but cannot be read" in browse-url-emacs
* src/fileio.c (Finsert_file_contents): Don't signal an error
about not being able to open the file when we're fetching things
via handlers -- in that case, modtime isn't necessarily set, and
if there's a handler, it should take care of this (bug#42431).
Stefan Monnier [Wed, 12 Oct 2022 21:06:33 +0000 (17:06 -0400)]
src/frame.c (do_switch_frame): Fix bug#58343
* src/frame.c (do_switch_frame): Move call to `get-mru-window` outside
of the "critical region" where (selected-window) != (frame-selected-window).
* src/minibuf.c (move_minibuffers_onto_frame): Add arg `frame`.
Use it instead of `selected_frame`. Adjust all callers.
* src/lisp.h (move_minibuffers_onto_frame): Adjust declaration.
Po Lu [Wed, 12 Oct 2022 12:40:03 +0000 (20:40 +0800)]
Improve makefile-imake-mode
* lisp/progmodes/make-mode.el
(makefile-imake-font-lock-keywords): Give Imake priority over
CPP keywords, and don't require comments to start at BOL.
(makefile-imake-mode): Set comment-start to some sensible value.
Po Lu [Wed, 12 Oct 2022 07:07:49 +0000 (15:07 +0800)]
Stop relying on Xt hack to set window manager hints
* src/widget.c (get_wm_shell): Return WMShellWidget.
(update_wm_hints, widget_update_wm_size_hints): Return whether
or not size hints changed.
* src/widget.h: Delete `size_switch'.
* src/widgetprv.h (EmacsFramePart): Likewise.
* src/xterm.c (x_wm_set_size_hint): Set size hints the usual way
if Xt did not set them. (bug#58412)
Eli Zaretskii [Tue, 11 Oct 2022 10:26:01 +0000 (13:26 +0300)]
Speed up scrolling when lines are very long and truncated
* src/window.c (window_scroll_for_long_lines): New function.
(window_scroll): Call 'window_scroll_for_long_lines' when lines
are very long and truncated on display. Also, disable
'fontification-functions' during scrolling in that case.
* src/xdisp.c (redisplay_window): When recentering the window's
display, go back to the centering position using a simplified
method, if lines in the buffer are very long and truncated on
display.
Po Lu [Tue, 11 Oct 2022 07:45:08 +0000 (15:45 +0800)]
Remove some more unnecessary calls to block_input
* src/xterm.c (x_update_opaque_region, show_back_buffer)
(XTbuffer_flipping_unblocked_hook, x_clear_under_internal_border)
(x_after_update_window_line): Remove and add calls to
block_input as required.
F. Jason Park [Sat, 8 Oct 2022 04:55:30 +0000 (21:55 -0700)]
Accommodate missing spec values in erc-format-message
* lisp/erc/erc.el (erc-format-message): Although not mentioned in its
log message, commit 5281946fbf6b3cdbec5ce82e0057c71849faf4d2 "Make
format-spec accept function substitutions" also fixed a bug involving
the `ignore-missing' parameter of `format-spec'. Until now, ERC has
been relying on the old behavior to gracefully handle malformed server
messages. This commit tries to regain that functionality.
* lisp/view.el (view-remove-frame-by-deleting): Remove variable
that hasn't been used since 2011 -- 357f93d245344 reworked the
code and stopped using it (bug#58413).
kobarity [Mon, 10 Oct 2022 13:24:17 +0000 (22:24 +0900)]
Fix Python completion failure under certain conditions
* lisp/progmodes/python.el (python-shell-send-string-no-output):
Save and restore `comint-last-prompt-overlay' or `comint-last-prompt'.
* test/lisp/progmodes/python-tests.el (python-tests-shell-wait-for-prompt):
New helper function.
(python-tests-with-temp-buffer-with-shell): New helper macro.
(python-shell-completion-1, python-shell-completion-native-1)
(python-shell-completion-native-with-ffap-1)
(python-shell-completion-native-with-eldoc-1): New tests (bug#58389).
* src/sqlite.c (sqlite_prepare_errmsg): New function.
(Fsqlite_execute): Use it to get the same error format for both
execute and select.
(Fsqlite_select): Factored out from here.
Paul Eggert [Mon, 10 Oct 2022 19:35:56 +0000 (12:35 -0700)]
Port bwrap/allows-stdout test to Ubuntu 22.04.1
Without this patch, Ubuntu 22.04.1 x86-64 "make check" reports a
failure in test/src/emacs-tests.el’s
emacs-tests/bwrap/allows-stdout. One can reproduce the bug
without using the Emacs executable, by running this script:
This script exits with status 159, because "cat" didn’t get
started (it got a SIGSYS signal early on).
The command "journalctl -g SECCOMP" indicated that rseq (syscall
334) was the problem. This syscall is issued by
/lib64/ld-linux-x86-64.so.2 before ‘main’ is called.
There’s another problem with the clone3 syscall, which is used by
pthread_create starting in glibc 2.34. pthread_create is called
by g_child_watch_source_new, which is called by
init_process_emacs.
* lib-src/seccomp-filter.c (main): Allow rseq, clone3. This
causes the test to pass. Perhaps a fancier, more accurate patch
could be written by someone who has the time.
Eli Zaretskii [Mon, 10 Oct 2022 08:05:18 +0000 (11:05 +0300)]
; Clarify correct use of 'xref-query-replace-in-results'
* lisp/progmodes/xref.el (xref--query-replace-1): Improve the
user-error message.
(xref-query-replace-in-results): Clarify restrictions in the doc
string.
* doc/emacs/maintaining.texi (Xref Commands, Identifier Search):
Clarify the correct usage of 'xref-query-replace-in-results'.
Try to speed up extended command shorthand computation
Discussed in Bug#51143.
* lisp/simple.el (execute-extended-command--shorter): Compute a
complete list of `commandp' symbols once. This significantly speeds
up complicated cases while the slowdown of simple cases is still
accetable.
Po Lu [Sun, 9 Oct 2022 11:58:07 +0000 (19:58 +0800)]
Fix user time handling bug on GNOME Shell and Metacity
* src/xfns.c (x_window): Avoid extraneous
XChangeWindowAttributes.
* src/xterm.c (x_display_set_last_user_time): New argument
SET_PROPERTY. Do not change the user time property if it is not
true. All callers changed.
(handle_one_xevent): Avoid setting the user time property on
LeaveNotify and XI_Leave events.
Binding it causes errors when some of the enclosed code ends up
loading a `.el` file, and it is unnecessary since the rest of
the code (in `url-file-asynch-callback`) is already careful to
use `insert-file-contents-literally`.
Restrict string-lessp vectorisation to safe architectures
* src/fns.c (HAVE_FAST_UNALIGNED_ACCESS): New.
(Fstring_lessp): Only use word operations where safe, because string
data from purespace may be unaligned.
* lisp/emacs-lisp/vtable.el (vtable-insert-object): Pass in the
correct ellipsis values (bug#58370).
(vtable--insert-line): Don't bug out on missing optional arguments.
* doc/lispref/files.texi (Truenames): Move the documentation of
'file-in-directory-p' from here...
(Contents of Directories): ...to here. Add index entries.
(Bug#58364)