]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years ago; * test/lisp/emacs-lisp/derived-tests.el: Silence byte-compiler.
Stefan Kangas [Tue, 25 Jan 2022 23:44:00 +0000 (00:44 +0100)]
; * test/lisp/emacs-lisp/derived-tests.el: Silence byte-compiler.

2 years ago* src/image.c (parse_image_spec): Use NILP.
Stefan Kangas [Tue, 25 Jan 2022 23:42:10 +0000 (00:42 +0100)]
* src/image.c (parse_image_spec): Use NILP.

2 years agoImprove how change-log-mode fills all-file-name lines
Lars Ingebrigtsen [Tue, 25 Jan 2022 13:55:26 +0000 (14:55 +0100)]
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.

2 years agoFix up Gnus FAQ entry
Lars Ingebrigtsen [Tue, 25 Jan 2022 13:37:50 +0000 (14:37 +0100)]
Fix up Gnus FAQ entry

* doc/misc/gnus-faq.texi (FAQ 3-9): Remove mention of
nnimap-list-pattern, which was removed some years ago (bug#53522).

2 years ago* src/comp.c (emit_lisp_obj_rval): Make use of NILP.
Andrea Corallo [Tue, 25 Jan 2022 21:15:51 +0000 (22:15 +0100)]
* src/comp.c (emit_lisp_obj_rval): Make use of NILP.

2 years ago;* src/fns.c (concat_strings): Add missing space.
Andrea Corallo [Tue, 25 Jan 2022 21:05:05 +0000 (22:05 +0100)]
;* src/fns.c (concat_strings): Add missing space.

2 years ago* src/comp.c (emit_limple_insn): Fix another int/Lisp_Object mixup
Stefan Monnier [Tue, 25 Jan 2022 19:36:48 +0000 (14:36 -0500)]
* src/comp.c (emit_limple_insn): Fix another int/Lisp_Object mixup

2 years agoTag an mml-sec test
Glenn Morris [Tue, 25 Jan 2022 17:38:50 +0000 (09:38 -0800)]
Tag an mml-sec test

* test/lisp/gnus/mml-sec-tests.el (mml-secure-en-decrypt-3):
Tag unstable on hydra.nixos.org due to repeated intermittent failures.

2 years ago; * src/fns.c (concat_strings): Fix comment style.
Eli Zaretskii [Tue, 25 Jan 2022 17:12:50 +0000 (19:12 +0200)]
; * src/fns.c (concat_strings): Fix comment style.

2 years ago* src/fns.c (concat_strings): Clean-up unused variable.
Andrea Corallo [Tue, 25 Jan 2022 16:52:43 +0000 (17:52 +0100)]
* src/fns.c (concat_strings): Clean-up unused variable.

2 years ago* `batch-byte+native-compile' produce .eln younger than .elc (bug#52912)
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.

2 years ago* lisp/emacs-lisp/comp.el (batch-byte+native-compile): Fix unwind form
Andrea Corallo [Mon, 24 Jan 2022 14:29:38 +0000 (15:29 +0100)]
* lisp/emacs-lisp/comp.el (batch-byte+native-compile): Fix unwind form

2 years ago* src/lisp.h (lisp_h_EQ, lisp_h_NILP): Fix length and indent
Stefan Monnier [Tue, 25 Jan 2022 15:03:01 +0000 (10:03 -0500)]
* src/lisp.h (lisp_h_EQ, lisp_h_NILP): Fix length and indent

2 years agoFaster concat, append, vconcat, copy-sequence, etc
Mattias Engdegård [Fri, 21 Jan 2022 09:00:19 +0000 (10:00 +0100)]
Faster concat, append, vconcat, copy-sequence, etc

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.

2 years agoDon't mutate literals in tabulated-list-widen-current-column
Lars Ingebrigtsen [Tue, 25 Jan 2022 13:21:22 +0000 (14:21 +0100)]
Don't mutate literals in tabulated-list-widen-current-column

* lisp/emacs-lisp/tabulated-list.el
(tabulated-list-widen-current-column): Avoid mutating constants
(bug#53501).

2 years agoFix widening some columns in tabulated-list-widen-current-column
Lars Ingebrigtsen [Tue, 25 Jan 2022 12:58:30 +0000 (13:58 +0100)]
Fix widening some columns in tabulated-list-widen-current-column

* lisp/emacs-lisp/tabulated-list.el
(tabulated-list-widen-current-column): Don't bug out on list-based
columns (bug#53498).

2 years agoTreat "-" as a positional arg in 'eshell-eval-using-options'
Jim Porter [Tue, 25 Jan 2022 05:08:50 +0000 (21:08 -0800)]
Treat "-" as a positional arg in 'eshell-eval-using-options'

* lisp/eshell/esh-opt.el (eshell--process-args): Treat "-" as a
positional arg.

* lisp/eshell/em-tramp.el (eshell/su): Simplify checking for "-".

* test/lisp/eshell/esh-opt-tests.el
(esh-opt-test/eval-using-options-stdin): New test.

2 years agoDon't manipulate args in-place for 'eshell-eval-using-options'
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.

* test/lisp/eshell/em-tramp-tests.el: New tests.

2 years agoImprove the term-clear-full-screen-programs doc string
Lars Ingebrigtsen [Tue, 25 Jan 2022 11:51:23 +0000 (12:51 +0100)]
Improve the term-clear-full-screen-programs doc string

* lisp/term.el (term-clear-full-screen-programs): Improve the doc
string.

2 years agoImprove reliability of menu bar updates on Haiku
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.

2 years ago* src/haiku_support.cc (Highlight): Send events if !highlight_p.
Po Lu [Tue, 25 Jan 2022 10:18:35 +0000 (10:18 +0000)]
* src/haiku_support.cc (Highlight): Send events if !highlight_p.

2 years agoDon't send menu help events on Haiku if the pointer isn't in the menu
Po Lu [Tue, 25 Jan 2022 10:02:16 +0000 (10:02 +0000)]
Don't send menu help events on Haiku if the pointer isn't in the menu

* src/haiku_support.cc (Highlight): Only send help events
if the mouse cursor is actually in the menu.

2 years agoFix tool bar size reporting on GTK when the display is scaled
Po Lu [Tue, 25 Jan 2022 06:42:33 +0000 (14:42 +0800)]
Fix tool bar size reporting on GTK when the display is scaled

* src/gtkutil.c (xg_update_tool_bar_sizes): Multiply sizes to
turn them into device pixels.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Tue, 25 Jan 2022 05:31:03 +0000 (06:31 +0100)]
Merge from origin/emacs-28

c34d06e3d7 * configure.ac (LIBSECCOMP): Bump minimum version for facc...
335a5a9e0f Make the `f' command work in image-mode again

2 years agoImprove portability of X11 IM code
Po Lu [Tue, 25 Jan 2022 03:49:39 +0000 (11:49 +0800)]
Improve portability of X11 IM code

* configure.ac: Test for XICCallback.callback if X11R6 or later.
* src/xfns.c (Xxic_preedit_start_callback): Use XICCallback if
present.

2 years agoRemove some dubious uses of `interactive-form`
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`.

2 years agoFix invalid picture after toggling the tool bar or menu bar on GTK
Po Lu [Tue, 25 Jan 2022 02:14:28 +0000 (10:14 +0800)]
Fix invalid picture after toggling the tool bar or menu bar on GTK

* src/xterm.c (x_drop_xrender_surfaces): New function.
(handle_one_xevent): Call x_drop_xrender_surfaces instead of
just font_drop_xrender_surfaces.

2 years agoFix GTK native input on scaled displays
Po Lu [Tue, 25 Jan 2022 00:21:55 +0000 (08:21 +0800)]
Fix GTK native input on scaled displays

* src/xfns.c (xic_set_preeditarea): Scale preedit spot rectangle
before giving it to GTK.

2 years agoAdd Eshell syntax to more easily bypass Eshell's own pipelining
Sean Whitton [Mon, 17 Jan 2022 22:15:36 +0000 (15:15 -0700)]
Add Eshell syntax to more easily bypass Eshell's own pipelining

* etc/NEWS:
* doc/misc/eshell.texi (Input/Output): Document the new syntax.
* lisp/eshell/em-extpipe.el: New module (Bug#46351).
* test/lisp/eshell/em-extpipe-tests.el: New tests.
* lisp/eshell/esh-module.el (eshell-modules-list): Add `eshell-extpipe'.

2 years agoRework eshell-match-result for testing asynchronous commands
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.

2 years agoMove Eshell test helpers to their own file
Sean Whitton [Sat, 22 Jan 2022 05:32:22 +0000 (22:32 -0700)]
Move Eshell test helpers to their own file

* test/lisp/eshell/eshell-tests.el:
* test/lisp/eshell/eshell-tests-helpers.el: Move helpers to own file.

2 years agoMake hi-lock-face-defaults into a defcustom
Lars Ingebrigtsen [Mon, 24 Jan 2022 19:14:15 +0000 (20:14 +0100)]
Make hi-lock-face-defaults into a defcustom

* lisp/hi-lock.el (hi-lock-face-defaults): Make into defcustom.

2 years ago* lisp/hi-lock.el (hi-lock-use-overlays): New variable.
Juri Linkov [Mon, 24 Jan 2022 19:15:37 +0000 (21:15 +0200)]
* lisp/hi-lock.el (hi-lock-use-overlays): New variable.

(hi-lock-set-pattern): Use it.  Set overlay priority to 1.
(bug#53155)

2 years agoAdd NEWS entry for term-clear-full-screen-programs
Lars Ingebrigtsen [Mon, 24 Jan 2022 19:02:26 +0000 (20:02 +0100)]
Add NEWS entry for term-clear-full-screen-programs

2 years agoImplement alternative sub-buffer support in term.el
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

2 years ago* lisp/info.el (Info-link-keymap): Fix repetitive clicks on the header line.
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).

2 years agoDon't list the default hi-lock faces twice in the future history
Lars Ingebrigtsen [Mon, 24 Jan 2022 18:51:55 +0000 (19:51 +0100)]
Don't list the default hi-lock faces twice in the future history

* lisp/hi-lock.el (hi-lock-read-face-name): Don't include faces
twice in the defaults (bug#19877).

2 years agoFix gnus-article-truncate-lines doc string
Lars Ingebrigtsen [Mon, 24 Jan 2022 18:41:15 +0000 (19:41 +0100)]
Fix gnus-article-truncate-lines doc string

* lisp/gnus/gnus-art.el (gnus-article-truncate-lines): Fix doc
string.

2 years ago* etc/NEWS: Mention 'replace-regexp-function' (bug#52558).
Juri Linkov [Mon, 24 Jan 2022 18:45:53 +0000 (20:45 +0200)]
* etc/NEWS: Mention 'replace-regexp-function' (bug#52558).

2 years ago* lisp/faces.el (read-face-name): Support a list of defaults for M-n.
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)

2 years ago* lisp/minibuffer.el (completions-sort): Fix type.
Glenn Morris [Mon, 24 Jan 2022 18:16:36 +0000 (10:16 -0800)]
* lisp/minibuffer.el (completions-sort): Fix type.

Flagged by test-custom-opts.

2 years agoDon't output spurious prefixes in read-char-exclusive
Lars Ingebrigtsen [Mon, 24 Jan 2022 17:17:10 +0000 (18:17 +0100)]
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).

2 years agoAllow sorting in electric-buffer-list with `S'
Lars Ingebrigtsen [Mon, 24 Jan 2022 16:22:49 +0000 (17:22 +0100)]
Allow sorting in electric-buffer-list with `S'

* lisp/ebuff-menu.el (electric-buffer-menu-mode-map): Add the `S'
sorting command here, too (bug#20178).

2 years agoERC: Add new comaintainer, F. Jason Park
Amin Bandali [Mon, 24 Jan 2022 15:59:05 +0000 (10:59 -0500)]
ERC: Add new comaintainer, F. Jason Park

* lisp/erc/erc*.el: Add J.P. as my comaintainer to headers.

2 years agoFix \href{a_b} in tex-mode
Lars Ingebrigtsen [Mon, 24 Jan 2022 14:19:38 +0000 (15:19 +0100)]
Fix \href{a_b} in tex-mode

* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-2): Fontify
href parameters like constants so that _ aren't fontified like
subscripts.

2 years agoRevert "Fix tex-mode handling of _ chars in href{} commands"
Lars Ingebrigtsen [Mon, 24 Jan 2022 14:15:59 +0000 (15:15 +0100)]
Revert "Fix tex-mode handling of _ chars in href{} commands"

This reverts commit 487a0be7f7eb0ca9402247f13a11e39aa2946d05.

This will be fixed a different way.

2 years agoAdd derived-mode test for bug#24176
Lars Ingebrigtsen [Mon, 24 Jan 2022 14:10:18 +0000 (15:10 +0100)]
Add derived-mode test for bug#24176

2 years agoMake anonymous functions work in auto-mode-alist
Lars Ingebrigtsen [Mon, 24 Jan 2022 14:05:28 +0000 (15:05 +0100)]
Make anonymous functions work in auto-mode-alist

* lisp/files.el (set-auto-mode--apply-alist): Don't infloop on
anonymous functions in auto-mode-alist (bug#20709).

2 years ago; * src/bytecode.c (exec_byte_code): Silence GCC warning
Mattias Engdegård [Mon, 24 Jan 2022 14:02:17 +0000 (15:02 +0100)]
; * src/bytecode.c (exec_byte_code): Silence GCC warning

2 years agoDon't loop so much in gud-query-cmdline on remote systems
Lars Ingebrigtsen [Mon, 24 Jan 2022 13:55:35 +0000 (14:55 +0100)]
Don't loop so much in gud-query-cmdline on remote systems

* lisp/progmodes/gud.el (gud-query-cmdline): Avoid looping over
large numbers of files on remote systems (bug#21528).

2 years agoMake Completions sorting a user option
Protesilaos Stavrou [Wed, 19 Jan 2022 12:20:19 +0000 (14:20 +0200)]
Make Completions sorting a user option

* 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)

2 years agoAllow jumping to ert failure definitions
Lars Ingebrigtsen [Mon, 24 Jan 2022 13:00:50 +0000 (14:00 +0100)]
Allow jumping to ert failure definitions

* lisp/emacs-lisp/ert.el (ert-test):
(ert-deftest):  Store the file name.
(ert-test-location): New function.
(ert-run-tests-batch): Use it.

* lisp/emacs-lisp/find-func.el (find-ert-deftest-regexp): New
variable.
(find-function-regexp-alist): Add ert-deftest (bug#22471).

Based on code by Phillip Lord <phillip.lord@russet.org.uk>.

2 years ago* configure.ac: Remove forgotten GLIB_GSETTINGS call
Yuuki Harano [Mon, 24 Jan 2022 12:26:17 +0000 (21:26 +0900)]
* configure.ac: Remove forgotten GLIB_GSETTINGS call

2 years agoAdd NEWS item for `I' command
Lars Ingebrigtsen [Mon, 24 Jan 2022 12:02:00 +0000 (13:02 +0100)]
Add NEWS item for `I' command

2 years agoAdd a *Help* command that'll take you to the lispref manual
Lars Ingebrigtsen [Mon, 24 Jan 2022 11:59:55 +0000 (12:59 +0100)]
Add a *Help* command that'll take you to the lispref manual

* doc/emacs/help.texi (Help Mode): Document it.
* lisp/help-mode.el (help-mode-map): Add an `I' keystroke.
(help-goto-lispref-info): New command.

* lisp/info-look.el (:mode): Add an entry for the lispref manual.

2 years agoFix tex-mode handling of _ chars in href{} commands
Lars Ingebrigtsen [Mon, 24 Jan 2022 11:39:02 +0000 (12:39 +0100)]
Fix tex-mode handling of _ chars in href{} commands

* lisp/textmodes/tex-mode.el (tex--current-command): New function
(bug#23102).
(tex-font-lock-suscript): Don't subscript _ chars in href.

2 years agoMake `font-lock-add-keywords' work in derived modes
Lars Ingebrigtsen [Mon, 24 Jan 2022 10:55:57 +0000 (11:55 +0100)]
Make `font-lock-add-keywords' work in derived modes

* lisp/font-lock.el (font-lock-set-defaults): Make
`font-lock-add-keywords' work in derived modes (bug#24176).

2 years agoRemove redundant declarations from keyboard.h that are now in lisp.h
Po Lu [Mon, 24 Jan 2022 10:49:54 +0000 (18:49 +0800)]
Remove redundant declarations from keyboard.h that are now in lisp.h

* src/keyboard.h (process_pending_signals)
(pending_signals): Remove declarations.

2 years agoInline maybe_quit
Mattias Engdegård [Sat, 15 Jan 2022 15:23:09 +0000 (16:23 +0100)]
Inline maybe_quit

Since `maybe_quit` is called on many critical paths, inline a slightly
cheaper condition (that ignores Vinhibit_quit).

* src/eval.c (maybe_quit): Rename to `probably_quit`.
* src/lisp.h (maybe_quit): New simplified inline function.

2 years agoBump specpdl inline, move reallocation out of line
Mattias Engdegård [Sat, 15 Jan 2022 13:51:09 +0000 (14:51 +0100)]
Bump specpdl inline, move reallocation out of line

The common case is just to increment `specpdl_ptr`; do that in-line,
but move the uncommon reallocation to a separate subroutine.

* src/eval.c (grow_specpdl): Now inline, most code moved...
(grow_specpdl_allocation): ...here.

2 years agoImplement Ffuncall in terms of funcall_general
Mattias Engdegård [Wed, 12 Jan 2022 11:05:26 +0000 (12:05 +0100)]
Implement Ffuncall in terms of funcall_general

* 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.

2 years ago; * lisp/emacs-lisp/byte-opt.el: Remove outdated comments
Mattias Engdegård [Sun, 2 Jan 2022 15:11:45 +0000 (16:11 +0100)]
; * lisp/emacs-lisp/byte-opt.el: Remove outdated comments

These were optimisation ideas that have been implemented, have become
irrelevant, or were impractical to begin with.

2 years agoOpen-code aref and aset in bytecode interpreter
Mattias Engdegård [Sun, 2 Jan 2022 11:19:54 +0000 (12:19 +0100)]
Open-code aref and aset in bytecode interpreter

* 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.

2 years agoRemove the unused unbind-all bytecode
Mattias Engdegård [Sun, 2 Jan 2022 10:35:16 +0000 (11:35 +0100)]
Remove the unused unbind-all bytecode

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.

2 years agoMove a runtime interpreter check to debug mode
Mattias Engdegård [Sun, 2 Jan 2022 10:15:41 +0000 (11:15 +0100)]
Move a runtime interpreter check to debug mode

* 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.

2 years agoRemove nil check in exec_byte_code
Mattias Engdegård [Sat, 1 Jan 2022 21:39:17 +0000 (22:39 +0100)]
Remove nil check in exec_byte_code

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.

2 years ago; * src/bytecode.c (exec_byte_code): Cosmetic improvement
Mattias Engdegård [Sat, 1 Jan 2022 14:33:27 +0000 (15:33 +0100)]
; * src/bytecode.c (exec_byte_code): Cosmetic improvement

Implement point_max in the same way as point_min.

2 years agoByte code arity check micro-optimisation
Mattias Engdegård [Fri, 31 Dec 2021 18:44:02 +0000 (19:44 +0100)]
Byte code arity check micro-optimisation

* src/bytecode.c (exec_byte_code): Slight simplification.

2 years agoPin bytecode strings to avoid copy at call time
Mattias Engdegård [Fri, 31 Dec 2021 16:24:31 +0000 (17:24 +0100)]
Pin bytecode strings to avoid copy at call time

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.

2 years agoInline setcar and setcdr in byte-code interpreter
Mattias Engdegård [Fri, 31 Dec 2021 15:47:56 +0000 (16:47 +0100)]
Inline setcar and setcdr in byte-code interpreter

The function call overhead is nontrivial in comparison to the actual
code which makes this worthwhile.

* src/bytecode.c (exec_byte_code):
Inline code from Fsetcar and Fsetcdr.

2 years agoInline fixnum operations in bytecode interpreter
Mattias Engdegård [Thu, 30 Dec 2021 17:48:53 +0000 (18:48 +0100)]
Inline fixnum operations in bytecode interpreter

Since numeric operations are mostly done on fixnums, this gives a
speed-up for common code.

* src/bytecode.c (exec_byte_code): Inline fixnum comparisons and
operations with fixnum results: =, >, <, <=, >=, -, +, -, *, /, %, max
and min.

2 years agoShort-circuit the recursive bytecode funcall chain
Mattias Engdegård [Tue, 28 Dec 2021 15:50:07 +0000 (16:50 +0100)]
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.

2 years ago* configure.ac (LIBSECCOMP): Bump minimum version for faccessat2.
Philipp Stephani [Mon, 24 Jan 2022 10:35:07 +0000 (11:35 +0100)]
* configure.ac (LIBSECCOMP): Bump minimum version for faccessat2.

2 years agoMake the `f' command work in image-mode again
Lars Ingebrigtsen [Mon, 24 Jan 2022 10:22:49 +0000 (11:22 +0100)]
Make the `f' command work in image-mode again

* lisp/image.el (image-show-frame): Protect against not having
computed the animation data yed (bug#53489).

2 years agoAdd "then" to sh--completion-keywords
Lars Ingebrigtsen [Mon, 24 Jan 2022 10:16:30 +0000 (11:16 +0100)]
Add "then" to sh--completion-keywords

* lisp/progmodes/sh-script.el (sh--completion-keywords): Allow
completing over "then" (bug#53490).

2 years agoFix Gnus registry key bindings
Lars Ingebrigtsen [Mon, 24 Jan 2022 10:09:40 +0000 (11:09 +0100)]
Fix Gnus registry key bindings

* lisp/gnus/gnus-registry.el (gnus-registry-install-shortcuts):
Don't overwrite all other M M commands (bug#53492).

2 years ago; * src/xfns.c (xic_preedit_draw_callback): Init text_length to quieten gcc.
Martin Rudalics [Mon, 24 Jan 2022 09:43:56 +0000 (10:43 +0100)]
; * src/xfns.c (xic_preedit_draw_callback): Init text_length to quieten gcc.

2 years agoOrderly inhibit frame resizing when activating tool or tab bar (Bug#52986)
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).

2 years ago* src/xterm.c (x_composite_image): Use the display's picture format.
Po Lu [Mon, 24 Jan 2022 08:22:54 +0000 (16:22 +0800)]
* src/xterm.c (x_composite_image): Use the display's picture format.

2 years agoScale coordinates when checking if a touch event falls inside menu bar
Po Lu [Mon, 24 Jan 2022 07:35:48 +0000 (15:35 +0800)]
Scale coordinates when checking if a touch event falls inside menu bar

* src/xterm.c (handle_one_xevent): Apply scale to touch event
coordinates before intersecting them with the menu bar.

2 years agoAvoid glitches in ELC lines in build output
Paul Eggert [Mon, 24 Jan 2022 07:22:04 +0000 (23:22 -0800)]
Avoid glitches in ELC lines in build output

* src/verbose.mk.in (AM_V_ELC, AM_V_ELN): Use ifneq not ifdef, as
we want have_working_info’s value expanded (Bug#53358).

2 years ago* src/xterm.c (handle_one_xevent): Drop frame picture on configure.
Po Lu [Mon, 24 Jan 2022 04:54:26 +0000 (12:54 +0800)]
* src/xterm.c (handle_one_xevent): Drop frame picture on configure.

2 years agoAdd some code for transparent frame backgrounds without Cairo
Po Lu [Mon, 24 Jan 2022 04:44:55 +0000 (12:44 +0800)]
Add some code for transparent frame backgrounds without Cairo

* src/image.c (svg_load_image): Fix build without native image
transforms.

* src/xfns.c (set_up_x_back_buffer):
(tear_down_x_back_buffer): Free XR picture if present.

* src/xftfont.c (xftfont_get_xft_draw): Fix formatting issue.

* 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'.

2 years agoGet rid of compose status on XI2
Po Lu [Mon, 24 Jan 2022 02:21:24 +0000 (10:21 +0800)]
Get rid of compose status on XI2

* src/xterm.c (handle_one_xevent): Stop assuming compose
processing will occur on XI2.

2 years agoExpunge read-with-symbol-position and read-symbol-positions-list
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.

2 years agoSet IC preedit area on ConfigureNotify
Po Lu [Mon, 24 Jan 2022 00:46:39 +0000 (08:46 +0800)]
Set IC preedit area on ConfigureNotify

* src/xterm.c (handle_one_xevent): Set the preedit spot when a
ConfigureNotify event is received.

2 years agoBind print-symbols-bare to t in byte-compile-from-buffer
Alan Mackenzie [Sun, 23 Jan 2022 16:41:23 +0000 (16:41 +0000)]
Bind print-symbols-bare to t in byte-compile-from-buffer

* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Bind
print-symbols-bare to t here for the benefit of non-defining forms in buffers.

2 years agoMake message in hack-local-variables-confirm clearer
Lars Ingebrigtsen [Sun, 23 Jan 2022 16:09:55 +0000 (17:09 +0100)]
Make message in hack-local-variables-confirm clearer

* lisp/files.el (hack-local-variables-confirm): Mention the
.dir-locals.el file in the message to be slightly less confusing
(bug#27066).

2 years agoMake `C-x M-x insert-kbd-macro RET RET' work better
Lars Ingebrigtsen [Sun, 23 Jan 2022 15:48:42 +0000 (16:48 +0100)]
Make `C-x M-x insert-kbd-macro RET RET' work better

* lisp/macros.el (insert-kbd-macro): Don't give bogus output on
names that have no function definition (bug#30309).

2 years agoFix tabulated-list-widen-current-column widening wrong column
Thuna [Sun, 23 Jan 2022 14:55:48 +0000 (15:55 +0100)]
Fix tabulated-list-widen-current-column widening wrong column

* tabulated-list.el (tabulated-list-widen-current-column): Use correct
comparison operation when checking if point is within the column
bounds  (bug#53375).

Copyright-paperwork-exempt: yes

2 years agoAllow using outline minor mode in `M-x apropos-value'
Lars Ingebrigtsen [Sun, 23 Jan 2022 14:43:19 +0000 (15:43 +0100)]
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.

2 years agoMake apropos-print-doc more resilient
Lars Ingebrigtsen [Sun, 23 Jan 2022 14:08:34 +0000 (15:08 +0100)]
Make apropos-print-doc more resilient

* lisp/apropos.el (apropos-print-doc): Don't bug out on doc
strings that have invalid command key syntaxes.

2 years agoFix position argument to macroexp--warn-wrap in cconv--convert-funcbody
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.

2 years agoImprove `M-x speedbar' under emacs -nw very slightly
Lars Ingebrigtsen [Sun, 23 Jan 2022 13:46:55 +0000 (14:46 +0100)]
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).

2 years agoRegenerate ldefs-boot.el
Lars Ingebrigtsen [Sun, 23 Jan 2022 13:37:25 +0000 (14:37 +0100)]
Regenerate ldefs-boot.el

2 years agoMake kill-process into a command
Lars Ingebrigtsen [Sun, 23 Jan 2022 13:36:54 +0000 (14:36 +0100)]
Make kill-process into a command

* doc/lispref/processes.texi (Signals to Processes): Document it.
* src/process.c (Fkill_process): Make into a command (bug#32640).

2 years agoAdd new function to prompt a user for a process name
Phil Sainty [Sun, 23 Jan 2022 13:35:52 +0000 (14:35 +0100)]
Add new function to prompt a user for a process name

* lisp/emacs-lisp/subr-x.el (read-process-name): New function
(bug#32640).

2 years agoMake sure cursors are drawn correctly after haiku_clear_frame
Po Lu [Sun, 23 Jan 2022 13:34:03 +0000 (13:34 +0000)]
Make sure cursors are drawn correctly after haiku_clear_frame

* src/haikuterm.c (haiku_clear_frame): Mark all cursors as off.

2 years agoImprove scheme-imenu-generic-expression
Alex Kost [Sun, 23 Jan 2022 13:12:34 +0000 (14:12 +0100)]
Improve scheme-imenu-generic-expression

* lisp/progmodes/scheme.el (scheme-imenu-generic-expression):
Improve so that we match `define-public' etc (bug#33117).

2 years agoMake occur edit mode more resilient
Lars Ingebrigtsen [Sun, 23 Jan 2022 12:54:16 +0000 (13:54 +0100)]
Make occur edit mode more resilient

* lisp/replace.el (occur-engine): Make the prefix read-only so
that it's preserved in edit mode (bug#53419).