Jim Porter [Wed, 2 Mar 2022 02:36:08 +0000 (18:36 -0800)]
Fix parsing of indices in Eshell expansions
Previously, more-complex index expansions, like '$var[":" 0]' or
'$var[$(expr) 0]' failed to parse correctly.
* lisp/eshell/esh-var.el (Commentary): Clarify indexing and length
expansions.
(eshell-parse-indices): Expand docstring and support parsing inside
double-quotes.
(eshell-eval-indices): New function.
(eshell-parse-variable): Use it.
Jim Porter [Sun, 27 Feb 2022 04:55:22 +0000 (20:55 -0800)]
Add a new macro to simplify parsing temporary Eshell command strings
This abstracts out the somewhat-unusual "insert&delete" logic in
'eshell-parse-command' so that it can be used elsewhere, and also
ensures that the deletion occurs even if an an error occurs.
* lisp/eshell/esh-cmd.el (eshell-with-temp-command): New macro.
(eshell-parse-command): Use it.
Dmitry Gutov [Thu, 3 Mar 2022 03:23:26 +0000 (05:23 +0200)]
Cache the backend value together with the project root
* lisp/progmodes/project.el (project-try-vc):
Cache the backend value together with the root.
(project-root, project-files, project-ignores):
Update to access the new data structure.
Po Lu [Wed, 2 Mar 2022 11:00:21 +0000 (19:00 +0800)]
Fix reporting of imaginary key prefixes on toolkit tool and menu bars
* src/keyboard.c (make_lispy_position): Set imaginary prefix if
the terminal says what widget the position is on top of.
* src/termhooks.h (struct terminal): New field
`toolkit_position_hook'.
* src/xterm.c (x_toolkit_position): New function.
(x_create_terminal): Register hook.
Po Lu [Tue, 1 Mar 2022 11:15:46 +0000 (19:15 +0800)]
Fix crashes and other bugs on LessTif
* lwlib/lwlib-Xm.c (make_menu_in_widget): XmIsRowColumn is
broken on the latest LessTif release, so avoid that here.
* src/xfns.c (x_window): Add PropertyChangeMask which LessTif
doesn't do itself.
Po Lu [Tue, 1 Mar 2022 10:38:08 +0000 (18:38 +0800)]
Fix reporting of wheel events on top of GTK scroll bars
* src/gtkutil.c (xg_update_scrollbar_pos):
(xg_update_horizontal_scrollbar_pos): Stop ensuring the window
is native.
(xg_event_is_for_scrollbar): New variable `for_valuator'.
All callers changed.
* src/gtkutil.h: Update prototypes.
* src/xterm.c (handle_one_xevent): Drop all valuator change
events destined for scroll bars.
Po Lu [Tue, 1 Mar 2022 06:59:32 +0000 (14:59 +0800)]
Avoid duplicate wheel and button events on non-toolkit scroll bars
* src/xterm.c (x_scroll_bar_create): Set appropriate input
extension event mask.
(handle_one_xevent): Move some ifdefs around and handle input
extension button events on scroll bars.
Po Lu [Tue, 1 Mar 2022 06:44:02 +0000 (14:44 +0800)]
Fix old X menu on builds with XI2
* oldXMenu/Activate.c (XMenuActivateSetTranslateFunction): New
function.
(XMenuActivate): Handle generic events.
* oldXMenu/XMenu.h: New prototypes.
(Translate_func): New type.
* src/xmenu.c (x_menu_wait_translate_generic_event): New
function.
(x_menu_show): Set translate function.
Po Lu [Tue, 1 Mar 2022 05:48:36 +0000 (13:48 +0800)]
Fix C-g inside toolkit file dialogs with XI2
* src/xfns.c (Fx_file_dialog): Handle GenericEvents when looking
for quit character.
* src/xmenu.c (x_menu_wait_for_event): If data is non-nil, use
XPending.
Po Lu [Tue, 1 Mar 2022 03:31:37 +0000 (11:31 +0800)]
Intern server time property during terminal initialization
* src/xmenu.c (create_and_show_popup_menu): Use previously
interned atom.
* src/xterm.c (x_term_init): New atom `EMACS_SERVER_TIME_PROP'.
* src/xterm.h (struct x_display_info): New field
`Xatom_EMACS_SERVER_TIME_PROP'.
Po Lu [Tue, 1 Mar 2022 03:30:52 +0000 (11:30 +0800)]
Fix Motif menu help text in submenus
* lwlib/lwlib-Xm.c (xm_arm_callback):
(make_menu_in_widget):
(update_one_menu_entry):
(xm_update_one_widget):
(do_call): Pass instance to arm callback and use wv as user data
instead of call data.
Stefan Monnier [Mon, 28 Feb 2022 16:59:38 +0000 (11:59 -0500)]
ecomplete: Try and avoid losing data
* lisp/ecomplete.el (ecomplete-add-item): Make sure the database is
setup, so we don't risk overwriting it with a (mostly) empty one.
(ecomplete-save): Don't save an empty database.
Po Lu [Mon, 28 Feb 2022 06:35:01 +0000 (14:35 +0800)]
Better fix for bug#13476
* lisp/faces.el (face-spec-recalc): Apply scroll bar foreground
and background to the frame if changing the scroll-bar face.
(scroll-bar): Restore previous declaration. That way, the
default colors are used for toolkit scroll bars, instead of
black and white.
Po Lu [Mon, 28 Feb 2022 06:04:23 +0000 (14:04 +0800)]
Improve treatment of toolkit scroll bars with the input extension
* src/xterm.c (x_create_horizontal_toolkit_scroll_bar)
(x_create_toolkit_scroll_bar): Set XI2 event mask appropriately.
(handle_one_xevent): Make sure coordinates are correct for the
frame's window when handling wheel events.
Po Lu [Mon, 28 Feb 2022 01:16:17 +0000 (01:16 +0000)]
Treat scroll bar information consistently on Haiku
* src/haiku_support.cc (class EmacsScrollBar): New field `info'.
(EmacsScrollBar): Obtain scroll bar info on initialization.
(ButtonRegionFor): Use that information instead.
* m4/gnulib-common.m4 (gl_COMMON_BODY):
* lib/gnulib.mk.in (CXXCPP):
* lib/cdefs.h: Updated with admin/merge-gnulib. (This is in
preparation to adding the nanosleep module later.)
Po Lu [Sun, 27 Feb 2022 02:37:17 +0000 (10:37 +0800)]
Fix Motif menu and menu bar dismissal on XI2
* src/xmenu.c (x_activate_menubar): Improve ungrabbing logic on
XI2.
(server_timestamp_predicate): New function.
(create_and_show_popup_menu): If the display supports XI2, make
sure the timestamps are correct by dispatching a PropertyNotify
event to Xt.
* src/xterm.c (handle_one_xevent): Translate XI_ButtonRelease
events into core events before dispatching them to Xt.
Eli Zaretskii [Sat, 26 Feb 2022 07:41:05 +0000 (09:41 +0200)]
Document better how to reset attributes of faces for new frames
* doc/lispref/display.texi (Attribute Functions):
* lisp/faces.el (set-face-attribute): Explain how to reset an
attribute's value for future frames. (Bug#54156)
Po Lu [Sat, 26 Feb 2022 06:56:31 +0000 (06:56 +0000)]
Improve scroll bar button handling on Haiku
* src/haiku_io.c (haiku_len): Add `SCROLL_BAR_PART_EVENT'.
* src/haiku_support.cc (class EmacsScrollBar): New fields
`dragging' and `current_state', along with `old_value' and
`current_part'.
(EmacsScrollBar): Set horizontal flag to `horizontal_p'.
(MessageReceived): Set old_value when receiving
SCROLL_BAR_UPDATE message.
(ValueChanged): Don't allow scroll bar values to change while
dragging.
(MouseUp, MouseDown): Calculate button under mouse and act
accordingly.
* src/haiku_support.h (enum haiku_event_type): New event
`SCROLL_BAR_PART_EVENT'.
(enum haiku_scroll_bar_part): New enumerator.
(struct haiku_scroll_bar_part_event): New struct.
* src/haikuterm.c (haiku_read_socket): Handle
SCROLL_BAR_PART_EVENTs.
Dmitry Gutov [Sat, 26 Feb 2022 00:18:34 +0000 (02:18 +0200)]
Drop the visited file modtime check for remote xref hits
* lisp/progmodes/xref.el (xref--hits-remote-id): New variable.
(xref--convert-hits, xref--collect-matches)
(xref--find-file-buffer): Use it (bug#54025).
Bob Rogers [Fri, 25 Feb 2022 12:03:20 +0000 (13:03 +0100)]
Add new file ietf-drums-date.el
* lisp/mail/ietf-drums-date.el: parse-time-string replacement which is
compatible but can be made stricter if desired.
* test/lisp/mail/ietf-drums-date-tests.el (added): Add tests for
ietf-drums-parse-date-string.
* lisp/mail/ietf-drums.el (ietf-drums-parse-date): Use
ietf-drums-parse-date-string.
Po Lu [Fri, 25 Feb 2022 11:36:07 +0000 (11:36 +0000)]
Improve treatment of dropping mouse track state on Haiku
* src/haikuterm.c (haiku_mouse_or_wdesc_frame): New function.
(haiku_read_socket): Use it to find the appropriate frame when
handling motion or button events.
Po Lu [Fri, 25 Feb 2022 08:05:11 +0000 (08:05 +0000)]
Improve tracking of modified regions on Haiku
* src/haiku_support.cc (class EmacsView): New field
`invalid_region'.
(FlipBuffers): Only invalidate that region.
(SetUpDoubleBuffering): Clear that region.
(BView_draw_lock): New parameters for denoting the region
to invalidate.
(BView_invalidate_region): New function.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (haiku_set_background_color):
* src/haikumenu.c (digest_menu_items):
* src/haikuterm.c (haiku_clip_to_string):
(haiku_flip_buffers):
(haiku_clear_frame_area):
(haiku_clear_frame):
(haiku_draw_glyph_string):
(haiku_after_update_window_line):
(haiku_draw_window_cursor):
(haiku_draw_vertical_window_border):
(haiku_draw_window_divider):
(haiku_draw_fringe_bitmap):
(haiku_scroll_run):
(haiku_read_socket):
(haiku_flash):
(haiku_clear_under_internal_border): Mark appropriate region as
invalid before buffer flip.
Po Lu [Fri, 25 Feb 2022 06:15:51 +0000 (14:15 +0800)]
Make interpolated scrolling work above non-selected windows
* lisp/pixel-scroll.el (pixel-scroll-precision-interpolate): New
parameter `old-window'.
(pixel-scroll-precision): Pass originally selected window to the
interpolation function.
Alan Mackenzie [Thu, 24 Feb 2022 17:30:39 +0000 (17:30 +0000)]
Amend byte-run-strip-symbol-positions so that an unexec build builds
This fixes bug #54098.
* lisp/emacs-lisp/byte-run.el (byte-run--strip-list)
(byte-run--strip-vector/record): New functions. These alter a list or
vector/record structure only where a symbol with position gets replaced by a
bare symbol.
(byte-run-strip-symbol-positions): Reformulate to use the two new functions.
(function-put): No longer strip positions from the second and third arguments.
* lisp/emacs-lisp/bytecomp.el (byte-compile-out): Remove the senseless
"stripping" of putative symbol positions from OPERAND, which is nil or a
number.
Jim Porter [Thu, 24 Feb 2022 04:43:38 +0000 (20:43 -0800)]
Don't superfluously emit prompts when terminating processes in Eshell
* lisp/eshell/esh-proc.el (eshell-kill-process-function): Only reset
the prompt if PROC is writing to the terminal.
(eshell-sentinel): Only write the exit message if PROC is writing to
the terminal (bug#54136).
* test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-pipeline)
(esh-proc-test/kill-pipeline-head)
(esh-proc-test/kill-background-process): New tests.