kobarity [Sun, 16 Oct 2022 09:26:29 +0000 (11:26 +0200)]
Fix invalid search bound error in python-shell-completion-at-point
* lisp/progmodes/python.el (python-shell-completion-at-point): Add
check if point is before line-start.
* test/lisp/progmodes/python-tests.el (python-shell-completion-shell-buffer-1)
(python-shell-completion-shell-buffer-native-1): New tests
(bug#58548).
kobarity [Sun, 16 Oct 2022 09:15:22 +0000 (11:15 +0200)]
Disable completion when PDB is active in Python Shell buffer
* lisp/progmodes/python.el (python-shell-completion-at-point): Disable
completion in Python buffer when PDB is active in Python Shell buffer.
* test/lisp/progmodes/python-tests.el (python-shell-completion-pdb-1):
New test (bug#58562).
Stefan Kangas [Sun, 16 Oct 2022 06:27:16 +0000 (08:27 +0200)]
Merge from origin/emacs-28
067361f3a2 ; Improve documentation of 'C-M-i' fdb6f7cf26 ; Fix documentation of 'comp-enable-subr-trampolines' be30369e01 ; Avoid incorrect indentation in an @example. 4bd3dd505e Document how to control where the *.eln files are written b7d7c2d9e9 Add cross-reference to alternative syntaxes for Unicode
Po Lu [Sun, 16 Oct 2022 06:02:31 +0000 (14:02 +0800)]
Fix multiple sources of flicker under X
Fix three kinds of flicker. The first is if you do:
(while t (sit-for 1) (redraw-display))
and press a key, the frame will turn blank until you C-g. The
second is where handling async input happens in the middle of
drawing and causes a buffer flip to happen. The third is where
unmapping the hourglass window causes exposures.
* src/dispnew.c (redraw_frame): Garbage the frame if it is a
window system frame.
* src/xterm.c (x_update_begin): Clear complete flag.
(x_flip_and_flush, XTframe_up_to_date): Set complete flag.
(x_show_hourglass): Fix hourglass window class.
(flush_dirty_back_buffer_on): Rename to
x_flush_dirty_back_buffer_on.
(x_flush_dirty_back_buffer_on): Check if the frame is complete
before trying to flip.
(handle_one_xevent): Flush frames in a more detailed fashion.
* src/xterm.h (struct x_output): New flag `complete'.
(FRAME_X_COMPLETE_P): New macro.
Handle ;;;###theme-autoload comments in etc/themes
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch):
Extract the autoloads and have them loaded along with loaddefs.el.
* etc/NEWS: Mention the new feature. (Bug#57639)
Stefan Kangas [Sat, 15 Oct 2022 08:52:13 +0000 (10:52 +0200)]
Delete broken link to Network Theory Ltd.
Sadly, their website has been down for several months already.
I was unable to find a new link, but it seems like they haven't
published anything new for over a decade.
* doc/misc/org.org (Summary): Remove broken link to Network Theory Ltd.
Po Lu [Sat, 15 Oct 2022 08:25:22 +0000 (16:25 +0800)]
Remove redundant call to expensive function XOpenDisplay
* src/xterm.c (x_term_init): Speed up opening Emacs over a slow
network connection by an order of magnitude on no toolkit builds
by avoiding a redundant call to XOpenDisplay.
* test/manual/image-circular-tests.el
(image-test-duplicate-keywords): Skip unless images are supported.
(image-test-circular-plist, image-test-:type-property-value): Ditto.
Wrap only failing forms in should[-error] rather than entire test
bodies. Use simpler printed notation in place of function calls.
(image-test-circular-specs): Ditto. Wrap overly wide docstring.
Mark as failing since shortly after its introduction (bug#36403#63).
Eli Zaretskii [Fri, 14 Oct 2022 18:57:18 +0000 (21:57 +0300)]
Document how to control where the *.eln files are written
* doc/lispref/compile.texi (Native Compilation): Document the
trick of pointing $HOME to a non-existent directory.
(Native-Compilation Variables): Document the role of
'native-comp-eln-load-path' in determining where *.eln files are
written.
Alan Mackenzie [Fri, 14 Oct 2022 17:40:26 +0000 (17:40 +0000)]
Correctly fontify C++'s operator"" _tag (...)
Give both the "" and _tag font-lock-function-name-face. Also correct the
fontification of an inherited class name when there is an attribute between
the class name being declared and the colon introducing the inheritance.
* lisp/progmodes/cc-engine.el (c-forward-over-colon-type-list): New function.
(c-forward-keyword-clause): Use the above new function instead of a
looking-at.
(c-forward-name, c-forward-declarator): Accept both the "" and the tag as part
of the name.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Fontify the "" (which
already has font-lock-string-face) and the tag with
font-lock-function-name-face.
* lisp/progmodes/cc-langs.el (c-overloadable-operators): Add "" to this list.
(c-sub-colon-type-list-re): New lang-const and lang-var.
* lisp/files-x.el (modify-dir-local-variable): Add a 'no-byte-compile'
file local variable when generating a .dir-locals.el
file.
* .dir-locals.el: Add 'no-byte-compile'. (Bug#58486)
Po Lu [Fri, 14 Oct 2022 11:04:44 +0000 (19:04 +0800)]
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.
Po Lu [Fri, 14 Oct 2022 07:52:16 +0000 (15:52 +0800)]
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.
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).
Stefan Monnier [Wed, 12 Oct 2022 21:06:33 +0000 (17:06 -0400)]
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.
Po Lu [Wed, 12 Oct 2022 12:40:03 +0000 (20:40 +0800)]
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.
Po Lu [Wed, 12 Oct 2022 07:07:49 +0000 (15:07 +0800)]
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)
Eli Zaretskii [Tue, 11 Oct 2022 10:26:01 +0000 (13:26 +0300)]
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.
Po Lu [Tue, 11 Oct 2022 07:45:08 +0000 (15:45 +0800)]
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.
F. Jason Park [Sat, 8 Oct 2022 04:55:30 +0000 (21:55 -0700)]
Accommodate missing spec values in erc-format-message
* lisp/erc/erc.el (erc-format-message): Although not mentioned in its
log message, commit 5281946fbf6b3cdbec5ce82e0057c71849faf4d2 "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.
* lisp/view.el (view-remove-frame-by-deleting): Remove variable
that hasn't been used since 2011 -- 357f93d245344 reworked the
code and stopped using it (bug#58413).
kobarity [Mon, 10 Oct 2022 13:24:17 +0000 (22:24 +0900)]
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).
* 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.
Paul Eggert [Mon, 10 Oct 2022 19:35:56 +0000 (12:35 -0700)]
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:
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.