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).
Po Lu [Sun, 23 Jan 2022 11:34:39 +0000 (19:34 +0800)]
Fix menus on the no-toolkit build when using XI2
* src/xmenu.c (x_activate_menubar):
(create_and_show_popup_menu): Only ungrab the device if it is
actually grabbed.
(x_menu_show): Release XI2 passive grab.
Alan Mackenzie [Sat, 22 Jan 2022 17:48:46 +0000 (17:48 +0000)]
Don't use 'load-read-function' in byte-compile-from-buffer
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Call
read-positioning-symbols directly, rather than binding load-read-function to
it. This is so that a lower level use of load-read-function will not return a
form containing symbols with position.
Michael Albinus [Sat, 22 Jan 2022 16:12:14 +0000 (17:12 +0100)]
Add direct remote copying in Tramp's scp support
* doc/misc/tramp.texi: Use @trampfn{} function where possible.
(Top, Configuration): Insert section 'Ssh setup' and remove
section 'Windows setup hints' in menu.
(Default Method): Mention tramp-use-scp-direct-remote-copying.
(Ssh setup): New node.
(Windows setup hints): Move it to that new node.
(Frequently Asked Questions): Move items about ssh config to that node.
* etc/NEWS: Add Tramp's direct remote copying feature. Fix typos.
* lisp/net/tramp-sh.el (tramp-use-scp-direct-remote-copying):
New defcustom.
(tramp-methods) <scp, scpx>: Add "%y" marker.
(tramp-scp-direct-remote-copying): New defun.
(tramp-do-copy-or-rename-file-out-of-band): Extend for direct
remote copying.
* lisp/net/tramp.el (tramp-methods): Extend docstring.
(tramp-password-prompt-not-unique): New defvar.
(tramp-read-passwd): Adapt docstring.
(tramp-read-passwd-without-cache): New defun.
(tramp-action-password): Call it.
* lisp/net/shr.el (shr-descend): Use a marker (because we may be
altering the text later for indentation), and mark the start, not
the end of the tag (bug#53409).
(shr-tag-a): Ditto.
Alan Mackenzie [Sat, 22 Jan 2022 09:59:05 +0000 (09:59 +0000)]
Miscellaneous amendments to the scratch/correct-warning-pos branch
* lisp/cedet/semantic/fw.el (semantic-alias-obsolete)
(semantic-varalias-obsolete): Replace calls to byte-compile-warn with calls to
byte-compile-warn-x (when it exists).
* lisp/emacs-lisp/bytecomp.el (byte-compile-log-warning-function)
(byte-compile--log-warning-for-byte-compile): Make the POSITION parameter no
longer &optional (for the benefit of flymake on *.el).
(byte-compile-log-warning): Replace a nil POSITION argument with an actual
position.
(byte-compile-file-form-require): Push the required symbol onto
byte-compile-form-stack, for the benefit of `do-after-load-evaluation'.
* lisp/keymap.el (define-keymap--compile): Replace four calls to
byte-compile-warn with byte-compile-warn-x.
* doc/lispref/elisp.texi (master menu): Add entries for Shorthands and Symbols
with position.
Eli Zaretskii [Sat, 22 Jan 2022 09:58:05 +0000 (11:58 +0200)]
Improve detection of suspicious uses of bidi controls
* lisp/international/textsec.el
(textsec-bidi-controls-suspicious-p): New function.
(textsec-name-suspicious-p): Use it.
* test/lisp/international/textsec-tests.el (test-suspicious-name):
Enable the test that was previously failing with
'bidi-find-overridden-directionality'.