Po Lu [Fri, 28 Jan 2022 02:41:03 +0000 (10:41 +0800)]
Implement xwidget passive grabs
* src/xwidget.c (find_widget_at_pos): New parameters for
controlling whether to respect grabs. All callers changed.
(window_coords_from_toplevel): Make work when the widget is
the toplevel.
(find_widget): Fix coding style.
(xwidget_button_1): Set and clear passive grabs if appropriate.
(xw_maybe_synthesize_crossing): Allow current_window to be NULL
if the mode is XW_CROSSING_LEFT.
* doc/emacs/cmdargs.texi (Initial Options): Mention it.
* lisp/startup.el (normal-top-level): Move the eln init to after
we've processed the command line arguments.
(command-line): Interpret the --init-directory switch.
Andrea Corallo [Thu, 27 Jan 2022 17:18:13 +0000 (18:18 +0100)]
Fix potential native compiler circular dependencies during load
* lisp/startup.el (startup--require-comp-safetly): New function.
(startup--honor-delayed-native-compilations): Make use of
`startup--require-comp-safetly'.
* src/comp.c (CALL0I): New define.
(maybe_defer_native_compilation): Make use of
`startup--require-comp-safetly'.
* lisp/files.el (files--buffers-needing-to-be-saved): Separated
out into its own function...
(save-some-buffers): ... from here.
(save-buffers-kill-emacs): Check that we have anything to save
before prompting the user.
Eli Zaretskii [Thu, 27 Jan 2022 18:35:22 +0000 (20:35 +0200)]
Improve detection of glyphless characters on TTY frames
* src/term.c (produce_glyphs): If the terminal can report for
which characters it has glyphs, use that to determine whether
a given character should be displayed as glyphless.
Daniel Nicolai [Thu, 27 Jan 2022 16:03:38 +0000 (17:03 +0100)]
Add support for EPUB, CBZ, FB2 and (O)XPS extension to doc view
* doc/emacs/misc.texi (Document View): Add requirements for new
extensions (i.e. mutool).
* lisp/doc-view.el (doc-view): Additionally update preliminary comment
(doc-view-custom-set-epub-font-size): redraw image after setting
(doc-view-unoconv-program): Put code all on one line
(doc-view-doc-type): Update docstring.
(doc-view-kill-proc): Fix comment indentation
(doc-view-mode-p):
Add check for new extensions and alternative check for PDF
(doc-view-pdf/ps->png): Associate new extension with png converter
(doc-view-convert-current-doc): Handle new extensions like PDF's
(doc-view-set-doc-type): Set correct doc-type for new extensions.
* lisp/files.el (auto-mode-alist):
Associate new extension types with doc-view.
Po Lu [Thu, 27 Jan 2022 13:36:52 +0000 (21:36 +0800)]
Improve xwidget window ancestry calculations
* src/xwidget.c (xw_find_common_ancestor):
(xw_notify_virtual_upwards_until)
(xw_notify_virtual_downwards_until): New functions.
(xw_maybe_synthesize_crossing): Synthesize virtual events like
GTK does for non-linear changes.
Po Lu [Thu, 27 Jan 2022 05:56:32 +0000 (13:56 +0800)]
Implement crossing event generation between windows for xwidgets on X
* src/xwidget.c (enum xw_crossing_mode): New enum.
(xwidget_motion_notify):
(xwidget_motion_or_crossing): Synthesize crossing events if the
pointer moved between different windows.
(window_coords_from_toplevel):
(xw_maybe_synthesize_crossing): New functions.
(xwidget_init_view): Initialize new field to NULL.
(Fdelete_xwidget_view): Clear last crossing window.
* src/xwidget.h (struct xwidget_view): New field
`last_crossing_window'.
Sean Whitton [Wed, 26 Jan 2022 13:13:00 +0000 (14:13 +0100)]
Fix input of sharp-quoted symbols in Eshell with em-extpipe
* lisp/eshell/em-extpipe.el (eshell-parse-external-pipeline): Fix
misinterpreting sharp-quoted symbols as the beginning of single-quoted
strings (Bug#53518). Add protection against a possible infinite loop.
* test/lisp/eshell/em-extpipe-tests.el (em-extpipe-test-17): New
test (bug#53518).
Po Lu [Wed, 26 Jan 2022 01:20:48 +0000 (01:20 +0000)]
Make `haiku-menu-bar-open' faster
* src/haikumenu.c (Fhaiku_menu_bar_open): Get draw lock before
updating the menu bar.
* src/haikuterm.c (haiku_read_socket): Don't update menu bar if
b->no_lock.
Improve how change-log-mode fills all-file-name lines
* lisp/vc/add-log.el (change-log-fill-file-list): New function to
improve how we fill all-file-name ChangeLog lines (bug#19341).
(change-log-indent): Use it.
Andrea Corallo [Tue, 25 Jan 2022 11:01:55 +0000 (12:01 +0100)]
* `batch-byte+native-compile' produce .eln younger than .elc (bug#52912)
* lisp/emacs-lisp/comp.el (batch-native-compile): Add return
value.
(batch-byte+native-compile): Touch the produced .eln after the
corresponding .elc is produced.
Split the C auxiliary function `concat` into separate functions for
string and list/vector as target types, respectively. This makes them
simpler and faster.
Implement `Fcopy_sequence` more efficiently for strings, lists and
vectors instead of using `concat`.
The result is a significant performance increase for the Lisp
built-ins concat, append, vconcat, copy-sequence and anything using
them such as mapconcat, copy-alist and propertize.
* src/fns.c (concat2, concat3, Fconcat): Use concat_strings.
(Fappend, Fvconcat): Adapt to changed signature of concat.
(Fcopy_sequence): Faster implementation for lists, strings, and vectors.
(concat_strings): New.
(concat): Strip code for string target, simplify, optimise.
(Fcopy_alist): Use Fcopy_sequence.
Jim Porter [Tue, 25 Jan 2022 05:03:42 +0000 (21:03 -0800)]
Don't manipulate args in-place for 'eshell-eval-using-options'
This is necessary for preserve the original arguments to forward on to
:external commands. Previously, when :preserve-args was also set, the
original argument list could be altered, changing the meaning of the
command.
* lisp/eshell/esh-opt.el (eshell-eval-using-options): Copy MACRO-ARGS
when :preserve-args is set, and pass the original value to
'eshell--do-opts'.
(eshell--do-opts): Use the original arguments when calling an external
command.
* lisp/eshell/em-tramp.el (eshell/su, eshell/sudo): Don't copy the
original arguments, since 'eshell-eval-using-options' does this for
us.
* test/lisp/eshell/esh-opt-tests.el (esh-opt-process-args-test):
Split this test into...
(esh-opt-test/process-args)
(esh-opt-test/process-args-parse-leading-options-only)
(esh-opt-test/process-args-external): ... these.
(test-eshell-eval-using-options): Split this test into...
(esh-opt-test/eval-using-options-short)
(esh-opt-test/eval-using-options-long)
(esh-opt-test/eval-using-options-constant)
(esh-opt-test/eval-using-options-user-specified)
(esh-opt-test/eval-using-options-short-single-token)
(esh-opt-test/eval-using-options-terminate-options)
(esh-opt-test/eval-using-options-parse-leading-options-only)
(esh-opt-test/eval-using-options-unrecognized): ... these.
(esh-opt-test/eval-using-options-external): New test.
Po Lu [Tue, 25 Jan 2022 11:19:20 +0000 (11:19 +0000)]
Improve reliability of menu bar updates on Haiku
* src/haiku_support.cc (class EmacsWindow): New fields
`menu_update_cv', `menu_update_mutex' and `menu_updated_p'.
(~EmacsWindow): Destroy cv and mutex.
(MenusBeginning): Release lock and wait for condition to be
become true.
(EmacsWindow_signal_menu_update_complete): New function.
* src/haiku_support.h (struct haiku_menu_bar_state_event): New
field `no_lock'.
* src/haikumenu.c (Fhaiku_menu_bar_open): Always update menu
bar.
* src/haikuterm.c (haiku_read_socket): Always update menu bar
and signal the window thread after update completion.
Stefan Monnier [Tue, 25 Jan 2022 02:31:53 +0000 (21:31 -0500)]
Remove some dubious uses of `interactive-form`
* lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): `commandp` and
`interactive-form` are for function values, not for source code.
* lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag):
Prefer `commandp` over `interactive-form`.
Sean Whitton [Sun, 23 Jan 2022 01:54:55 +0000 (18:54 -0700)]
Rework eshell-match-result for testing asynchronous commands
When using eshell-match-result via eshell-command-result-p to examine
the output of asynchronous Eshell commands, a newly emitted prompt is
included in the text against which the regexp is matched. This makes
it awkward to match against the whole output; for example, to check
whether it is empty. Rework the function to exclude the prompt.
* test/lisp/eshell/eshell-tests-helpers.el (eshell-match-result):
Exclude any newly emitted prompt from the text against which the
regexp is matched. Additionally, the function no longer moves point.
* test/lisp/eshell/eshell-tests.el (eshell-test/flush-output): Update
and simplify test given how eshell-match-result no longer moves point.
Miha Rihtaršič [Sun, 23 Jan 2022 20:13:24 +0000 (21:13 +0100)]
Implement alternative sub-buffer support in term.el
* etc/e/eterm-color.ti: Added termcaps for entering and leaving an
alternative sub-buffer.
* lisp/term.el (term-reset-size): Resize correctly in an alternative
sub-buffer is in use.
(term-clear-full-screen-programs): New user option.
(term-handle-ansi-escape):
(term-termcap-format): Handle termcaps for entering and leaving an
alternative sub-buffer.
(term-switch-to-alternate-sub-buffer): New (used to be commented out)
function to enter or leave an alternative sub-buffer.
bug#53485
Juri Linkov [Mon, 24 Jan 2022 18:52:59 +0000 (20:52 +0200)]
* lisp/info.el (Info-link-keymap): Fix repetitive clicks on the header line.
Rebind [header-line mouse-1] from mouse-select-window to
Info-mouse-follow-link. It selects the window anyway,
but also allows repetitively clicking on the Next button
on the Info header line (bug#53170).
Juri Linkov [Mon, 24 Jan 2022 18:28:10 +0000 (20:28 +0200)]
* lisp/faces.el (read-face-name): Support a list of defaults for M-n.
When MULTIPLE is nil and the arg DEFAULT is a list, keep its elements
in the "future history" of the minibuffer retrieved by `M-n M-n ...'.
(bug#53255)
Don't output spurious prefixes in read-char-exclusive
* src/keyboard.c (read_char): Don't touch the echo area if
Vecho_keystrokes is nil.
* src/lread.c (read_filtered_event): Bind echo_keystrokes to nil
to avoid outputting prefixes we're not going to act on anyway
(bug#19718).