Jim Porter [Fri, 21 Jan 2022 03:51:39 +0000 (19:51 -0800)]
Don't use 'eshell-eval-using-options' for 'eshell/source' or 'eshell/.'
This makes 'source' and '.' in Eshell more compatible with regular
shells, which just treat the first argument as the file to source and
all subsequent arguments as arguments to that file.
* lisp/eshell/em-script.el (eshell/source, eshell/.): Don't use
'eshell-eval-using-options'.
Interpret a "" value of EMACS_TEST_VERBOSE as "off"
* doc/misc/ert.texi (Running Tests in Batch Mode): Adjust doc.
* lisp/emacs-lisp/ert.el (ert-run-tests-batch): Allow overriding
the EMACS_TEST_VERBOSE variable by setting it to "" (bug#53313).
Make the edebug-all-defs user option work more reliably
* lisp/emacs-lisp/edebug.el (edebug-all-defs): This user option
has no effect unless edebug is loaded (because that loads the
advice needed for the commands in question) (bug#53331).
Po Lu [Fri, 21 Jan 2022 07:27:35 +0000 (15:27 +0800)]
Merge from origin/emacs-28
11ea45c9e4 Fix UB in ebrowse ba57b78064 Fix execute-extended-command-for-buffer in fundamental-mode ef0c1d4c2c Add workaround to handle a problem with Enlightenment WM (...
Po Lu [Fri, 21 Jan 2022 05:22:51 +0000 (13:22 +0800)]
Work around GTK changing window backgrounds on colormapped displays
* src/xterm.c (x_clear_window):
(x_clear_area): Fill the contents with the reverse GC instead of
using XClearArea and XClearWindow when not double buffered.
Po Lu [Fri, 21 Jan 2022 01:15:52 +0000 (09:15 +0800)]
Allow fractional values of `polling-period'
This allows C-g to be handled faster in the NS port at the cost
of some extra CPU time on slow machines.
* etc/NEWS: Announce new feature.
* src/keyboard.c (start_polling):
(bind_polling_period): Handle floating point values of
`polling-period'.
(syms_of_keyboard): Make `polling-period' a Lisp variable
instead of an int variable.
Po Lu [Sat, 15 Jan 2022 13:11:57 +0000 (21:11 +0800)]
Avoid FOCUS_IN_EVENTS not being sent on NS
* src/nsterm.m ([EmacsView windowDidBecomeKey]): Work around
emacs_event being NULL by storing focus in events directly
into the keyboard buffer. (bug#52376)
Alan Mackenzie [Thu, 20 Jan 2022 18:40:15 +0000 (18:40 +0000)]
In early bootstrap, use byte-compiled compiler to native compile first files
This speeds up a make bootstrap by around 15%.
* lisp/Makefile.in (BYTE_COMPILE_FLAGS): set a value specific to compile-first
which doesn't contain the setting of Emacs variable load-prefer-newer.
Add a new make hunk which byte-compiles (rather then native compiles) when the
environment variable ANCIENT is "yes". Set the date of the .elc files built
to 1971-01-01 to cause a second compilation of them later.
* src/Makefile.in: Add an extra invocation of directory lisp's MAKE with
target compile-first and the flag environment variable ANCIENT set to yes.
* src/verbose.mk.in: When ANCIENT is yes, output ELC, not ELC+ELN for
AM_V_ELC.
Eli Zaretskii [Thu, 20 Jan 2022 17:18:54 +0000 (19:18 +0200)]
Update documentation of 'clone-indirect-buffer-hook'
* doc/emacs/buffers.texi (Indirect Buffers):
* src/buffer.c (syms_of_buffer) <clone-indirect-buffer-hook>:
Update the documentation of 'clone-indirect-buffer-hook' due the
recent changes.
* etc/NEWS: Mention the change in where the hook is run.
* tabulated-list.el (tabulated-list-widen-current-column): Account
for the padding and the content width when calculating column
width (bug#53375).
Copyright-paperwork-exempt: yes
Andrew Hyatt [Thu, 20 Jan 2022 13:42:31 +0000 (14:42 +0100)]
Fix indirect font changes incorrectly affecting original buffer
* lisp/face-remap.el (face-attrs--make-indirect-safe):
(clone-indirect-buffer-hook): Set up a face remapping alist
(bug#53294).
* lisp/simple.el (clone-indirect-buffer): Move the point the hook
is run.
* src/buffer.c (Fmake_indirect_buffer, syms_of_buffer): Move the
place where the clone-indirect-buffer-hook variable is defined, so
that we can call it from C.
Jim Porter [Thu, 20 Jan 2022 13:37:54 +0000 (14:37 +0100)]
Consider subcommands when deciding to invoke Eshell command directly
When an Eshell command contains an asynchronous subcommand (such as
calling an external process), it must be evaluated iteratively. See
bug#30725.
* lisp/eshell/esh-cmd.el (eshell-invoke-command): Move most of the
logic from here...
(eshell--invoke-command-directly): ... to here. Also add checks for
subcommands.
* test/lisp/eshell/eshell-tests.el (eshell-test--max-subprocess-time):
New variable.
(eshell-wait-for-subprocess): New function.
(eshell-command-result-p): Use 'eshell-wait-for-subprocess'.
(eshell-test/interp-cmd-external): New test (bug#30725).
Eli Zaretskii [Thu, 20 Jan 2022 11:42:56 +0000 (13:42 +0200)]
Fix UB in ebrowse
* lib-src/ebrowse.c (matching_regexp): Avoid writing beyond the
limits of 'matching_regexp_buffer'. Patch by Jan Stranik
<jan@stranik.org>. (Bug#53333)
* lisp/help-fns.el (help-fns--insert-bindings): New function.
(help-fns--key-bindings): Split menu/key handling and output menu
bindings separately (bug#52870).
Po Lu [Thu, 20 Jan 2022 10:53:49 +0000 (10:53 +0000)]
Make system tooltips display in the menu bar on Haiku
* doc/emacs/haiku.texi (Haiku Basics): Update documentation.
* src/haiku_support.cc (Highlight): Apply the hack used for
regular menus to the menu bar as well.
* src/haikumenu.c (digest_menu_items): Set help text on menu bar
if `tooltip-mode' is t and system tooltips are used.
(syms_of_haikumenu): New symbol `tooltip-mode'.
Fchar_syntax did not convert unibyte characters to multibyte when the
current buffer was unibyte, in contrast to `char-syntax` in
byte-compiled code (bug#53260).
* src/bytecode.c (exec_byte_code): Call out to Fchar_syntax;
the dynamic frequency is too low to justify inlining here, and it
did lead to implementations diverging.
* src/syntax.c (Fchar_syntax): Convert non-ASCII unibyte values to
multibyte.
* test/src/syntax-tests.el (syntax-char-syntax): New test.
Jim Porter [Thu, 20 Jan 2022 09:35:38 +0000 (10:35 +0100)]
In Eshell, allow "-n" to suppress the trailing newline for "plain" echo
* doc/misc/eshell.texi (Built-in commands): Expand on the
documentation of echo (bug#27361).
* lisp/eshell/em-basic.el (eshell-echo): Respect OUTPUT-NEWLINE even
when 'eshell-plain-echo-behavior' is non-nil.
(eshell/echo): Add "-N" option and recommend its use over "-n" in
Lisp-friendly echo.
(eshell/printnl): Simplify; 'eshell-stringify' is equivalent to
calling 'eshell-echo' here.
Po Lu [Thu, 20 Jan 2022 09:55:07 +0000 (17:55 +0800)]
Make the undelete-frame-mode menu item a toggle
* lisp/menu-bar.el (menu-bar-file-menu): Make the undelete frame
mode option a toggle. (bug#53382)
Also enable some options that were disabled on NS, but should no
longer be since NS now supports the tab bar.
Martin Rudalics [Thu, 20 Jan 2022 09:30:08 +0000 (10:30 +0100)]
Add workaround to handle a problem with Enlightenment WM (Bug#53298)
* src/xterm.c (handle_one_xevent): Handle setting of variable
'x_set_frame_visibility_more_laxly' when receiving an Expose or
FocusIn event (Bug#53298).
(Qexpose): Define symbol.
(x_set_frame_visibility_more_laxly): New Lisp variable.
* etc/PROBLEMS: Mention frame redraw problem with the
Enlightenment WM and 'x-set-frame-visibility-more-laxly'
workaround.
* lisp/international/textsec.el (textsec-domain-suspicious-p):
Ensure that we're not confusing the user if there's a directional
override in the string we're checking.
Make article--check-suspicious-addresses more resilient
* lisp/gnus/gnus-art.el (article--check-suspicious-addresses): Be
more resilient to junk in headers. (But all this should be rewritten
eventually, because the entire process is way too convoluted.)
Andrea Corallo [Wed, 19 Jan 2022 20:07:00 +0000 (21:07 +0100)]
Suspend temp .elc production when native compiling till when necessary
* lisp/emacs-lisp/bytecomp.el (byte-to-native-output-buffer-file):
Rename from `byte-to-native-output-file'.
(byte-write-target-file): Update.
(byte-compile-file): Write the temporary .elc only when not native
compiling.
(byte-compile-file): Kill the .elc buffer only when not native
compiling.
* lisp/emacs-lisp/comp.el (batch-byte+native-compile): Instead of just
renaming the temporary .elc make use of `byte-write-target-file' to
write it down and kill the temporary buffer.
* lisp/gnus/gnus-art.el (gnus-treat-suspicious-headers): New user
option.
(gnus-article-treat-suspicious-headers): New function.
(article-decode-encoded-words): Hook into the machinery to check
headers.
(article--check-suspicious-addresses): New function.
Mark whole-script confusables as suspicious domains
* lisp/international/textsec.el (textsec-domain-suspicious-p):
Consider domain names that are whole-script confusables with ASCII
to be suspicious. (I think this is what the Unicode standard is
recommending, but I'm not 100% sure.)
Split textsec-email-address-suspicious-p into two functions
* lisp/international/textsec.el
(textsec-email-address-suspicious-p): Made into its own function.
(textsec-email-suspicious-p): Use it and adjust doc strings.
Po Lu [Wed, 19 Jan 2022 11:06:53 +0000 (19:06 +0800)]
Port some X11 tooltip code to XCB
* configure.ac: Require `xcb-aux' to be present before using
XCB.
* src/xfns.c (x_sync):
(x_create_tip_frame):
(Fx_show_tip): Port window related code to XCB.
* lisp/international/textsec.el (textsec-name-suspicious-p):
(textsec-domain-suspicious-p):
(textsec-local-address-suspicious-p):
(textsec-name-suspicious-p):
(textsec-suspicious-nonspacing-p):
(textsec-email-suspicious-p): Suspiciosness isn't only about
homoglyphs, so don't claim so in the doc strings.
Po Lu [Wed, 19 Jan 2022 09:39:04 +0000 (17:39 +0800)]
Use Cairo XCB surfaces when XCB is available
This lets us get at goodies such as shm support, which aren't
available with the xlib surface. (bug#52120)
* configure.ac: Test for cairo-xcb if cairo is available on X.
* src/xterm.c (USE_CAIRO_XCB_SURFACE): New define.
(x_begin_cr_clip): Create XCB surfaces if available.
(x_try_cr_xlib_drawable):
(x_scroll_run): Handle XCB surfaces.
(x_term_init): Find XCB visualtype structure.
* src/xterm.h (struct x_display_info): New field `xcb_visual'.
* src/xwidget.c (x_draw_xwidget_glyph_string): Fix integer
overflow.
Eli Zaretskii [Wed, 19 Jan 2022 08:57:03 +0000 (10:57 +0200)]
Minor improvement in textsec diagnostics
* lisp/international/textsec.el (textsec-suspicious-nonspacing-p):
Clarify wording of the strings returned to explain the suspicious
use of nonspacing characters.
Po Lu [Wed, 19 Jan 2022 02:08:52 +0000 (02:08 +0000)]
Use more reliable timestamps for some kinds of events on Haiku
* src/haiku_support.cc (DispatchMessage):
(MouseMoved):
(MouseDown):
(MouseUp): Set `time' field of event structures to input server
time.
* src/haiku_support.h (struct haiku_key_event):
(struct haiku_mouse_motion_event):
(struct haiku_button_event): New field `time'.
* src/haikuterm.c (haiku_read_socket): Use input server time
if provided.
Stefan Monnier [Tue, 18 Jan 2022 21:40:32 +0000 (16:40 -0500)]
autoload.el: Fix corner case and avoid encoding issues
* lisp/emacs-lisp/autoload.el (autoload-print-form): Don't burp when
autoloading a `cl-defmethod`.
(autoload-rubric): Support non-UTF-8 chars and enforce Unix EOLs.