Commit graph

160480 commits

Author SHA1 Message Date
Vibhav Pant
1b48e8dde5
src/comp.c: Use constructor expressions when possible.
* src/comp.c:
  - Add declarations for creating constructor/initializer expressions
  when supported.
  - (emit_coerce): Use a struct constructor expression to create a
  Lisp_Object value instead of creating a new local variable.
  - emit_limple_call_ref: Emit a single constructor expression for
  initializing tmp_arr.
2022-10-14 17:27:12 +05:30
Po Lu
271791b55b Fix bug#56153
* src/nsterm.m (get_keysym_name)
(ns_draw_glyphless_glyph_string_foreground): Fix new Mac OS
deprecations.

([EmacsApp terminate:]): Use kbd_buffer_store_event instead
of emacs_event.  (bug#56153)
([EmacsView windowDidChangeBackingProperties:]): Fix new Mac
OS deprecation.
2022-10-14 19:04:44 +08:00
Po Lu
6ea69fc734 Avoid redundant creation of XRender pictures
* src/xterm.c (x_composite_image): Take arg DESTINATION.  Do not
create a picture if it is set.
(x_draw_image_foreground, x_draw_image_foreground_1): Pass
destination where appropriate.
2022-10-14 15:56:15 +08:00
Eli Zaretskii
9074103fbf ; Fix recent change in documentation of "device number"
* src/dired.c (Ffile_attributes):
* lisp/files.el (buffer-file-number, file-attribute-file-number):
Fix wording of the doc strings.

* etc/NEWS:
* doc/lispref/buffers.texi (Buffer File Name):
* doc/lispref/files.texi (File Attributes): Fix a typo and
wording.  (Bug#58446)
2022-10-14 10:12:03 +03:00
Stefan Kangas
6cab30620f Merge from origin/emacs-28
85e47d9a9e ; Continued cleanup of "-hooks"
2022-10-14 06:31:49 +02:00
Michael Albinus
cbd04ad3d5 Clarify structure of file-attribute's device number
* doc/lispref/buffers.texi (Buffer File Name): Fix description of
buffer-file-number.

* doc/lispref/files.texi (File Attributes): Clarify type of device
number.  Describe file-attribute-file-number.  (Bug#58446)

* etc/NEWS: Mention file-attribute-file-number.

* lisp/files.el (buffer-file-number, file-attribute-device-number)
(file-attribute-collect): Fix docstring.
(file-attribute-file-number): New defsubst.
(find-buffer-visiting, find-file-noselect)
(set-visited-file-name, basic-save-buffer):
* lisp/startup.el (normal-top-level-add-subdirs-to-load-path):
* lisp/eshell/em-unix.el (eshell-shuffle-files): Use it.

* src/dired.c (Ffile_attributes): Fix docstring.
2022-10-13 21:13:45 +02:00
Bill Wohler
85e47d9a9e ; Continued cleanup of "-hooks"
* doc/misc/mh-e.texi: Replace mh-kill-folder-suppress-prompt-hook with
mh-kill-folder-suppress-prompt-functions.
2022-10-13 09:52:25 -07:00
Paul Eggert
10f55975d3 Improve checks for recent "File exists" fixup
* src/fileio.c (Finsert_file_contents): Add an assertion (bug#42431).
2022-10-13 09:34:13 -07:00
Stefan Kangas
6efc643952 Make `info' treat "\n" in node names as "\s"
* lisp/info.el (info): Treat "\n" in node name as "\s".  (Bug#57936)
2022-10-13 15:51:58 +02:00
Po Lu
e6c701c8c3 Shrink client list window structure
* src/xterm.c (struct x_client_list_window): Rearrange members
for better alignment.
2022-10-13 18:48:56 +08:00
Paul Eggert
97de273dca Simplify recent "File exists" fix
* src/fileio.c (Finsert_file_contents):
Simplify previous change that fixed bug#42431.
2022-10-13 01:48:29 -07:00
Lars Ingebrigtsen
12f261c470 Fix hl-line-mode/global-hl-line-mode logic again
* lisp/hl-line.el (hl-line-mode): Make explicit calls to
(hl-line-mode 1) work again when global-hl-line-mode is on
(bug#58478).
2022-10-13 10:08:55 +02:00
Lars Ingebrigtsen
4af4df18c5 Fix browse-url-emacs for file: URLs on Windows
* lisp/net/browse-url.el (browse-url-emacs): Fix up
file:///c:/foo/bar URLs on windows (bug#58464).
2022-10-13 09:52:51 +02:00
Juri Linkov
7054481ed5 * lisp/outline.el: Rearrange button/margin functions.
(outline--make-button-overlay, outline--make-margin-overlay)
(outline--insert-open-button, outline--insert-close-button)
(outline--fix-up-all-buttons): Move to the section "Button/margin indicators".
2022-10-13 10:23:44 +03:00
Juri Linkov
3d41cc03d9 * lisp/outline.el (outline--fix-buttons-after-change): New function.
(outline-minor-mode): Use it.
(outline--make-margin-overlay): Remove inhibit-read-only.
2022-10-13 10:13:07 +03:00
Lars Ingebrigtsen
c522021a30 Fix misleading "File exists, but cannot be read" in browse-url-emacs
* src/fileio.c (Finsert_file_contents): Don't signal an error
about not being able to open the file when we're fetching things
via handlers -- in that case, modtime isn't necessarily set, and
if there's a handler, it should take care of this (bug#42431).
2022-10-13 09:00:17 +02:00
Stefan Kangas
2b7fefdef1 Merge from origin/emacs-28
4b4b093ab3 ; * admin/make-tarball.txt: Fix typo.
2022-10-13 06:31:52 +02:00
Stefan Kangas
4b4b093ab3 ; * admin/make-tarball.txt: Fix typo. 2022-10-13 04:46:32 +02:00
Stefan Monnier
da752c0466 src/frame.c (do_switch_frame): Fix bug#58343
* src/frame.c (do_switch_frame): Move call to `get-mru-window` outside
of the "critical region" where (selected-window) != (frame-selected-window).
* src/minibuf.c (move_minibuffers_onto_frame): Add arg `frame`.
Use it instead of `selected_frame`.  Adjust all callers.
* src/lisp.h (move_minibuffers_onto_frame): Adjust declaration.
2022-10-12 17:06:33 -04:00
Lars Ingebrigtsen
5a94a2e5b0 Clarify Native-Compilation Variables slightly
* doc/lispref/compile.texi (Native-Compilation Variables): Clarify
trampoline bit (bug#58429).
2022-10-12 15:00:08 +02:00
Po Lu
1e961eda72 Improve makefile-imake-mode
* lisp/progmodes/make-mode.el
(makefile-imake-font-lock-keywords): Give Imake priority over
CPP keywords, and don't require comments to start at BOL.
(makefile-imake-mode): Set comment-start to some sensible value.
2022-10-12 20:40:24 +08:00
Lars Ingebrigtsen
820e6f399d Fix thinko in read-string-from-buffer
* lisp/textmodes/string-edit.el (string-edit-done): Return an empty
string when the user has entered no text.
2022-10-12 13:40:51 +02:00
kobarity
aa559c1553 Fix Python completion when point in shell buffer is before prompt
* lisp/progmodes/python.el (python-shell-completion-at-point): Limit
prompt boundaries check to shell buffer.
* test/lisp/progmodes/python-tests.el (python-shell-completion-2):
(python-shell-completion-native-2): New tests (bug#58441).
2022-10-12 13:14:33 +02:00
Po Lu
2953d89d74 Stop relying on Xt hack to set window manager hints
* src/widget.c (get_wm_shell): Return WMShellWidget.
(update_wm_hints, widget_update_wm_size_hints): Return whether
or not size hints changed.
* src/widget.h: Delete `size_switch'.
* src/widgetprv.h (EmacsFramePart): Likewise.
* src/xterm.c (x_wm_set_size_hint): Set size hints the usual way
if Xt did not set them.  (bug#58412)
2022-10-12 15:08:01 +08:00
Stefan Kangas
c22e85715e Merge from origin/emacs-28
3787d0b11a ; * doc/lispref/windows.texi (Window Hooks): Fix markup (b...
2022-10-12 06:31:27 +02:00
Dmitry Gutov
ef6e518035 ; lisp/progmodes/project.el: Bump version 2022-10-12 00:04:54 +03:00
Andrea Corallo
3744720904 Add trampoline AOT compilation target (bug#58318)
* Makefile.in (trampolines): New target.
* lisp/Makefile.in (trampolines): Likewise.
* lisp/emacs-lisp/comp.el (comp-compile-all-trampolines): New
function.
2022-10-11 21:19:21 +02:00
Eli Zaretskii
3787d0b11a ; * doc/lispref/windows.texi (Window Hooks): Fix markup (bug#58445). 2022-10-11 20:20:44 +03:00
Po Lu
61b6da5ace Also avoid setting _NET_WM_USER_TIME on crossing
* src/xterm.c (handle_one_xevent): Stop setting user time prop
on crossing events.
2022-10-11 19:56:05 +08:00
Mattias Engdegård
48df8bbb1f ; * src/fns.c (HAVE_FAST_UNALIGNED_ACCESS): run faster on mainframes 2022-10-11 13:44:23 +02:00
Lars Ingebrigtsen
5724ee6131 Make read-string-from-buffer and string-edit mention each other
* lisp/textmodes/string-edit.el (read-string-from-buffer)
(string-edit): Mention each other in the doc strings.
2022-10-11 13:02:27 +02:00
Eli Zaretskii
4f114c0d95 Speed up scrolling when lines are very long and truncated
* src/window.c (window_scroll_for_long_lines): New function.
(window_scroll): Call 'window_scroll_for_long_lines' when lines
are very long and truncated on display.  Also, disable
'fontification-functions' during scrolling in that case.
* src/xdisp.c (redisplay_window): When recentering the window's
display, go back to the centering position using a simplified
method, if lines in the buffer are very long and truncated on
display.
2022-10-11 13:26:01 +03:00
Po Lu
163000fb59 Remove some more unnecessary calls to block_input
* src/xterm.c (x_update_opaque_region, show_back_buffer)
(XTbuffer_flipping_unblocked_hook, x_clear_under_internal_border)
(x_after_update_window_line): Remove and add calls to
block_input as required.
2022-10-11 15:46:10 +08:00
F. Jason Park
4a1a4bf0e2 Accommodate missing spec values in erc-format-message
* lisp/erc/erc.el (erc-format-message): Although not mentioned in its
log message, commit 5281946fbf "Make
format-spec accept function substitutions" also fixed a bug involving
the `ignore-missing' parameter of `format-spec'.  Until now, ERC has
been relying on the old behavior to gracefully handle malformed server
messages.  This commit tries to regain that functionality.
2022-10-10 18:48:01 -07:00
Philipp Stephani
92703e00dc Add gettid to seccomp-filter
* lib-src/seccomp-filter.c (main): gettid is necessary on RHEL 9.0
(bug#56359).
2022-10-11 02:52:51 +02:00
Lars Ingebrigtsen
cf9ac85785 Remove the view-remove-frame-by-deleting variable
* lisp/view.el (view-remove-frame-by-deleting): Remove variable
that hasn't been used since 2011 -- 357f93d245 reworked the
code and stopped using it (bug#58413).
2022-10-11 02:39:05 +02:00
kobarity
b0585441a3 Fix Python completion failure under certain conditions
* lisp/progmodes/python.el (python-shell-send-string-no-output):
Save and restore `comint-last-prompt-overlay' or `comint-last-prompt'.
* test/lisp/progmodes/python-tests.el (python-tests-shell-wait-for-prompt):
New helper function.
(python-tests-with-temp-buffer-with-shell): New helper macro.
(python-shell-completion-1, python-shell-completion-native-1)
(python-shell-completion-native-with-ffap-1)
(python-shell-completion-native-with-eldoc-1): New tests (bug#58389).
2022-10-11 02:29:42 +02:00
Lars Ingebrigtsen
36ab164496 Improve error message from sqlite-execute
* src/sqlite.c (sqlite_prepare_errmsg): New function.
(Fsqlite_execute): Use it to get the same error format for both
execute and select.
(Fsqlite_select): Factored out from here.
2022-10-11 02:18:19 +02:00
Jim Porter
ebc19f56aa Don't prompt when killing an Emacs client if it's the last client
* lisp/server.el (server-kill-emacs-query-function): Ignore the
current client (if any) when checking for live clients (bug#58404).
2022-10-10 15:09:21 -07:00
Michael Albinus
5df95ba039 Fix Tramp completion on MS Windows
* lisp/net/tramp.el (tramp-build-remote-file-name-spec-regexp):
Revert previous change, it's too complicate.
(tramp-build-completion-file-name-regexp):
Use `tramp-prefix-format' instead of `tramp-prefix-regexp'.  (Bug#558133)
2022-10-10 21:46:24 +02:00
Paul Eggert
345de32a5d Port bwrap/allows-stdout test to Ubuntu 22.04.1
Without this patch, Ubuntu 22.04.1 x86-64 "make check" reports a
failure in test/src/emacs-tests.el’s
emacs-tests/bwrap/allows-stdout.  One can reproduce the bug
without using the Emacs executable, by running this script:

  #!/bin/bash
  export LC_ALL=C
  exec strace -f -o /tmp/tr bwrap --ro-bind / / --seccomp 20 -- \
    cat /dev/null 20< lib-src/seccomp-filter-exec.bpf

This script exits with status 159, because "cat" didn’t get
started (it got a SIGSYS signal early on).

The command "journalctl -g SECCOMP" indicated that rseq (syscall
334) was the problem.  This syscall is issued by
/lib64/ld-linux-x86-64.so.2 before ‘main’ is called.

There’s another problem with the clone3 syscall, which is used by
pthread_create starting in glibc 2.34.  pthread_create is called
by g_child_watch_source_new, which is called by
init_process_emacs.

* lib-src/seccomp-filter.c (main): Allow rseq, clone3.  This
causes the test to pass.  Perhaps a fancier, more accurate patch
could be written by someone who has the time.
2022-10-10 12:36:38 -07:00
Lars Ingebrigtsen
8851a75ca7 Add a test for sqlite "insert ... returning"
* test/src/sqlite-tests.el (sqlite-returning): Add a test for
"insert ... returning".
2022-10-10 14:10:04 +02:00
Robert Pluim
e25bdd7946 Fix `vc-prepare-patch' docstring
* lisp/vc/vc.el (vc-prepare-patch): Correct description of
`vc-prepare-patches-separately'.
2022-10-10 12:45:45 +02:00
Eli Zaretskii
b7802190fe ; Update the doc string of 'compilation-auto-jump-to-first-error'
* lisp/progmodes/compile.el
(compilation-auto-jump-to-first-error): Doc fix.  (Bug#58407)
2022-10-10 12:37:04 +03:00
Eli Zaretskii
ed436db132 ; * doc/lispref/text.texi (Database): Fix markup in last change. 2022-10-10 12:14:33 +03:00
Lars Ingebrigtsen
7e7dc74ffb Support "insert into ... returning ..." in sqlite-execute
* doc/lispref/text.texi (Database): Mention it.
* src/sqlite.c (Fsqlite_execute): Support syntax like "insert into
... returning ..." (bug#58390).
2022-10-10 10:58:33 +02:00
Lars Ingebrigtsen
7ab6ec364d Fix some indentation in Fsqlite_execute
* src/sqlite.c (Fsqlite_execute): Fix indentation.
2022-10-10 10:35:46 +02:00
Eli Zaretskii
28904d78a5 ; Fix last change. 2022-10-10 11:09:43 +03:00
Eli Zaretskii
e016e60a04 ; Clarify correct use of 'xref-query-replace-in-results'
* lisp/progmodes/xref.el (xref--query-replace-1): Improve the
user-error message.
(xref-query-replace-in-results): Clarify restrictions in the doc
string.

* doc/emacs/maintaining.texi (Xref Commands, Identifier Search):
Clarify the correct usage of 'xref-query-replace-in-results'.
2022-10-10 11:05:18 +03:00
Eli Zaretskii
f91ae94790 ; * lisp/progmodes/gdb-mi.el (gdb): Fix a typo. (Bug#58400) 2022-10-10 09:42:19 +03:00