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).
* etc/NEWS: Document the new user option.
* lisp/minibuffer.el (completions-sort): Add new user option.
(minibuffer-completion-help): Implement it for the Completions
buffer. (Bug#53362)
* src/eval.c (funcall_general, Ffuncall): Delegate the actual work in
Ffuncall to funcall_general which does exactly this.
This slows down some less used function call paths by a small amount
but the code duplication was just silly.
* src/bytecode.c (exec_byte_code): Inline aref and aset for
vectors and records, since this is important for code that makes heavy
use of arrays and/or objects.
It was implemented but never generated, originally intended for
TCO in the pre-lexbind era (which was semantically dubious anyway).
Removing it speeds up the interpreter because there is no longer any
need for the outermost `count` variable unless checking is enabled.
* lisp/emacs-lisp/bytecomp.el:
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst):
* src/bytecode.c (BYTE_CODES, exec_byte_code):
Remove definition and implementation of unbind-all, freeing up the opcode
for other purposes.
* src/bytecode.c (exec_byte_code): Perform bytecode unwinding error
check only when building with debugging (NDEBUG not defined, checking
enabled, or BYTE_CODE_SAFE enabled). This improves speed in several
ways.
Since we pass no arguments to a non-lexbind bytecode function, we can
specify its arity as 0 instead of nil and save a test and branch.
* src/bytecode.c (Fbyte_code, exec_byte_code):
* src/eval.c (fetch_and_exec_byte_code, funcall_lambda):
* src/lisp.h:
Change the args_template parameter type to ptrdiff_t, since it is now
always a small integer, in exec_byte_code and
fetch_and_exec_byte_code, all callers adjusted.
Avoid making a copy (in the interpreter C stack frame) of the bytecode
string by making sure it won't be moved by the GC. This is done by
reallocating it to the heap normally only used for large strings,
which isn't compacted.
This requires that we retain an explicit reference to the bytecode
string object (`bytestr`) lest it be GCed away should all other
references vanish during execution. We allocate an extra stack slot
for that, as we already do for the constant vector object.
* src/alloc.c (allocate_string_data): Add `immovable` argument.
(resize_string_data, make_clear_multibyte_string): Use it.
(pin_string): New.
* src/pdumper.c (dump_string): Fix incorrect comment.
Update hash for Lisp_String (only comments changed, not contents).
* src/lread.c (read1):
* src/alloc.c (Fmake_byte_code, purecopy):
* src/bytecode.c (Fbyte_code): Pin bytecode on object creation.
(exec_byte_code): Don't copy bytecode. Retain `bytestr` explicitly.
* src/lisp.h (Lisp_String): Explain special size_byte values.
(string_immovable_p): New.
Short-circuit the recursive bytecode funcall chain
Inline parts of the code for function calls to speed up the common
case of calling lexbound byte-code. By eliminating intermediate
functions, this also reduces C stack usage a little.
* src/bytecode.c (exec_byte_code): Inline parts of Ffuncall,
funcall_lambda and fetch_and_exec_byte_code in the Bcall opcode
handler.
* src/eval.c (backtrace_debug_on_exit): Inline and move to lisp.h.
(do_debug_on_call): Make global so that it can be called from
bytecode.c.
(funcall_general): New function, essentially the meat of Ffuncall.
* src/lisp.h (backtrace_debug_on_exit): Moved here from eval.c.
Martin Rudalics [Mon, 24 Jan 2022 09:33:15 +0000 (10:33 +0100)]
Orderly inhibit frame resizing when activating tool or tab bar (Bug#52986)
* src/xdisp.c (redisplay_tab_bar, redisplay_tool_bar): If we do
not display a tool or tab bar in these functions, still set
f->tool/tab_bar_redisplayed and f->tool/tab_bar_resized. This
avoids that when one of these are initially turned off, a later
activation resizes the frame despite of the fact that
'frame-inhibit-implied-resize' should prevent it (Bug#52986).
* src/xterm.c (x_xr_ensure_picture): New function.
(FRAME_CR_CONTEXT, FRAME_CR_CONTEXT):
(FRAME_CR_SURFACE_DESIRED_WIDTH)
(FRAME_CR_SURFACE_DESIRED_HEIGHT): Move to separate USE_CAIRO
block so the ext data code can be used on builds with XRender as
well.
(x_xr_apply_ext_clip):
(x_xr_reset_ext_clip): New functions.
(x_set_clip_rectangles):
(x_reset_clip_rectangles): Set ext data on XRender as well.
(x_term_init): Look for a picture format appropriate for our
purposes.
(x_clear_area): Use XRenderFillRectangle to draw backgrounds if
available.
(x_xrender_color_from_gc_foreground):
(x_xrender_color_from_gc_background): New functions.
* src/xterm.h (FRAME_X_PICTURE):
(FRAME_X_PICTURE_FORMAT)
(FRAME_CHECK_XR_VERSION): New macros.
(struct x_gc_ext_data): Define on XRender as well.
(struct x_display_info): Define ext_codes when using XRender and
add new field `pict_format'.
(struct x_output): New field `picture'.
Alan Mackenzie [Mon, 24 Jan 2022 01:08:03 +0000 (01:08 +0000)]
Expunge read-with-symbol-position and read-symbol-positions-list
These are remnants of the old way of determining byte compiler warning
positions.
* src/lread.c (read_internal_start, read1): Remove initializations amd
manipulations of these variables.
(syms_of_lread): Remove the declarations of the variables.
* lisp/emacs-list/bytecomp.el (compile-defun, byte-compile-from-buffer):
Remove bindings of the variables.
* tabulated-list.el (tabulated-list-widen-current-column): Use correct
comparison operation when checking if point is within the column
bounds (bug#53375).
Allow using outline minor mode in `M-x apropos-value'
* lisp/apropos.el (apropos-mode): Set up outline minor mode
(bug#31094).
(apropos-value): Don't add "---" separators, because it doesn't
really seem to add anything much.
(apropos-value-internal): Escape newlines so that no values can be
confused for headings.
Alan Mackenzie [Sun, 23 Jan 2022 13:47:38 +0000 (13:47 +0000)]
Fix position argument to macroexp--warn-wrap in cconv--convert-funcbody
* lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): Change the position
argument to macroexp--warn-wrap from BODY to ARG, to give correct positions in
warning messages.
Improve `M-x speedbar' under emacs -nw very slightly
* lisp/speedbar.el (speedbar-frame-mode): `M-x speedbar' doesn't
seem to do anything visible under -nw, so issue a message in that
case to tell the user how to proceed (bug#32597).