1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-31 11:10:51 -07:00
Commit graph

47962 commits

Author SHA1 Message Date
Robert Pluim
fc1b7b720b Teach 'network-lookup-address-info' to validate numeric addresses
* src/process.c (Fnetwork_lookup_address_info): Add optional 'hints'
argument, pass AI_NUMERICHOST to 'getaddrinfo' if it's 'numeric'.
(syms_of_process): Add 'numeric' symbol.
* doc/lispref/processes.texi (Misc Network): Expunge passive voice.
Update 'network-lookup-address-info' description.
* test/src/process-tests.el (lookup-hints-specification):
(lookup-hints-values): Test new functionality.
* etc/NEWS: Announce change.
2022-07-26 14:16:07 +02:00
Po Lu
a03d7630f1 Fix flicker when moving tooltips between frames during mouse drag-and-drop
* src/haikufns.c (Fx_show_tip):
* src/nsfns.m (Fx_show_tip): Allow sharing existing tooltip
frames between any two frames.
* src/xfns.c (Fx_show_tip): Allow that but only between frames
on the same X display.
2022-07-26 16:12:06 +08:00
Po Lu
2bc6d82831 Handle modifiers during Haiku DND wheel movement
* lisp/term/haiku-win.el (haiku-dnd-modifier-mask)
(haiku-dnd-wheel-modifier-type): New functions.
(haiku-handle-drag-wheel): Use them.
* lisp/x-dnd.el (x-dnd-modifier-mask): Remove outdated comment.
* src/haikuselect.c (haiku_note_drag_wheel): Pass modifiers to
wheel function.
(syms_of_haikuselect): Update doc strings.
2022-07-26 05:42:42 +00:00
Stefan Kangas
f6040018c5 Merge from origin/emacs-28
970190b844 Avoid infloop in 'recenter'
a866674b2a Fix inaccuracies in "lax search" documentation
2022-07-26 06:30:19 +02:00
Po Lu
06cec5ee0b Remove some redundant checks in the DND code
* src/xterm.c (handle_one_xevent): Don't check tab_bar_p or
tool_bar_p before clearing last items during drag-and-drop.
2022-07-26 10:29:16 +08:00
Gregory Heytings
cd41ce8c6c Improvement for long lines in buffers with font locking.
* src/xdisp.c (get_narrowed_width): Factored out from 'get_narrowed_len'.
(get_narrowed_len): Updated to use 'get_narrowed_width'.
(get_closer_narrowed_begv): New function.
(SET_WITH_NARROWED_BEGV): Add parameter to the macro.
(back_to_previous_line_start): Use the new function.
(get_visually_first_element, move_it_vertically_backward): Update the
calls to the macro.

