Commit graph

162 commits

Author SHA1 Message Date
Martin Rudalics
86be9431ae Implement dragging and resizing of tty child frames
* 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).
2025-03-17 09:50:19 +01:00
Gerd Möllmann
02fbdbf4ff Handle case of not knowing a frame when mouse moved
* lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): Don't call
display--update-for-mouse-movement if we don't have a frame.
2025-02-24 05:51:41 +01:00
Gerd Möllmann
59050c3e8c ; Fix workaround for xt-mouse-tests
* lisp/xt-mouse.el (xterm-mouse-event): For running this in batch mode,
fix computation of x and y.
2025-01-27 10:21:08 +01:00
Gerd Möllmann
ccf3f8d21e Reapply "Fix mouse position handling for nested tty child frames"
This reverts commit e2cc52dbcd.
2025-01-25 14:46:05 +01:00
Gerd Möllmann
e2cc52dbcd Revert "Fix mouse position handling for nested tty child frames"
This reverts commit f37559a1ee.
2025-01-25 09:39:47 +01:00
Gerd Möllmann
f37559a1ee Fix mouse position handling for nested tty child frames
* 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.
2025-01-25 07:35:51 +01:00
Jared Finder
d018a26f9c Support TTY child frames with GPM mouse
* 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.
2025-01-11 12:47:46 +02:00
Jared Finder
ba6429081a Don't always enable xterm-mouse-mode (bug#74833)
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.
2025-01-04 15:14:36 +02:00
Paul Eggert
4da38c6321 Update copyright year to 2025
Run "TZ=UTC0 admin/update-copyright".
2025-01-01 07:39:17 +00:00
Gerd Möllmann
82c3fcd17e Allow xt-mouse-tests to run
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.
2024-12-20 07:03:59 +01:00
Gerd Möllmann
8aef5d224a Merge branch 'scratch/tty-child-frames'
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).
2024-12-19 10:14:16 +01:00
Jared Finder
9ccd459e84 Enable xterm-mouse-mode by default in xterm
* 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.
2024-12-12 12:51:13 +02:00
Gerd Möllmann
e232377524 Fix mouse-position for xterm-mouse-mode
* lisp/xt-mouse.el (xterm-mouse-position-function): Return the frame
recorded in the terminal parameter xterm-mouse-frame.
2024-10-31 21:20:02 +01:00
Gerd Möllmann
414de92a56 Initial child frames based on master
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.
2024-10-22 06:40:19 +02:00
Stefan Monnier
d0cf9f3601 Merge branch 'mouse-wheel-buttons' 2024-04-09 10:28:05 -04:00
Stefan Monnier
e720ba6219 (mouse-wheel-buttons): Map old-style wheel buttons to actual wheel events
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.
2024-04-09 10:26:07 -04:00
Olaf Rogalsky
abe39d5788 Support 'mouse-autoselect-window' in xterm-mouse
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)
2024-04-06 13:02:52 +03:00
Stefan Monnier
e734f8e502 xt-mouse.el: Obey mouse-wheel-*-event variables (bug#68698)
* 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.
2024-01-28 18:51:11 -05:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
Jared Finder
46fe7a17f5 Fix dragging mode line on text terminals with a mouse (bug#67457)
* 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.
2023-12-09 10:17:05 +02:00
Eli Zaretskii
f8c95d1a76 Fix xt-mouse on terminals that report UTF-8 encoded coordinates
* 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)
2023-01-26 10:54:43 +02:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Stefan Kangas
63f419f133 ; Minor stylistic fixes found by checkdoc 2021-09-16 19:37:07 +02:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Jared Finder
91d5edd9d1 Face-changing text properties and help-echo now work with xterm-mouse.
* 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.
2020-11-14 14:31:55 +02:00
Jared Finder
2c487c47c8 Fix a bug where the wrong menu would be triggered by mouse
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.
2020-10-24 13:26:56 +03:00
Jared Finder
0695c9e859 Make TTY menus work with xterm-mouse-mode
* 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'.
2020-10-24 13:14:27 +03:00
Lars Ingebrigtsen
6d9297abe0 Make xterm-mouse-event check whether the click event is valid
* lisp/xt-mouse.el (xterm-mouse-event): Defensively check against
a situation that shouldn't happen (but does) (bug#17378).
2020-09-20 23:32:45 +02:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Juri Linkov
2698d3dba2 Merge branch 'feature/tabs' 2019-10-01 23:15:03 +03:00
Paul Eggert
946a56a10f Update some URLs
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.
2019-09-23 00:12:52 -07:00
Juri Linkov
7970c89c77 Text-based nox builds compiled without X window support 2019-09-04 22:05:05 +03:00
Juri Linkov
a365251d01 Text-mode display of the tab-bar and emulation of clicking on a tty.
* 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.
2019-09-03 22:55:13 +03:00
Paul Eggert
89c63b3522 New function time-convert
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).
2019-08-05 18:37:29 -07:00
Stefan Monnier
0b4e003766 Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo"
This reverts commit 698ff554ac.
2019-06-26 10:24:59 -04:00
Stefan Monnier
698ff554ac * lisp/calc/calc-ext.el (math-scalarp): Fix typo 2019-06-26 10:03:48 -04:00
Paul Eggert
476066e89d Avoid some double-rounding of Lisp timestamps
Also, simplify some time-related Lisp timestamp code
while we’re in the neighborhood.
* lisp/battery.el (battery-linux-proc-acpi)
(battery-linux-sysfs, battery-upower, battery-bsd-apm):
* lisp/calendar/timeclock.el (timeclock-seconds-to-string)
(timeclock-log, timeclock-last-period)
(timeclock-entry-length, timeclock-entry-list-span)
(timeclock-find-discrep, timeclock-generate-report):
* lisp/cedet/ede/detect.el (ede-detect-qtest):
* lisp/completion.el (cmpl-hours-since-origin):
* lisp/ecomplete.el (ecomplete-decay-1):
* lisp/emacs-lisp/ert.el (ert--results-update-stats-display)
(ert--results-update-stats-display-maybe):
* lisp/emacs-lisp/timer-list.el (list-timers):
* lisp/emacs-lisp/timer.el (timer-until)
(timer-event-handler):
* lisp/erc/erc-backend.el (erc-server-send-ping)
(erc-server-send-queue, erc-handle-parsed-server-response)
(erc-handle-unknown-server-response):
* lisp/erc/erc-track.el (erc-buffer-visible):
* lisp/erc/erc.el (erc-lurker-cleanup, erc-lurker-p)
(erc-cmd-PING, erc-send-current-line):
* lisp/eshell/em-pred.el (eshell-pred-file-time):
* lisp/eshell/em-unix.el (eshell-show-elapsed-time):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event:org-timestamp):
* lisp/gnus/gnus-int.el (gnus-backend-trace):
* lisp/gnus/gnus-sum.el (gnus-user-date):
* lisp/gnus/mail-source.el (mail-source-delete-crash-box):
* lisp/gnus/nnmaildir.el (nnmaildir--scan):
* lisp/ibuf-ext.el (ibuffer-mark-old-buffers):
* lisp/gnus/nnmaildir.el (nnmaildir--scan):
* lisp/mouse.el (mouse--down-1-maybe-follows-link)
(mouse--click-1-maybe-follows-link):
* lisp/mpc.el (mpc--faster-toggle):
* lisp/net/rcirc.el (rcirc-handler-ctcp-KEEPALIVE)
(rcirc-sentinel):
* lisp/net/tramp-cache.el (tramp-get-file-property):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-newer-than-file-p)
(tramp-maybe-open-connection):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection):
* lisp/org/org-clock.el (org-clock-resolve):
(org-resolve-clocks, org-clock-in, org-clock-out, org-clock-sum):
* lisp/org/org-timer.el (org-timer-start)
(org-timer-pause-or-continue, org-timer-seconds):
* lisp/org/org.el (org-evaluate-time-range):
* lisp/org/ox-publish.el (org-publish-cache-ctime-of-src):
* lisp/pixel-scroll.el (pixel-scroll-in-rush-p):
* lisp/play/hanoi.el (hanoi-move-ring):
* lisp/proced.el (proced-format-time):
* lisp/progmodes/cpp.el (cpp-progress-message):
* lisp/progmodes/flymake.el (flymake--handle-report):
* lisp/progmodes/js.el (js--wait-for-matching-output):
* lisp/subr.el (progress-reporter-do-update):
* lisp/term/xterm.el (xterm--read-event-for-query):
* lisp/time.el (display-time-update, emacs-uptime):
* lisp/tooltip.el (tooltip-delay):
* lisp/url/url-cookie.el (url-cookie-parse-file-netscape):
* lisp/url/url-queue.el (url-queue-prune-old-entries):
* lisp/url/url.el (url-retrieve-synchronously):
* lisp/xt-mouse.el (xterm-mouse-event):
Avoid double-rounding of time-related values.  Simplify.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
When hoping for the best (unlikely), use a better decoded time.
(icalendar--convert-sexp-to-ical): Avoid unnecessary encode-time.
* lisp/calendar/timeclock.el (timeclock-when-to-leave):
* lisp/cedet/ede/detect.el (ede-detect-qtest):
* lisp/desktop.el (desktop-create-buffer):
* lisp/emacs-lisp/benchmark.el (benchmark-elapse):
* lisp/gnus/gnus-art.el (article-lapsed-string):
* lisp/gnus/gnus-group.el (gnus-group-timestamp-delta):
* lisp/gnus/nnmail.el (nnmail-expired-article-p):
* lisp/gnus/nnmaildir.el (nnmaildir-request-expire-articles):
* lisp/nxml/rng-maint.el (rng-time-function):
* lisp/org/org-clock.el (org-clock-get-clocked-time)
(org-clock-resolve, org-resolve-clocks, org-resolve-clocks-if-idle):
* lisp/org/org-habit.el (org-habit-insert-consistency-graphs):
* lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info)
(vhdl-fix-case-region-1):
Use time-since instead of open-coding most of it.
* lisp/erc/erc-dcc.el (erc-dcc-get-sentinel):
* lisp/erc/erc.el (erc-string-to-emacs-time, erc-time-gt):
Now obsolete.  All uses changed.
(erc-time-diff): Accept all Lisp time values.
All uses changed.
* lisp/gnus/gnus-demon.el (gnus-demon-idle-since):
* lisp/gnus/gnus-score.el (gnus-score-headers):
* lisp/gnus/nneething.el (nneething-make-head):
* lisp/gnus/nnheader.el (nnheader-message-maybe):
* lisp/gnus/nnimap.el (nnimap-keepalive):
* lisp/image.el (image-animate-timeout):
* lisp/mail/feedmail.el (feedmail-rfc822-date):
* lisp/net/imap.el (imap-wait-for-tag):
* lisp/net/newst-backend.el (newsticker--image-get):
* lisp/net/rcirc.el (rcirc-handler-317, rcirc-handler-333):
* lisp/obsolete/xesam.el (xesam-refresh-entry):
* lisp/org/org-agenda.el (org-agenda-show-clocking-issues)
(org-agenda-check-clock-gap, org-agenda-to-appt):
* lisp/org/org-capture.el (org-capture-set-target-location):
* lisp/org/org-clock.el (org-clock-resolve-clock)
(org-clocktable-steps):
* lisp/org/org-colview.el (org-columns-edit-value)
(org-columns, org-agenda-columns):
* lisp/org/org-duration.el (org-duration-from-minutes):
* lisp/org/org-element.el (org-element-cache-sync-duration)
(org-element-cache-sync-break)
(org-element--cache-interrupt-p, org-element--cache-sync):
* lisp/org/org-habit.el (org-habit-get-faces)
* lisp/org/org-indent.el (org-indent-add-properties):
* lisp/org/org-table.el (org-table-sum):
* lisp/org/org-timer.el (org-timer-show-remaining-time)
(org-timer-set-timer):
* lisp/org/org.el (org-babel-load-file, org-today)
(org-auto-repeat-maybe, org-2ft, org-time-stamp)
(org-read-date-analyze, org-time-stamp-to-now)
(org-small-year-to-year, org-goto-calendar):
* lisp/org/ox.el (org-export-insert-default-template):
* lisp/ses.el (ses--time-check):
* lisp/type-break.el (type-break-time-warning)
(type-break-statistics, type-break-demo-boring):
* lisp/url/url-cache.el (url-cache-expired)
(url-cache-prune-cache):
* lisp/vc/vc-git.el (vc-git-stash-snapshot):
* lisp/erc/erc-match.el (erc-log-matches-come-back):
Simplify.
2019-02-22 18:33:57 -08:00
Paul Eggert
e05ea0ea31 Make xterm-mouse-truncate-wrap obsolete
* 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.
2019-02-12 15:21:11 -08:00
Paul Eggert
ba809612c0 Merge from origin/emacs-26
2fcf2df Fix copyright years by hand
26bed8b Update copyright year to 2019
2814292 Fix value of default frame height.  (Bug#33921)
2018-12-31 17:57:29 -08:00
Paul Eggert
26bed8ba10 Update copyright year to 2019
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
2019-01-01 01:01:13 +00:00
John Shahid
ee3e432300 Optionally add argument description in minor mode DOC (bug#10754)
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.
2018-07-01 23:34:53 -04:00
Paul Eggert
5c7dd8a783 Update copyright year to 2018
Run admin/update-copyright.
2018-01-01 00:57:59 -08:00
Alexander Gramiak
89b0023044 Increase xterm click count only within double-click-fuzz
* lisp/xt-mouse.el (xterm-mouse-event): Save the last click's position
and check it against the current click's position.  (Bug#28658)
2017-10-08 17:20:46 -06:00
Alexander Gramiak
c625fb645a Set xterm click count to 1 even with no last click
* 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)
2017-10-05 13:50:02 +03:00
Paul Eggert
bc511a64f6 Prefer HTTPS to FTP and HTTP in documentation
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.
2017-09-13 15:54:37 -07:00
Paul Eggert
bcf244ef9b Merge from origin/emacs-25
2e2a806 Fix copyright years by hand
5badc81 Update copyright year to 2017
2017-01-01 01:10:47 -08:00
Paul Eggert
5badc81c1c Update copyright year to 2017
Run admin/update-copyright.
2016-12-31 19:42:26 -08:00
Philipp Stephani
f6da597376 ; Revert "Guard terminal par. in XTerm mouse mode"
This reverts commit d4e15492f7.

Since emacs-25 should only contain regression fixes and doc fixes, this
commit was moved to the master branch.
2016-11-28 19:45:55 +01:00
Philipp Stephani
13d468fc07 Guard terminal parameter in XTerm mouse mode
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.
2016-11-28 19:45:03 +01:00