* lisp/faces.el (face-spec-recalc): Don't set
scroll-bar-foreground and scroll-bar-background parameters on
ttys.
* lisp/mouse.el (mouse-drag-frame-resize)
(mouse-drag-frame-move): On ttys call
'mouse-position-in-root-frame' to get position of child frame to
resize or drag.
* lisp/xt-mouse.el (xterm-mouse-event): Handle events on
child frame decorations as if they happened on the internal border
to find out whether a user wants to drag or resize a child frame.
* src/frame.c (frame_internal_border_part): Define for ttys too.
(Fmouse_position_in_root_frame): New function.
* src/frame.h (internal_border_part): Define for ttys too.
* src/keyboard.c (internal_border_parts): Define for ttys too.
(frame_border_side): New enum.
(make_lispy_position): Handle events on tty child frames.
(Fposn_at_x_y): Accept -1 for Y so we can handle a position on
the top decoration of a tty child frame.
* src/term.c (tty_frame_at): Handle case where X and Y denote a
position on a tty child frame's decoration.
* src/window.c (Fwindow_at): Handle case where X and Y denote a
position on the decoration of a tty child frame which we pretend
as belonging to that child frame (and not to its root).
* src/dispnew.c (child_xy): New function.
* src/dispextern.h: Declare it.
* src/term.c (tty_frame_at): Return child-relative (x, y) in output
parameters.
(Ftty_frame_at): Return a list (FRAME CHILD-X CHILD-Y).
(handle_one_term_event): Adapt use of tty_frame_at.
* lisp/xt-mouse.el (xterm-mouse-event): Use new tty-frame-at.
* lisp/frame.el (x-list-fonts): Delete `frame-at', to move to
C implementation.
* lisp/xt-mouse.el (xterm-mouse-event): Call new `tty-frame-at'.
* src/term.c (tty_frame_at, Ftty_frame_at): New C function,
replacing `frame-at' only for TTYs.
(term_mouse_position): Use last_mouse_frame when it is set.
(handle_one_term_event): Call tty_frame_at to get frame under
mouse, store it in last_mouse_frame. Alter event coordinates
based on mouse frame.
(syms_of_term): Add tty-frame-at, last_mouse_frame.
* src/termhooks.h: Make Gpm_Event parameter const.
Many terminals set the environment variable TERM to "xterm" even when they
don't support all functionality in xterm. This means that enabling
xterm-mouse-mode can break critical editing workflows like copy/paste. This
adds checks for the specific terminal Emacs is run in and only enables
xterm-mouse-mode on terminals knows to support all critical editing workflows.
* etc/NEWS: Update announcement
* lisp/term/xterm.el (xterm--auto-xt-mouse-allowed-names)
(xterm--auto-xt-mouse-allowed-types): New variables to control
what terminals automatically enable xterm-mouse-mode.
(xterm--report-background-handler, xterm--version-handler): Use
xterm--read-string.
(xterm--read-string, xterm--query-name-and-version): New
function.
(xterm--init): Check what terminal is running and if
xterm-mouse-mode was manually called.
* lisp/xt-mouse.el (xterm-mouse-mode-called): New variable.
(xterm-mouse-mode): Set xterm-mouse-mode-called. Mention
automatic call by xterm--init. Delete outdated comment text.
This is basically a workaround for running a test in batch mode
which should have a tty frame available but doesn't.
* src/frame.c (check_tty): Relax check if noninteractive.
* lisp/xt-mouse.el (xterm-mouse-event): Don't use frame-at if
noninteractive.
Add support for child frames on tty
The redisplay part is complete. The frame-handling part supports
use-cases like Posframe, Corfu, and child frames acting like tooltips.
Other use-cases of child frames are not currently supported. In
particular, trying to create minibuffer-only child frames on ttys will
signal an error.
* src/xfaces.c (free_frame_faces): Change formatting slightly.
* src/xdisp.c (redisplay_trace, move_tracxe): Print to stderr because
stdout screws up terminal display.
(init_iterator): Remove a #ifdef HAVE_WINDOW_SYSTEM.
(clear_garbaged_frames): Return a bool telling if we cleared matrix.
(echo_area_display): Use combine_updates on tty frames.
(redisplay_internal): Changes for redisplay of tty child windows.
(deep_copy_glyph_row): Take a frame parameter.
(display_tty_menu_item): Changes because of function signature changes.
* src/w32term.c (w32_read_socket): Don't use FRAME_OBSCRURED_P,
which has been removed.
* src/w32inevt.c (do_mouse_event): Workaround for mouse events on
child frafmes.
* src/w32console.c (w32con_write_glyphs, w32con_update_end):
Use glyphs' frame for faces.
* src/treesit.c (treesit_load_language): Pacify a warning.
* src/w32console.c (w32con_clear_end_of_line): Set glyph's frame.
* src/terminal.c (cursor_to, raw_cursor_to): Handle case that
frame is a child frame.
* src/termhooks.h: Declare formerly static functions.
* src/term.c (tty_hide_cursor, tty_show_cursor): Make externally
visible.
(tty_write_glyphs): Determine faces based on a glyph's frame.
(tty_write_glyphs_with_face): Take a struct face argument instead
of a face id. Callers changed.
(tty_insert_glyphs): Use faces, not face ids.
(append_glyph, append_composite_glyph, append_glyphless_glyph):
Set glyph's frame.
(turn_on_face, turn_off_face): Take face argument instead of face
id. Callers adapted.
(Fresume_tty): Act on root frame.
(tty_draw_row_with_mouse_face): Handle child frames.
(restore_desired_matrix): Make sure glyphs' is live.
(set_tty_hooks): Set terminal's frame_raise_lower_hook.
(tty_frame_geometry, Ftty_frame_geometry, Ftty_frame_edges)
(Ftty_frame_list_z_order, Ftty_frame_restack)
(tty_display_dimension, Ftty_display_pixel_width)
(Ftty_display_pixel_height): New functions.
(syms_of_term): Defsubr new Lisp functions.
* src/minibuf.c (read_minibuf): Use combine_updates for tty
frames.
* src/frame.h (struct frame): Always define parent_frame. Change
'visible' to be a boolean. Always define 'undecorated' and
'no_accept_focus'. Add 'z_order'.
(FRAME_OBSCURED_P): Removed.
(FRAME_PARENT_FRAME): Make it a function.
(SET_FRAME_VISIBLE): Take a bool parameter, not an int.
(FRAME_INTERNAL_BORDER_WIDTH): Don't special-base HAVE_WINDOW_SYSTEM.
* src/frame.c (decode_tty_frame): New function.
(set_menu_bar_lines): Set menu bar lines and height to 0 for tty
child frames. Compute min height differently.
(adjust_frame_size): Set FrameCols/Rows only for root tty frames.
Mark tty root frame garbaged if child frame is adjusted. Run some
code even if not HAVE_WINDOW_SYSTEM.
(make_frame): Run some code even if not HAVE_WINDOW_SYSTEM.
(make_terminal_frame): Implement child frame creation.
(tty_child_pos_param, tty_child_size_param)
(tty_child_frame_rect): New functions.
(Fmake_terminal_frame): Parts rewritten for child frames.
(do_switch_frame): Add child frame support.
(Fframe_ancestor_p): Define if not HAVE_WINDOW_SYSTEM.
(Fmake_frame_visible, Fmake_frame_invisible)
(Fframe_visible_p, Fraise_frame):
Handle tty frames differently.
(store_frame_param): Signal error if trying to re-parent a tty
child frame.
(Fframe_parameters): Report some additional tty frame parameters.
(Fmodify_frame_parameters): Handle tty child frames.
(Fset_frame_position): Ditto.
(frame_parms): Define index for additional frame parameters.
(handle_frame_param): New function.
(gui_set_frame_parameters_1): Use handle_frame_param.
* src/disptab.h (DISP_TABLE_EXTRA_SLOTS): Change to 12.
(enum box): New enumeration.
* src/dispnew.c (check_rows): New function, #if 0.
(frame_matrix_frame): Variable removed.
(line_hash_code): Take glyph's frame into account.
(build_frame_matrix_from_leaf_window): Do not copy glyphs from
rows that aren't enabled.
(fill_up_glyph_row_with_spaces): Add frame parameter, uses
changed.
(fill_up_glyph_row_area_with_spaces): Add frame parameter. Set
glyph's frame to it.
(fill_up_frame_row_with_spaces): Ditto.
(set_frame_matrix_frame): Function removed.
(make_current): Change signature. Callers changed.
(mirrored_line_dance): Take a frame argument, not a matrix.
(redraw_frame): Don't clear_frame a child frame.
(struct rect): New.
(rect_intersect, frame_pos_abs, frame_rect_abs, root_frame)
(max_child_z_order, is_frame_ancestor, frames_with_root)
(frames_with_parent, frame_z_order_cmp, Fframe__z_order_lessp)
(frames_in_reverse_z_order, tty_raise_lower_frame, is_tty_frame)
(is_tty_child_frame, is_tty_root_frame, first_enabled_row)
(make_matrix_current, prepare_desired_root_row)
(make_glyph_space, neutralize_wide_char, produce_box_glyphs)
(produce_box_sides, produce_box_line, copy_child_glyphs)
(update_window_frame, update_initial_frame, flush_terminal)
(abs_cursor_pos, is_in_matrix, is_cursor_obscured)
(terminal_cursor_magic, combine_updates_for_frame)
(combine_updates): New functions.
(update_frame): Rewritten.
(Fdisplay__update_for_mouse_movement): Take a MOUSE_FRAME param.
(syms_of_display): New symbol frame--z-order--lessp, tty-non-selected-cursor.
New subr Sframe__z_order_lessp. Provide tty-child-frames.
* src/dispextern.h (struct glyph): Add member 'frame'.
(CHAR_GLYPH_SPACE_P): Add FRAME parameter. All uses changed.
(GLYPH_EQUAL_P): Compare glyphs' frame.
(SET_CHAR_GLYPH): Add parameter FRAME.
(SET_CHAR_GLYPH_FROM_GLYPH): Ditto.
* src/chartab.c (Fmake_char_table): Allow more than 10 display
table slots.
* lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): Use new
terminal parameter xterm-mouse-frame.
(xterm-mouse-position-function): Ditto.
(xterm-mouse-event): Determine frame under mouse and compute
frame-relative coordinates. Set terminal parameter
xterm-mouse-frame.
* lisp/tty-tip.el: New file implementing tooltip for ttys.
* lisp/paren.el (show-paren-function): Don't check if
display-graphics-p when using child frames.
* lisp/frame.el (frame-at): New function.
(tty-frame-geometry, tty-frame-edges, tty-frame-restack)
(tty-display-pixel-height, tty-frame-list-z-order)
(tty-display-pixel-width): Declare C function.
(frame-geometry): Use tty-frame-geometry.
(frame-edges): Use tty-frame-edges.
(frame-list-z-order): Use tty-frame-list-z-order.
(frame-restack): Use tty-frame-restack.
(display-pixel-height): Use tty-display-pixel-height.
(display-pixel-width): Use tty-display-pixel-width.
* lisp/disp-table.el (display-table): Increase size to 12.
(box-horizontal, box-vertical, box-down-right, box-down-left)
(box-up-right, box-up-left): New display table slot names for
box-drawing characters.
(display-table-slot, set-display-table-slot): Extend doc string.
(describe-display-table): Display new display table slots.
(standard-display-unicode-special-glyphs): New function setting
up Unicode characters for display table entries.
* .gitignore: Don't ignore patch files, they are useful to see in
Magit status buffer when applying patches (git am).
* lisp/xt-mouse.el (xterm-mouse-mode): Change default value of
xterm-mouse-mode to t.
* lisp/term/xterm.el (xterm--init): Enable xterm-mouse-mode if
the default value is still set.
* etc/NEWS: Document new behavior.
This is based on a diff from 2024-10-15 which still applied.
Since then, I've inadvertantly modified the igc branch so that
it is no longer possible to get a clean diff of what has changed
since I created the branch.
Change the handling of the old X11 convention that uses mouse-4/5/6/7
events to represent wheel events: instead of asking downstream
packages to use the `mouse-wheel-*-event` variables to know which events
represent wheel events, use new var `mouse-wheel-buttons` to directly
convert those events into the standard `wheel-up/down/left/right` events
used everywhere else.
This will simplify the work of packages which can thus just bind their
commands to `wheel-up/down/left/right`.
* lisp/mouse.el (mouse-wheel-buttons): New custom variable.
* src/keyboard.c (make_lispy_event): Adjust for "wheel-clicks" on the tab-bar.
* src/xterm.c (x_construct_mouse_click): Add `xi2` argument and
obey `mouse-wheel-buttons` variable.
(handle_one_xevent): Adjust calls accordingly.
(syms_of_xterm): Define the `mouse-wheel-buttons` and the
`wheel-up/down/left/right`symbols.
* lisp/xt-mouse.el: Don't require `mwheel` any more.
(xterm-mouse--same-button-p): Delete function.
(xterm-mouse--read-event-sequence): Use `mouse-wheel-buttons`.
* lisp/mwheel.el (mouse-wheel-up-event, mouse-wheel-down-event)
(mouse-wheel-left-event, mouse-wheel-right-event): Make obsolete.
(mouse-wheel-obey-old-style-wheel-buttons): Delete variable.
* lisp/completion-preview.el (completion-preview--mouse-map):
* lisp/progmodes/flymake.el (flymake--mode-line-counter-map):
* lisp/edmacro.el (edmacro-fix-menu-commands): Silence warnings.
Generate select-window events, so that 'mouse-autoselect-window'
takes effect on TTY frames, when 'xterm-mouse-mode' is enabled.
* lisp/xt-mouse.el (xterm-mouse-translate-1):
If 'mouse-autoselect-window' is non-nil, add select-window
events to 'unread-command-events'. (Bug#69915)
* lisp/xt-mouse.el (xterm-mouse--same-button-p): New function.
(xterm-mouse--read-event-sequence): Use it to obey
`mouse-wheel-*-event` variables.
* lisp/mwheel.el (mouse-wheel-obey-old-style-wheel-buttons):
Update docstring.
* lisp/xt-mouse.el (xterm-mouse-translate-1): Fix the 'event-kind'
property of mouse-movement symbols emitted by xt-mouse.
* lisp/term/linux.el (terminal-init-linux): Call 'gpm-mouse-mode'
to set up the terminal for the mouse, if needed.
* lisp/xt-mouse.el (xterm-mouse--read-coordinate): Fix conversion
of mouse coordinates in rxvt-unicode. Patches by Vladimir
Panteleev <git@cy.md> and Jared Finder <jared@finder.org>.
(Bug#61022)
* src/dispnew.c (update_mouse_position): New function for mouse
movement logic in 'handle_one_term_event' that can be shared across
different mouse backends.
(display--update-for-mouse-movement): New lisp function, call it.
* lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): New function
that calls 'display--update-for-mouse-movement'.
(xterm-mouse-translate-1): Call it.
* src/term.c (handle_one_term_event): Inline logic from
'term_mouse_movement' and call 'update_mouse_position'.
(term_mouse_movement): Delete.
For layouts such as the following, clicking the "l" in Tools with the
right window focused would trigger the File menu, not the Tools menu.
This is because the event would have window coordinate (1 . 0).
Similarly, clicking the "p" in Help would trigger the Edit menu.
Example Emacs frame:
+--------------------------------------------------------+
|File Edit Options Buffers Tools Help |
|;; This buffer is for text$|;; This buffer is for text $|
|;; To create a file, visit$|;; To create a file, visit $|
| | |
| | |
|-UUU:----F1 *scratch* |-UUU:----F1 *scratch* |
| |
+--------------------------------------------------------+
* lisp/menu-bar.el (menu-bar-open-mouse): Reject clicks not on
the menu bar.
*lisp/xt-mouse.el (xterm-mouse-event): Pass the current frame to
'posn-at-x-y', to make the effect consistent with other mouse-handling
features.
* src/term.c (mouse_get_xy): Call 'mouse_position' passing it the
value of 'tty-menu-calls-mouse-position-function' as the
argument.
(syms_of_term) <tty-menu-calls-mouse-position-function>: New
DEFVAR_BOOL.
* src/frame.c (mouse_position): New function, with most of the
code from Fmouse_position, but call 'mouse-position-function' only
if called with non-zero argument.
(Fmouse_position): Call 'mouse_position' to do the job.
* lisp/xt-mouse.el (xterm-mouse-translate-1): Respect
'track-mouse'.
(xterm-mouse-mode): Set 'tty-menu-calls-mouse-position-function'
when setting 'mouse-position-function'.
(xterm-mouse-tracking-enable-sequence): Use SET_ANY_EVENT_MOUSE
(0x1003) so that mouse movement can be reported even if no buttons
are pressed. Doc fix.
* lisp/menu-bar.el (menu-bar-define-mouse-key): New function.
(tty-menu-navigation-map): Call it.
* doc/lispref/frames.texi (Mouse Position): Document
'tty-menu-calls-mouse-position-function'.
* etc/NEWS: Announce 'tty-menu-calls-mouse-position-function'.
This mostly changes http: to https: in URLs. It also updates
some URLs that have moved, removes some URLs that no longer
work, recommends against using procmail (procmail.org no
longer works), and removes some mentions of the
no-longer-existing Gmane, LPF and VTW.
It doesn't update all URLs, just the ones I had time for.
* GNUmakefile (help):
* admin/admin.el (manual-doctype-string):
* admin/charsets/Makefile.in (${charsetdir}/ALTERNATIVNYJ.map):
* admin/charsets/mapconv:
* lisp/net/soap-client.el (soap-create-envelope):
* lisp/org/org.el (org-doi-server-url):
* lisp/textmodes/bibtex.el (bibtex-generate-url-list):
Prefer https: to http: un URLs.
* lisp/tab-bar.el (tab-bar-mouse): New command bound to mouse-1 on [tab-bar].
* lisp/xt-mouse.el (xterm-mouse-event): Use `tab-bar' when clicking
on the tab-bar that is on the second row below menu-bar.
* src/frame.c (set_tab_bar_lines): New function.
(frame_windows_min_size): Add FRAME_TAB_BAR_LINES.
(make_initial_frame): Call set_tab_bar_lines.
(store_frame_param): Call set_tab_bar_lines for Qtab_bar_lines prop.
(Fframe_parameters): Call store_in_alist for Qtab_bar_lines.
* src/xdisp.c (display_tab_bar): New function.
(redisplay_window): Call display_tab_bar when `FRAME_WINDOW_P (f)'
is NULL on a tty.
This replaces the awkward reuse of encode-time to both convert
calendrical timestamps to Lisp timestamps, and to convert Lisp
timestamps to other forms. Now, encode-time does just the
former and the new function does just the latter.
The new function builds on a suggestion by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00801.html
and refined by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00803.html
* doc/lispref/os.texi (Time of Day, Time Conversion):
* doc/misc/emacs-mime.texi (time-date):
* etc/NEWS: Update documentation.
* lisp/calendar/cal-dst.el (calendar-next-time-zone-transition):
* lisp/calendar/time-date.el (seconds-to-time, days-to-time):
* lisp/calendar/timeclock.el (timeclock-seconds-to-time):
* lisp/cedet/ede/detect.el (ede-detect-qtest):
* lisp/completion.el (cmpl-hours-since-origin):
* lisp/ecomplete.el (ecomplete-add-item):
* lisp/emacs-lisp/cl-extra.el (cl--random-time):
* lisp/emacs-lisp/timer.el (timer--time-setter)
(timer-next-integral-multiple-of-time):
* lisp/find-lisp.el (find-lisp-format-time):
* lisp/gnus/gnus-diary.el (gnus-user-format-function-d):
* lisp/gnus/gnus-group.el (gnus-group-set-timestamp):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-show-org-agenda):
* lisp/gnus/nnrss.el (nnrss-normalize-date):
* lisp/gnus/nnspool.el (nnspool-request-newgroups):
* lisp/net/ntlm.el (ntlm-compute-timestamp):
* lisp/net/pop3.el (pop3-uidl-dele):
* lisp/obsolete/vc-arch.el (vc-arch-add-tagline):
* lisp/org/org-clock.el (org-clock-get-clocked-time)
(org-clock-resolve, org-resolve-clocks, org-clock-in)
(org-clock-out, org-clock-sum):
* lisp/org/org-id.el (org-id-uuid, org-id-time-to-b36):
* lisp/org/ox-publish.el (org-publish-cache-ctime-of-src):
* lisp/proced.el (proced-format-time):
* lisp/progmodes/cc-cmds.el (c-progress-init)
(c-progress-update):
* lisp/progmodes/cperl-mode.el (cperl-time-fontification):
* lisp/progmodes/flymake.el (flymake--schedule-timer-maybe):
* lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info)
(vhdl-fix-case-region-1):
* lisp/tar-mode.el (tar-octal-time):
* lisp/time.el (emacs-uptime):
* lisp/url/url-auth.el (url-digest-auth-make-cnonce):
* lisp/url/url-util.el (url-lazy-message):
* lisp/vc/vc-cvs.el (vc-cvs-parse-entry):
* lisp/vc/vc-hg.el (vc-hg-state-fast):
* lisp/xt-mouse.el (xterm-mouse-event):
* test/lisp/emacs-lisp/timer-tests.el:
(timer-next-integral-multiple-of-time-2):
Use time-convert, not encode-time.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
Don’t use now-removed FORM argument for encode-time.
It wasn’t crucial anyway.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add time-convert.
* lisp/emacs-lisp/elint.el (elint-unknown-builtin-args):
Update encode-time signature to match current arg set.
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Use timer-convert with t rather than doing it by hand.
* src/timefns.c (time_hz_ticks, time_form_stamp, lisp_time_form_stamp):
Remove; no longer needed.
(decode_lisp_time): Rturn the form instead of having a *PFORM arg.
All uses changed.
(time_arith): Just return TICKS if HZ is 1.
(Fencode_time): Remove argument FORM. All callers changed.
Do not attempt to encode time values; just encode
decoded (calendrical) times.
Unless CURRENT_TIME_LIST, just return VALUE since HZ is 1.
(Ftime_convert): New function, which does the time value
conversion that bleeding-edge encode-time formerly did.
Return TIME if it is easy to see that it is already
of the correct form.
(Fcurrent_time): Mention in doc that the form is planned to change.
* test/src/timefns-tests.el (decode-then-encode-time):
Don’t use (encode-time nil).
* lisp/xt-mouse.el (xterm-mouse-truncate-wrap): Now obsolete,
since we no longer need to worry about integer overflow.
(xterm-mouse-event): Use plain ‘truncate’ instead.
Add a paragraph to minor mode's docstring documenting the mode's ARG
usage if the supplied docstring doesn't already contain the word "ARG".
* easy-mmode.el (easy-mmode--arg-docstring): New const.
(easy-mmode--arg-docstring): New function.
(define-minor-mode): Use them.
Remove argument documentation from all minor modes.
* lisp/xt-mouse.el (xterm-mouse-event): Move the check for
the last click so that click-count is initialized properly.
Handle the value of t for double-click-time.
(Bug#28658)
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November. Change these FTP URLs to https://ftp.gnu.org
instead. Make similar changes for URLs to other organizations moving
away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
It has been observed (in the HTerm terminal emulator) that the
event stored in the 'xterm-mouse-last-down' terminal parameter gets
overwritten during a mouse drag operation, causing Emacs to attempt to
synthesize the non-existing <drag-mouse-0> event. Copy the event into
the terminal parameter to protect against such modifications.
* lisp/xt-mouse.el (xterm-mouse-translate-1): Guard against modification
of input event list.