* src/dispextern.h: Prototype of 'get_closer_narrowed_begv'.
Fix the prototypes of 'get_narrowed_begv' and 'get_narrowed_zv'.
2022-07-25 22:31:00 +02:00
Eli Zaretskii
970190b844 Avoid infloop in 'recenter'
* src/window.c (Frecenter): Avoid infinite loop in the minibuffer
under 'fido-vertical-mode'.  (Bug#56765)
2022-07-25 21:59:55 +03:00
Po Lu
bc3e9f4f6d Fix mouse face handling during frame reentry on Haiku
* src/haikuterm.c (haiku_read_socket): Clear
last_mouse_glyph_frame like on X.
2022-07-25 09:39:26 +00:00
Po Lu
3c23ae13f0 Fix mouse face handling with tooltips
* src/xterm.c (handle_one_xevent): Clear last_mouse_motion_frame
and last_mouse_glyph_frame on LeaveNotify.  Otherwise, mouse
face will be restored by gui_redo_mouse_highlight and will not
be restored if an EnterNotify is later sent on top of the same
glyph.
2022-07-25 10:07:30 +08:00
Po Lu
b1f14e94ad ; Rename misnamed function in xterm.c
* src/xterm.c (x_init_master_valuators): Rename to
`x_cache_xi_devices'.  Update comment accordingly.  All callers
changed.
2022-07-25 09:23:15 +08:00
Po Lu
235045f712 Prevent exposing tooltip frames to Lisp code during drag-and-drop
* src/xterm.c (x_dnd_compute_toplevels): Ignore tooltip frames.
(x_tooltip_window_to_frame): Allow unrelated_tooltip_p to be
NULL.
(handle_one_xevent): Ignore DND events to tooltip frames.
2022-07-24 10:42:02 +08:00
Eli Zaretskii
280b8c96cc Improve display of columns on mode-line
* src/xdisp.c (decode_mode_spec): A better representation for
"unknown column number".
2022-07-23 19:27:30 +03:00
Eli Zaretskii
57a978fd74 Optimize 'set_vertical_scroll_bar' for long lines
* src/xdisp.c (set_vertical_scroll_bar): Don't bother
being accurate about window_end_pos if long-line shortcuts
are in effect in the current buffer.
2022-07-23 18:57:06 +03:00
Eli Zaretskii
fc53961c1d Avoid calling 'current_column' in buffers with long lines.
* src/xdisp.c (decode_mode_spec, redisplay_window)
(mode_line_update_needed):
* src/indent.c (Fcurrent_column): In a buffer with long-line
optimizations enabled, avoid calling 'current_column', which is
very slow in that case.
2022-07-23 17:43:40 +03:00
Basil L. Contovounesios
26f4bcc6d7 Update pdumper.c after recent long lines changes
For discussion, see:
https://lists.gnu.org/r/emacs-devel/2022-07/msg00761.html

* src/pdumper.c (dump_buffer): Dump new field
long_line_optimizations_p introduced in commit e7b5912b23 of
2022-07-16 "Improvements to long lines handling."
(dump_buffer) [CHECK_STRUCTS]: Update hash accordingly
for --enable-checking=structs.
2022-07-23 16:33:09 +03:00
Eli Zaretskii
350e97d78e Speed up redisplay of long truncated lines
* src/xdisp.c (forward_to_next_line_start): Fix logic of
interpreting the result of Fnext_single_property_change.
(reseat_at_next_visible_line_start): When ON_NEWLINE_P is zero,
pass NULL to 'forward_to_next_line_start', to avoid costly bidi
iteration when none is needed.  This speeds up redisplay of very
long lines under 'truncate-lines'.
2022-07-23 16:13:32 +03:00
Mattias Engdegård
aa28829eb7 Correct symbol in error for failed CHECK_INTEGER (bug#56723)
Reported by Jeronimo Pellegrini.

* src/lisp.h (CHECK_INTEGER): Use integerp, not numberp.
2022-07-23 14:55:54 +02:00
Po Lu
49d16a7eb4 Undo C parts of "Don't use the Gtk region face"
This reverts commit a24f710395, apart
from the change to faces.el and NEWS.
2022-07-23 17:03:04 +08:00
Lars Ingebrigtsen
a24f710395 Don't use the Gtk region face
* lisp/faces.el (region): Don't use the Gtk region face, because
it produces low contrast combinations (bug#46493).
* src/gtkutil.h:
* src/gtkutil.c (xg_check_special_colors): Remove.

* src/xfns.c (x_defined_color):
* src/pgtkterm.c (pgtk_defined_color): Don't call.
2022-07-23 10:52:30 +02:00
Po Lu
792734a6e2 Improve efficiency of DND tooltip movement
* src/xterm.c (x_dnd_begin_drag_and_drop): Clear new flag.
(x_dnd_update_tooltip_position): Save last tooltip X and Y
somewhere, so we don't move it upon client lists being updated.
2022-07-23 09:35:20 +08:00
Stefan Kangas
df508ffd2b Merge from origin/emacs-28
ae1ace1cf4 Adjust help-fns.el tests for recent change
04bdcf4aaa * src/terminal.c (Fframe_terminal): Use active voice
7fa491a9e9 Improve 'terminal-live-p' docstring some more
b9ac8c29ae Improve terminal-live-p docstring
0b4c81a152 * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-vector): F...
8f8373170f * lisp/progmodes/cperl-mode.el: Don't mention obsolete arc...
25bc330a6d Make 'describe-function' say "byte-compiled" when appropriate
2b31e667be ;Improve documentation of locale-specific string comparison
2022-07-23 01:37:59 +02:00
Eli Zaretskii
304e2a3a05 Avoid assertion violations in 'handle_fontified_prop'
* src/xdisp.c (handle_fontified_prop): Avoid assertion violations
due to automatic narrowing.  (Bug#56682)
2022-07-22 22:22:08 +03:00
Robert Pluim
1767f796b0 ; * src/xdisp.c (set_vertical_scroll_bar): Fix typo 2022-07-22 16:20:36 +02:00
Eli Zaretskii
12a3137cd3 Fix display of scroll-bar in mini-windows
* src/xdisp.c (set_vertical_scroll_bar): Ensure current_buffer is
set correctly when displaying scroll bar of a mini-window.
(Bug#56692)
2022-07-22 16:15:38 +03:00
Robert Pluim
04bdcf4aaa * src/terminal.c (Fframe_terminal): Use active voice 2022-07-22 14:19:04 +02:00
Robert Pluim
7fa491a9e9 Improve 'terminal-live-p' docstring some more
* terminal.c (Fterminal_live_p): Improve description of arguments and
return value.
2022-07-22 14:10:10 +02:00
Po Lu
82116a5ea3 Fix bug#56692 questionably
* src/xdisp.c (set_vertical_scroll_bar): Don't recompute window
end of a mini window.  (bug#56692)
2022-07-22 19:54:57 +08:00
Gregory Heytings
874e252503 Improve font locking in buffers with long lines (bug#56682).
* src/dispextern.h (struct it): New 'narrowed_zv' field.

* src/xdisp.c (init_iterator): Set the field.
(get_narrowed_zv): New function to set the field.
(handle_fontified_prop): Use the field, together with 'narrowed_begv',
to narrow the portion of the buffer that 'Vfontification_functions'
will see.  Also bind 'inhibit-widen'.
(get_narrowed_len): New function, factored out of 'get_narrowed_begv'.
(unwind_narrowed_zv): New function.

* src/editfns.c (syms_of_editfns): New variable and symbol 'inhibit-widen'.
(Fwiden): Do nothing when 'inhibit-widen' is non-nil.
2022-07-22 12:06:31 +02:00
Robert Pluim
b9ac8c29ae Improve terminal-live-p docstring
* src/terminal.c (Fterminal_live_p): Explain what happens when the
argument is nil.
2022-07-22 10:14:45 +02:00
Po Lu
f173028d15 Fix handling hscroll during drag-and-drop
* lisp/x-dnd.el (x-dnd-hscroll-flags): Delete function.
(x-dnd-get-modifiers, x-dnd-wheel-modifier-type): New functions.
(x-dnd-mwheel-scroll): Use that to determine hscroll instead.
* src/window.c (set_window_hscroll): Mark window as needing
redisplay if the hscroll really changed.
2022-07-22 15:37:28 +08:00
Po Lu
83c2c36d35 Fix posn-timestamp of scroll bar events on GTK
* src/xterm.c (x_get_last_toolkit_time): New function.
(x_scroll_bar_to_input_event)
(x_horizontal_scroll_bar_to_input_event): Use it to retrieve
toolkit time.
(xg_scroll_callback, xg_end_scroll_callback): Set last user time
if possible.
2022-07-22 09:38:32 +08:00
Eli Zaretskii
72278f21e0 ; Clarify doc string of 'long-line-threshold'
* src/buffer.c (syms_of_buffer) <long-line-threshold>: Clarify the
doc string.
2022-07-21 15:59:50 +03:00
Gregory Heytings
616da8fa8e Merge branch 'feature/fix-the-long-lines-display-bug' 2022-07-21 12:37:45 +02:00
Eli Zaretskii
51f8e86374 Update buffer's chars-modified tick when inserting from gap
* src/insdel.c (insert_from_gap): Update buffer's chars-modified
tick.  (Bug#56393)

* test/src/buffer-tests.el (test-buffer-chars-modified-ticks): New
test.
2022-07-21 12:40:28 +03:00
Po Lu
a29a3ad55d Apply tooltip assertions to all instances of x-show-tip
* src/haikufns.c (Fx_show_tip):
(syms_of_haikufns):
* src/nsfns.m (Fx_show_tip):
(syms_of_nsfns):
* src/pgtkfns.c (Fx_show_tip):
(syms_of_pgtkfns):
* src/xfns.c (Fx_show_tip):
(syms_of_xfns): Add assertion and adjust default values.
2022-07-21 16:26:50 +08:00
Eli Zaretskii
46052d1dcb Make sure we don't unknowingly truncate tooltip text
* src/w32fns.c (Fx_show_tip): Add assertion when the default
tooltip dimension limits are insufficient.  (Bug#56561)
2022-07-21 10:12:03 +03:00
Po Lu
50ff15bb8a Avoid wasting bandwidth to set user time
* src/xterm.c (x_display_set_last_user_time): Don't change the
user time property if nothing actually changed.
2022-07-21 14:55:19 +08:00
Po Lu
a641f55559 Improve handling screen resizes when built without RandR
* src/xterm.c (handle_one_xevent): Update DND tooltip position
upon ConfigureNotify for root window.
2022-07-21 09:39:24 +08:00
Gregory Heytings
e09c056a44 * src/xdisp.c (redisplay_window): Small optimization. 2022-07-20 21:54:39 +02:00
Eli Zaretskii
cec248ec31 ; * src/data.c (Fash): Improve wording of the doc string. 2022-07-20 22:03:45 +03:00
Gregory Heytings
c7eef61eee Further tweaks to long lines handling.
* src/xdisp.c (redisplay_window): Increase the threshold above which
long lines detection is performed in the buffer.  This should avoid
triggering that detection for most simple editing operations.

* src/lisp.h (modiff_incr): Explain why the counter is incremented
logarithmically.

* src/buffer.h (struct buffer_text): Adapt the comment about the
'modiff' field accordingly.

* src/buffer.c (modify_overlay): Increase the counter by 1 instead of
the size of the buffer section on which the overlay is placed.

* etc/NEWS: Small improvement.
2022-07-20 19:14:41 +02:00
Po Lu
83753d05eb Implement wheel movement during DND on Haiku
* lisp/term/haiku-win.el (haiku-dnd-wheel-count): New defvar.
(haiku-note-wheel-click, haiku-handle-drag-wheel): New
functions.

* src/haiku_support.cc (EmacsWindow): Get rid of window ID
logic.
(MessageReceived, MouseMoved, be_drag_message): Use thread ID to
identify windows instead of window ID.

* src/haikuselect.c (Fhaiku_drag_message): Record whether or not
the DND frame is a valid drop target.
(haiku_note_drag_wheel): New function.
(syms_of_haikuselect): New defvar.

* src/haikuterm.c (haiku_read_socket): Call
`haiku_note_drag_wheel' when appropriate.
* src/haikuterm.h: Update prototypes.
2022-07-20 07:37:41 +00:00
Po Lu
ffd38a9911 Fix setting user time upon scrolling self during DND
* src/xterm.c (handle_one_xevent): Set user time for emulated
scroll wheel events if Emacs ends up scrolled during DND.
2022-07-20 09:41:43 +08:00
Gregory Heytings
7c0fc85364 Simplified and improved heuristic for long lines detection.
* src/lisp.h (modiff_incr): Add a parameter to 'modiff_incr' to record
the extent of the modification.

* src/insdel.c (insert_1_both, insert_from_string_1, insert_from_gap,
insert_from_buffer_1, adjust_after_replace, replace_range,
replace_range_2, del_range_2, modify_text): Add an argument to each
call to 'modiff_incr'.

* src/textprop.c (modify_text_properties): Add an argument to the call
to 'modiff_incr'.

* src/buffer.c (Frestore_buffer_modified_p, Fbuffer_swap_text,
modify_overlay): Add an argument to each call to 'modiff_incr'.

* src/xdisp.c (redisplay_window): Use the improved version of 'MODIFF'
for the heuristic.
2022-07-19 23:34:09 +02:00
Gregory Heytings
c6bee17075 Revert commits 1ff69cc744 and 9a894206f6. 2022-07-19 23:30:17 +02:00
Gregory Heytings
9a894206f6 Improve the heuristic for long lines detection again.
* src/xdisp.c (redisplay_window): Improve the heuristic again.
2022-07-19 15:35:14 +02:00
Mattias Engdegård
ac1d15e95c ; * src/data.c (Fash): More precise doc string 2022-07-19 15:21:56 +02:00
Gerd Moellmann
f02944f5a1 Prevent GC of window referenced from EmacsScroller
* src/nsterm.m (EmacsScroller.mark, mark_nsterm): New functions.
* src/nsterm.h (EmacsScroller.mark, mark_nsterm): Declare.
* src/alloc.c (garbage_collect) [MAVE_NS]: Call mark_nsterm.
(Bug#56095)

(cherry picked from commit 5f1bd87247)
2022-07-19 16:04:13 +03:00
Stefan Kangas
4b807380cf Merge from origin/emacs-28
282dde887d ; Fix typo missed in previous change
62c47ffd5f ; * lisp/net/tramp-crypt.el: Improve commentary
cba30431ff Merge branch 'emacs-28' of git.savannah.gnu.org:/srv/git/e...
8f9993bb3f ; * src/buffer.c (syms_of_buffer) <mode-line-format>: Doc ...
fec4bb89f9 ; Fix typos (Bug#56550)
2022-07-19 06:30:56 +02:00
Po Lu
6692df0279 Fix timestamp specified in wheel movement XDND events
* src/xterm.c (handle_one_xevent): Use the time of the wheel
event in XDND events sent in response to wheel movement.
2022-07-19 09:41:36 +08:00