1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 07:11:34 -08:00
Commit graph

153917 commits

Author SHA1 Message Date
Yuuki Harano
d0b9e269ee * configure.ac: Remove forgotten GLIB_GSETTINGS call 2022-01-24 21:26:17 +09:00
Lars Ingebrigtsen
933ed56e55 Add NEWS item for `I' command 2022-01-24 13:02:00 +01:00
Lars Ingebrigtsen
031c2e4679 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.
2022-01-24 12:59:55 +01:00
Lars Ingebrigtsen
487a0be7f7 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.
2022-01-24 12:39:02 +01:00
Lars Ingebrigtsen
77b72f77b3 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).
2022-01-24 11:56:35 +01:00
Po Lu
806a121007 Remove redundant declarations from keyboard.h that are now in lisp.h
* src/keyboard.h (process_pending_signals)
(pending_signals): Remove declarations.
2022-01-24 18:49:54 +08:00
Mattias Engdegård
a8b713d83a 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.
2022-01-24 11:41:47 +01:00
Mattias Engdegård
b7902a9b48 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.
2022-01-24 11:41:47 +01:00
Mattias Engdegård
4a0541a5dd 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.
2022-01-24 11:41:47 +01:00
Mattias Engdegård
75c6564c92 ; * 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.
2022-01-24 11:41:47 +01:00
Mattias Engdegård
11e1abd5cc 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.
2022-01-24 11:41:47 +01:00
Mattias Engdegård
721357b868 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.
2022-01-24 11:41:46 +01:00
Mattias Engdegård
4ff1fb8eb4 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.
2022-01-24 11:41:46 +01:00
Mattias Engdegård
b3377e67a7 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.
2022-01-24 11:41:46 +01:00
Mattias Engdegård
d05f387407 ; * src/bytecode.c (exec_byte_code): Cosmetic improvement
Implement point_max in the same way as point_min.
2022-01-24 11:41:46 +01:00
Mattias Engdegård
7392f2dc41 Byte code arity check micro-optimisation
* src/bytecode.c (exec_byte_code): Slight simplification.
2022-01-24 11:41:46 +01:00
Mattias Engdegård
65caf5b205 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.
2022-01-24 11:41:46 +01:00
Mattias Engdegård
ce1de3a8d9 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.
2022-01-24 11:41:46 +01:00
Mattias Engdegård
6c000af611 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.
2022-01-24 11:41:46 +01:00
Mattias Engdegård
15961108c9 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.
2022-01-24 11:41:46 +01:00
Lars Ingebrigtsen
bcf844b5fc Add "then" to sh--completion-keywords
* lisp/progmodes/sh-script.el (sh--completion-keywords): Allow
completing over "then" (bug#53490).
2022-01-24 11:16:30 +01:00
Lars Ingebrigtsen
842ea1e22f Fix Gnus registry key bindings
* lisp/gnus/gnus-registry.el (gnus-registry-install-shortcuts):
Don't overwrite all other M M commands (bug#53492).
2022-01-24 11:09:40 +01:00
Martin Rudalics
2dec6f59ec ; * src/xfns.c (xic_preedit_draw_callback): Init text_length to quieten gcc. 2022-01-24 10:43:56 +01:00
Martin Rudalics
1575afe8df 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).
2022-01-24 10:33:15 +01:00
Po Lu
dee029e19f * src/xterm.c (x_composite_image): Use the display's picture format. 2022-01-24 16:22:54 +08:00
Po Lu
e606434be6 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.
2022-01-24 15:37:24 +08:00
Paul Eggert
8d6fbc4b48 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).
2022-01-23 23:23:31 -08:00
Po Lu
eac4b924cb * src/xterm.c (handle_one_xevent): Drop frame picture on configure. 2022-01-24 12:54:26 +08:00
Po Lu
45208755d1 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'.
2022-01-24 12:44:55 +08:00
Po Lu
3a7b158ffd Get rid of compose status on XI2
* src/xterm.c (handle_one_xevent): Stop assuming compose
processing will occur on XI2.
2022-01-24 10:22:19 +08:00
Alan Mackenzie
dfae76c991 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.
2022-01-24 01:08:03 +00:00
Po Lu
6cea4d1fdb Set IC preedit area on ConfigureNotify
* src/xterm.c (handle_one_xevent): Set the preedit spot when a
ConfigureNotify event is received.
2022-01-24 08:46:39 +08:00
Alan Mackenzie
f4af1137e6 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.
2022-01-23 16:41:23 +00:00
Lars Ingebrigtsen
21a3bd9f36 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).
2022-01-23 17:09:55 +01:00
Lars Ingebrigtsen
a82c3557fc 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).
2022-01-23 16:48:42 +01:00
Thuna
80098a2830 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
2022-01-23 15:55:48 +01:00
Lars Ingebrigtsen
d0f3de72b6 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.
2022-01-23 15:43:19 +01:00
Lars Ingebrigtsen
a37da91a09 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.
2022-01-23 15:08:34 +01:00
Alan Mackenzie
3b0d848b54 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.
2022-01-23 13:49:27 +00:00
Lars Ingebrigtsen
9f5048456a 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).
2022-01-23 14:46:55 +01:00
Lars Ingebrigtsen
db454c98f1 Regenerate ldefs-boot.el 2022-01-23 14:37:32 +01:00
Lars Ingebrigtsen
838ad7037b 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).
2022-01-23 14:37:32 +01:00
Phil Sainty
1c1d5eee4c Add new function to prompt a user for a process name
* lisp/emacs-lisp/subr-x.el (read-process-name): New function
(bug#32640).
2022-01-23 14:37:32 +01:00
Po Lu
80b66d80ef Make sure cursors are drawn correctly after haiku_clear_frame
* src/haikuterm.c (haiku_clear_frame): Mark all cursors as off.
2022-01-23 13:34:03 +00:00
Alex Kost
0e833a1d5f Improve scheme-imenu-generic-expression
* lisp/progmodes/scheme.el (scheme-imenu-generic-expression):
Improve so that we match `define-public' etc (bug#33117).
2022-01-23 14:12:34 +01:00
Lars Ingebrigtsen
1bcbca3750 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).
2022-01-23 13:54:16 +01:00
Lars Ingebrigtsen
ab73a87858 Revert the other bits related to `load-read-file'
* src/lread.c (syms_of_lread): Revert the other bits related to
reverting `byte-compile-from-buffer'/`load-read-file'.
2022-01-23 13:43:53 +01:00
Po Lu
32e1894943 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.
2022-01-23 19:34:39 +08:00
Stefan Kangas
1319d108da Merge from origin/emacs-28
6d3608be88 Seccomp: improve support for newer versions of glibc (Bug#...
e58ecd01d5 EUDC: Fix a quoting bug in the BBDB backend
2022-01-23 06:30:31 +01:00
Po Lu
5d257a99b7 Fix documentation formatting error
* doc/lispref/streams.texi (Input Functions): Remove extraneous
@end defun.
2022-01-23 01:25:55 +00:00