Po Lu [Sat, 27 Apr 2024 11:48:45 +0000 (19:48 +0800)]
Fix ommissions in window scrolling commands that ought to clear vscroll
* src/window.c (Fdelete_other_windows_internal)
(window_scroll_for_long_lines, Frecenter, Fmove_to_window_line):
Reset window vscroll, or, if force_start be set, just
preserve_vscroll_p, after moving window start to a position
computed from iterators for the window in question, so that
vscroll may be reliably reset again after the conditions for
redisplay's doing the same were corrected. (bug#70386)
Add support for colored and styled underlines on tty frames
* src/dispextern.h (face, face_underline_type, syms_of_xfacse)
(internal-set-lisp-face-attribute)
(gui_supports_face_attributes_p): Add definitions for new
underline styles of Double-line, Dots and Dashes. Rename
FACE_UNDER_LINE and FACE_UNDER_WAVE to make definitions
consistent. Delete tty_underline_p from the face struct and use
just underline going forward. Add a flag to check whether styled
underlines are available.
* lisp/cus-face.el (custom-face-attributes): Add entries for
Double-line, Dots and Dashes so they can be set through
`customize'.
* src/termchar.c (tty_display_info): Add an entry for the escape
sequence to set the underline style and color on terminal frames.
* src/term.c (init_tty, tty_capable_p, turn_on_face): Read and
save the underline style escape sequence from the Smulx termcap
(alternatively if the Su flag is set use a default sequence).
Allow checking for support of styled underlines in the current
terminal frame. Output the necessary escape sequences to activate
a styled underline on turn_on_face; this is currently only used
for the new special underline styles, a default straight underline
will still use the "us" termcap. Output escape sequence to set
underline color when set in the face and supported by the tty.
Save a default value for this sequence on init_tty when styled
underlines are supported.
* src/xfaces.c (tty_supports_face_attributes_p, realize_tty_face)
(map_tty_color): Assert whether styled underlines are supported by
the current terminal on display-supports-face-attributes-p checks.
Populate the correct underline style and color in the face spec
when realizing a face. Allow map_tty_color to map underline
colors alongside foreground and background. The interface of
map_tty_color was amended to allow the caller to supply the
underline color instead of accessing it through the face
attributes. (bug#62994)
* src/xterm.c (x_draw_glyph_string): Updated to use renamed
FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type
enumerations.
Po Lu [Sat, 27 Apr 2024 02:47:12 +0000 (10:47 +0800)]
Enable customization of the quit key on Android
* doc/emacs/android.texi (Android Windowing):
* doc/emacs/input.texi (On-Screen Keyboards): Document various
tidbits related to the quit key.
* java/org/gnu/emacs/EmacsNative.java (getQuitKeycode): New
function.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): Rename
`lastVolumeButtonRelease' to `lastQuitKeyRelease'.
(onKeyUp): Treat value returned by getQuitKeycode as the quit
key rather than mandate KEYCODE_VOLUME_DOWN.
* src/android.c (getQuitKeycode): Implement new function.
* src/androidterm.c (syms_of_androidterm)
<android_quit_keycode>: New variable.
* lisp/emacs-lisp/package-vc.el (vc-dir-prepare-status-buffer):
Add a declaration.
(package-vc-upgrade): Prepare a dummy vc-dir buffer to ensure
that 'vc-pull' (or rather 'vc-deduce-fileset') can correctly
infer the VC backend to use. (bug#70526)
Eli Zaretskii [Thu, 25 Apr 2024 15:59:25 +0000 (18:59 +0300)]
Fix last change
* test/lisp/progmodes/csharp-mode-tests.el
(csharp-ts-mode-test-indentation): Move the test to here.
* test/lisp/progmodes/csharp-ts-mode-tests.el: Remove file.
* test/lisp/progmodes/csharp-ts-mode-resources/indent.erts: Move
to test/lisp/progmodes/csharp-mode-resources/indent-ts.erts.
Eli Zaretskii [Tue, 23 Apr 2024 07:40:50 +0000 (10:40 +0300)]
Improve documentation of selection and navigation in *xref* buffers
* doc/emacs/maintaining.texi (Looking Up Identifiers): More
detailed description of 'xref-auto-jump-to-first-definition'.
Improve indexing. Describe the use of 'next-error' and
'previous-error' in conjunction with the *xref* buffer.
(Identifier Search): More detailed description of
'xref-auto-jump-to-first-xref'. Describe the use of 'next-error'
and 'previous-error'.
Stephen Berman [Mon, 22 Apr 2024 09:32:10 +0000 (11:32 +0200)]
Fix Widget manual typos, markup and omissions (bug#70502)
* doc/misc/widget.texi (Widgets and the Buffer): Correct typos and
texinfo markup, add equivalent key bindings and make minor changes
in wording.
(Customization): Correct names of two faces and add documentation
of remaining widget faces.
Fix python-ts-mode built-in functions and attributes (bug#70478)
* lisp/progmodes/python.el (python--treesit-settings): Change the
treesitter query to fetch the correct type of node for built-in
functions and attributes and highlight them with corresponding
font-lock face.
Eli Zaretskii [Sun, 21 Apr 2024 16:49:14 +0000 (19:49 +0300)]
Fix markup and indexing in the Calendar chapter of user manual
* doc/emacs/calendar.texi (Calendar Unit Motion)
(Scroll Calendar, Writing Calendar Files, Holidays)
(Sunrise/Sunset, Lunar Phases, Calendar Systems)
(To Other Calendar, Displaying the Diary, Date Formats)
(Adding to Diary, Special Diary Entries): Fix markup, style, and
indexing.
Eli Zaretskii [Sun, 21 Apr 2024 13:06:34 +0000 (16:06 +0300)]
Avoid assertion violations in 'push_prefix_prop'
* src/xdisp.c (push_prefix_prop): Set the
'string_from_prefix_prop_p' flag for any valid value of the
'line-prefix' or 'wrap-prefix' property/variable. (Bug#70495)
Change cursor type when showing completion preview
* lisp/completion-preview.el (completion-preview-cursor-type):
New user option.
(completion-preview--window): New internal variable.
(completion-preview--window-selection-change): Bind it.
(completion-preview--original-cursor-type): New local var.
(completion-preview-active-mode, completion-preview--show): Set
'cursor-type' window parameter according to
'completion-preview-cursor-type', or reset it.
(completion-preview--post-command): Reset cursor type in
'completion-preview--window' if last command switched windows.
* src/xdisp.c (get_window_cursor_type): Consult new window
parameter 'cursor-type'.
* src/window.c (Fset_window_parameter): Mark window for
redisplay after 'cursor-type' parameter is set.
* doc/lispref/windows.texi (Window Parameters): Document it.
* doc/lispref/frames.texi (Cursor Parameters): Mention it.
* etc/NEWS: Announce it. (Bug#70622)
* lisp/completion-preview.el (completion-preview-exact): Use
more intense underline color to further distinguish this face
from 'completion-preview-common' and improve legibility with
dark background color.
Refine the Custom type of generated '*-modes' options
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Refine the Custom type of the '*-modes' option, generated when
this macro is given a ':predicate' argument. (Bug#70589)
Eli Zaretskii [Thu, 25 Apr 2024 16:34:42 +0000 (19:34 +0300)]
Fix 'mode-line-right-align-edge' with asymmetrical margins
* lisp/bindings.el (mode--line-format-right-align): Fix alignment
when window-margins are different on each side of the window.
Suggested by Charles Gonnaud <charles.gonnaud@gmail.com>.
(Bug#70485)
* doc/lispref/compile.texi (Eval During Compile):
`regexp-opt` makes for a poor example because as a pure function it
doesn't need `eval-when-compile` for constant inputs.
* lisp/minibuffer.el (minibuffer-completions-motion): New macro.
(minibuffer-next-completion): Use it.
(minibuffer-first-completion, minibuffer-last-completion): New commands.
(minibuffer-local-completion-map): Bind them.
(minibuffer-previous-completion, minibuffer-choose-completion): Doc fix.
Eli Zaretskii [Wed, 24 Apr 2024 07:02:22 +0000 (10:02 +0300)]
Fix handling of glyph codes in whitespace.el
* lisp/whitespace.el (whitespace-display-vector-p): Support glyph
codes, not just plain characters. See
https://lists.gnu.org/archive/html/help-gnu-emacs/2024-04/msg00248.html
for the details.
Po Lu [Wed, 24 Apr 2024 03:42:48 +0000 (11:42 +0800)]
Miscellaneous fixes for Android port
* lisp/touch-screen.el (touch-screen-hold, touch-screen-drag):
Clear deactivate-mark if the mark is activated to prevent undue
deactivation after completion.
* lisp/wid-edit.el (widget-field, widget-single-line-field):
Insert specifications suitable for monochrome displays.
* src/androidfns.c (Fxw_display_color_p, Fx_display_grayscale_p):
Report color and/or grayscale properly.
* src/image.c (image_create_bitmap_from_file)
[HAVE_ANDROID]: If a file with no extension cannot be located,
append .xbm and retry.
Daniel Semyonov [Wed, 21 Jun 2023 07:05:04 +0000 (10:05 +0300)]
Gnus: Add back end for Atom feeds (nnatom)
* lisp/gnus/gnus.el (gnus-valid-select-methods): Add entry for nnatom.
* lisp/gnus/nnfeed.el: New file implementing an abstract web feed back
end.
* lisp/gnus/nnatom.el: New file implementing a back end for Atom feeds.
* doc/misc/gnus.texi (Browsing the Web, Back End Interface):
* etc/NEWS (Gnus): Document nnatom and nnfeed.
João Távora [Tue, 23 Apr 2024 13:43:06 +0000 (08:43 -0500)]
Eglot: robustify eglot-test-basic-symlink test (bug#70036)
The previous version of this test was brittle, unstable and
didn't really fail when supposed to (because we need main.cpp to
not be visited when visiting mainlink.cpp). This new version is
faster and more secure.
* test/lisp/progmodes/eglot-tests.el (eglot--sniffing): Add to the
jsonrpc-event-hook at the end.
(eglot-test-basic-symlink): Robustify test.
João Távora [Mon, 22 Apr 2024 15:37:38 +0000 (16:37 +0100)]
Eglot: fix bug#70408 yet another way
The previous fix based on comparing the Eglot-provided didOpen URI to
the server-provided textDocument/publishDiagnostics URI didn't quite
work because the URI differs slightly in escaping conventions on certain
platforms.
This elephant-size bug is easily reproducible on Windows with clangd,
where every file is basically diagnostic-free.
; Exclude more modes in 'global-completion-preview-mode'
Avoid activating Completion Preview mode in a few more major
modes when 'global-completion-preview-mode' is enabled.
* lisp/completion-preview.el (global-completion-preview-mode):
By default, exclude a few more major modes for which Completion
Preview mode isn't suitable.
Po Lu [Tue, 23 Apr 2024 07:57:45 +0000 (15:57 +0800)]
Enable configuring Emacs for "pseudo-grayscale" systems on Android
* doc/emacs/android.texi (Android Windowing): Document how to
configure Emacs for monochrome displays.
* src/androidfns.c (Fx_display_visual_class): Return
Qstatic_gray when n_planes is smaller than 24.
(Fandroid_get_connection): Set n_planes by the value of
android_display_planes.
(syms_of_androidfns): <Qstatic_gray>: New function.
* src/androidterm.c (android_alloc_nearest_color): Allocate
monochrome colors similarly to the X server.
(android_query_colors): Fix typos.
(android_draw_fringe_bitmap): Create bitmaps of n_image_planes
depth.
(android_term_init): Initialize n_image_planes to 24.
(syms_of_androidterm) <android_display_planes>: New variable.
* src/androidterm.h (struct android_display_info): New field
`n_image_planes'.
* src/image.c (n_planes) [HAVE_ANDROID]: Define to
n_image_planes.
Eli Zaretskii [Tue, 23 Apr 2024 07:02:39 +0000 (10:02 +0300)]
Fix dumping signal-handler data
* src/sysdep.c (init_signals): Don't install signal handlers while
dumping only with unexec, as pdumper doesn't dump static data of
signal handlers. See
https://lists.gnu.org/archive/html/emacs-devel/2024-04/msg00539.html
for the details.
Po Lu [Tue, 23 Apr 2024 06:30:38 +0000 (14:30 +0800)]
Implement face stipples on Android
* .gitignore:
* java/Makefile.in: Fix typos.
* java/org/gnu/emacs/EmacsFillRectangle.java (perform): Call
blitOpaqueStipple if filling an unobscured rectangle with an
opaque stipple.
* java/org/gnu/emacs/EmacsGC.java (EmacsGC) <tileObject>: New
field.
(markDirty): Synchronize the current stipple with tileObject.
(prepareStipple, blitOpaqueStipple): New functions.
* java/org/gnu/emacs/EmacsService.java (EmacsService)
<resources>: New static field.
(onCreate): Set it.
* src/android.c (android_create_bitmap_from_data): Correct order
of arguments to android_create_pixmap_from_bitmap_data.
(HAS_BUILTIN_TRAP): Delete macro.
(emacs_abort): Always induce backtraces by means of a NULL
pointer deference.
* src/dispextern.h (Emacs_GC, Emacs_Rectangle, GCForeground)
(GCBackground, GCFillStyle, GCStipple, FillOpaqueStipple)
[HAVE_ANDROID]: Define to their Android counterparts rather
than simulating their existence.
* src/epaths.in: Set bitmap path to /assets/bitmaps on Android.
* src/image.c (image_bitmap_pixmap): Also enable when
HAVE_ANDROID.
* src/sfntfont-android.c (sfntfont_android_put_glyphs): Assert
that this is never called to draw a stippled background.
* src/xfaces.c (x_create_gc) [HAVE_ANDROID]: Redefine as
wrapper around android_create_gc.
(prepare_face_for_display) [HAVE_ANDROID]: Enable stipples.
Karl Fogel [Mon, 22 Apr 2024 19:45:39 +0000 (14:45 -0500)]
Fix two bugs in removing bookmark fringe marks
This fixes bug#70019 and a separate fringe-mark removal bug that
also affected bookmarks in certain Info nodes.
* lisp/bookmark.el (bookmark--remove-fringe-mark): Fix bug#70019 by
temporarily widening in order to ensure we fetch the right overlays.
Also, normalize both filenames before comparing, to avoid spurious
failure to match.
Thanks to Dani Moncayo for the bug report and for testing.
* lisp/emacs-lisp/bytecomp.el (byte-compile-format-warn):
Speed up by eliminating the temporary buffer.
Detect invalid format sequences. Use plurals properly.
* test/lisp/emacs-lisp/bytecomp-tests.el: Update test.
Po Lu [Mon, 22 Apr 2024 08:27:30 +0000 (16:27 +0800)]
Generate Android shared library list automatically
* .gitignore: Ignore new generated files.
* cross/Makefile.in (src/Makefile): Remove leftover
specification of the source Gnulib directory.
* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_READELF): New
variable.
* java/Makefile.in (CONFIG_FILE, ALL_DEPENDENCIES, READELF)
(cf-stamp-1, cf-stamp): New variables and rules; compute the set
of library files in the order of loading and generate a file
with this information.
(ALL_CLASS_FILES): New variable; if builddir is not srcdir,
$($(CONFIG_FILE), $(CLASS_FILES)): Depend on EmacsConfig.java.
add generated files in the build directory.
(classes.dex): Adjust to match.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative)
<static initializer>: Load shared libraries from
EMACS_SHARED_LIBRARIES rather than a hard-coded list.
* m4/ndk-build.m4 (ndk_INIT): Search for readelf...
(ndk_CHECK_MODULES): ...and substitute its path as
NDK_BUILD_READELF.
Juri Linkov [Mon, 22 Apr 2024 06:54:18 +0000 (09:54 +0300)]
* lisp/progmodes/flymake.el: Small improvements for buffers display.
(flymake-mode-map): Bind mouse-1 click on the fringe to
'flymake-show-buffer-diagnostics' (bug#70459).
(flymake-show-buffer-diagnostics): Display buffer diagnostics
at the bottom.
(flymake-show-project-diagnostics): Display project diagnostics
at the bottom.
Juri Linkov [Mon, 22 Apr 2024 06:50:45 +0000 (09:50 +0300)]
* lisp/emacs-lisp/warnings.el (warning-display-at-bottom): New defcustom.
(display-warning): Use 'warning-display-at-bottom' to display
the warning buffer at the bottom of the screen and to scroll
to the last warning message (bug#69983).
* test/lisp/progmodes/rust-ts-mode-tests.el: New file for rust-ts-mode
tests.
* test/lisp/progmodes/rust-ts-mode-resources/font-lock.rs: New file
with rust-ts-mode font-locking tests. New tests added for macro
font-locking (bug#70464) and function signatures
(bug#70465).
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--font-lock-settings): Add font-locking for Rust
macro metavariables, fragment specifiers and repitition patterns.
Yuan Fu [Mon, 22 Apr 2024 04:41:00 +0000 (21:41 -0700)]
Make c-ts-common-comment-indent-new-line work for more cases
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): Handle the case where user
types M-j in the middle of a line; and when the line starts with /**.
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): New function.
(c-ts-common-comment-setup): Setup comment-line-break-function and
comment-multi-line.
Improve function signature font-lock rust-ts-mode (bug#70465)
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--font-lock-settings): Add font-lock rule for Rust
function signatures and missing function modifier keyword 'default'.
Eric Abrahamsen [Sun, 21 Apr 2024 00:25:20 +0000 (17:25 -0700)]
Re-encode message bodies with externalized attachments during FCC
Bug#70338
* lisp/gnus/message.el (message-do-fcc): If the user has requested to
externalize attachments, we can't use the cached version of the message
body from sending. This mirrors an equivalent check for GCC in
`gnus-inews-do-gcc'.
The source of bug#70436 is that we print a value into the buffer
and then we generate its print representation a second time to
get its length to find the bounds of the thing we just printed.
Not only it's wasteful, but it risks bugs because the two
"prints" can be inconsistent with each other.
This is not a complete fix because in the non EVALD case we
still use that same broken way.
* lisp/emacs-lisp/backtrace.el (backtrace--print-func-and-args):
Don't re-print things just to get their length.
(backtrace--print-to-string): Skip a temp-buffer indirection.
Eli Zaretskii [Sat, 20 Apr 2024 09:11:18 +0000 (12:11 +0300)]
Avoid "C-h for help" prompt in "C-h" commands describing keys
* lisp/info.el (Info-goto-emacs-key-command-node): Call
'read-key-sequence' instead of using 'interactive' with the "k"
code, and suppress the "C-h for help" echo.
* lisp/help.el (help--read-key-sequence): Suppress the "C-h for
help" prompt in echo-keystrokes. Give the prompt the
'minibuffer-prompt' face. (Bug#70432)