1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-03 14:10:47 -08:00
Commit graph

46264 commits

Author SHA1 Message Date
Mattias Engdegård
14fe0eec0c * src/lisp.h (FOR_EACH_TAIL_INTERNAL): Faster node comparison. 2022-05-11 10:28:07 +02:00
Po Lu
95717db1e8 Fix mouse pointer avoidance in some configurations
* lisp/avoid.el (mouse-avoidance-random-shape): Ignore invisible
pointer.
(mouse-avoidance-ignore-p): Adjust for interprogram DND.
* lisp/term/x-win.el (x-pointer-invisible): Make value larger
than the maximum possible glyph.

* src/xfns.c (x_set_mouse_color): Use function that handles
`x-pointer-invisible' too.
* src/xterm.c (x_create_font_cursor): New function.  Handle
invisible cursors.
* src/xterm.h: Update prototypes.
2022-05-11 16:01:52 +08:00
Po Lu
96be8458b0 Make Haiku event buffer non-static
* src/haikuterm.c (haiku_read_socket): Don't make `buf' static
in case thread yielding happens inside.
2022-05-11 06:59:39 +00:00
Po Lu
70c4b5bdc6 Fix event memory leak on Haiku
* src/haikuterm.c (haiku_read_socket): Allocate event buffer on
the stack.
2022-05-11 06:56:43 +00:00
Po Lu
80951f764b Fix frame invalidation on Haiku
* src/haiku_support.cc (FlipBuffers): Only set view bitmap if it
actually changed.

* src/haikuterm.c (haiku_clip_to_string_exactly)
(haiku_draw_window_cursor, haiku_draw_fringe_bitmap): Fix region
invalidation.
2022-05-11 03:48:36 +00:00
Po Lu
7360813208 Try to preserve font styles in the Haiku font dialog
* haiku_support.cc (class EmacsFontSelectionDialog)
(UpdateStylesForIndex): If a style was previously selected and
exists in the new family as well, select it after adding the new
items.
2022-05-11 02:02:21 +00:00
Po Lu
a78a5b1346 Make reliefs on Haiku more like X
* src/haikuterm.c (haiku_draw_relief_rect): Use frame background
(normal GC) for corners.
2022-05-11 01:21:18 +00:00
Po Lu
a09fc82748 ; * src/window.c (Fset_window_vscroll): Fix doc string. 2022-05-11 09:13:36 +08:00
Po Lu
8baa13ed99 Clean up some MAYBE_UNUSED functions
* src/xterm.c (x_clear_area1): Wrap in the conditions where it
will actually be used.
2022-05-11 09:09:05 +08:00
Paul Eggert
430b5ba838 * src/eval.c (Ffunctionp): Clarify "function" in doc string. 2022-05-10 15:21:57 -07:00
Paul Eggert
4433df3b20 * src/floatfns.c: Update comment. 2022-05-10 14:47:22 -07:00
Po Lu
cfa317fa92 Improve display of relief rectangles on NS
* src/nsterm.m (ns_draw_relief): Respect cursor color and draw
corners like X.
2022-05-10 21:34:44 +08:00
Po Lu
77bf4ca000 Respect `alpha-background' drawing relief corners
* src/xterm.c (x_draw_relief_rect): Respect background alpha for
corner rects.
2022-05-10 21:08:15 +08:00
Eli Zaretskii
68dd94448f ; Fix recent documentation changes
* src/fileio.c (Fdo_auto_save):
* src/buffer.c (Fbuffer_modified_p, Frestore_buffer_modified_p):
* doc/lispref/buffers.texi (Buffer Modification): Improve
documentation of 'do-auto-save', 'buffer-modified-p' and
'restore-buffer-modified-p'.
2022-05-10 16:06:10 +03:00
Po Lu
145727df29 Fix display of depressed buttons
* src/xterm.c (x_draw_relief_rect): Fix typo.
2022-05-10 17:38:53 +08:00
Po Lu
773c5c00d2 Improve relief rect handling on Haiku
* haikuterm.c (haiku_calculate_relief_colors): Calculate
backgrounds for image glyphs like on X.
(haiku_draw_relief_rect): Remove extra parameter.
(haiku_draw_string_box, haiku_draw_image_relief): Adjust
accordingly.
2022-05-10 09:00:39 +00:00
Po Lu
e8d643eb83 Fix X11 relief background clearning when hwidth is larger than vwidth
* src/xterm.c (x_fill_triangle, x_make_point, x_inside_rect_p):
New functions.
(x_draw_relief_rect): Complete rewrite.  Use more sensible
primitives.
2022-05-10 16:50:10 +08:00
Po Lu
c7b48b61d0 Improve display of reliefs on NS
* src/nsfont.m (nsfont_draw): Don't compensate for left box
twice.
* src/nsterm.m (ns_draw_relief): Draw outer edges of box like on
X.
2022-05-10 16:01:00 +08:00
Po Lu
88545428f0 Handle deletion of opacity property too
* src/xterm.c (handle_one_xevent): Clear `alpha' frame parameter
when opacity prop is gone or invalid.
2022-05-10 14:40:26 +08:00
Po Lu
58f6cbeb58 Work around some broken programs when reading opacity prop
* src/xterm.c (handle_one_xevent): Accept some other types that
property is set to by thoughtless programs.
2022-05-10 14:38:53 +08:00
Po Lu
3c5e1f8ec8 Simplify Haiku selection code
* src/haiku_select.cc (get_clipboard_object): New function.
(BClipboard_find_data, BClipboard_get_targets, BClipboard_set_data)
(BClipboard_find_system_data)
(BClipboard_find_primary_selection_data)
(BClipboard_find_secondary_selection_data)
(BClipboard_set_system_data, BClipboard_set_primary_selection_data)
(BClipboard_set_secondary_selection_data, BClipboard_free_data)
(BClipboard_system_targets, BClipboard_primary_targets)
(BClipboard_secondary_targets): Delete functions.
(be_find_clipboard_data_1, be_set_clipboard_data_1)
(be_get_clipboard_targets_1, be_find_clipboard_data)
(be_set_clipboard_data, be_get_clipboard_targets): New
functions.
(be_lock_clipboard_message, be_unlock_clipboard): Use
`get_clipboard_object' to get clipboard from ID.

* src/haikuselect.c (haiku_get_clipboard_name): New function.
(Fhaiku_selection_data, Fhaiku_selection_put)
(Fhaiku_selection_owner_p): Adjust to use new simplified
functions.

* src/haikuselect.h: Update prototypes.
2022-05-10 04:11:48 +00:00
Po Lu
20b27d475f Simplify XDND code
* src/xfns.c (Fx_begin_drag): Use SAFE_ALLOCA_STRING and encode
strings in the right coding system.
2022-05-10 10:39:13 +08:00
Sean Whitton
054062060e Factor out *scratch* initialization
* lisp/simple.el (get-scratch-buffer-create): New function, factored
out of scratch-buffer, and additionally clearing the modification flag
and calling substitute-command-keys (bug#55257).
(scratch-buffer):
* lisp/server.el (server-execute):
* lisp/startup.el (normal-no-mouse-startup-screen, command-line-1):
* lisp/window.el (last-buffer, window-normalize-buffer-to-switch-to):
* src/buffer.c (Fother_buffer, other_buffer_safely): Use it.
(syms_of_buffer): Add Qget_scratch_buffer_create.
* lisp/startup.el (startup--get-buffer-create-scratch): Delete
now-unused function.
* doc/lispref/os.texi (Summary: Sequence of Actions at Startup):
* NEWS (Incompatible changes in Emacs 29.1): Document the change.
2022-05-09 18:49:13 -07:00
Lars Ingebrigtsen
0bee4cda88 Reimplement recent with-silent-modifications auto-save changes
* doc/lispref/buffers.texi (Buffer Modification): Document
buffer-modified-p returning `autosaved'.
* lisp/subr.el (with-silent-modifications): Use
restore-buffer-modified-p instead of altering the buffer modiff
(since this has other side effects like not updating after async
`display' changes.

* src/buffer.c (Fbuffer_modified_p): Allow returning whether the
buffer has been autosaved after changes.
(Frestore_buffer_modified_p): Allow adjusting whether the buffer
has been autosaved after changes.

* src/fileio.c (Fdo_auto_save): Refill the doc string.
2022-05-10 03:46:43 +02:00
Po Lu
b299f17349 Update alpha frame parameter when the window manager changes it
* src/xfns.c (x_set_alpha): New function.  Set
`alpha_identical_p' flag.
(x_frame_parm_handlers): Use it to handle `alpha' instead.

* src/xterm.c (x_set_frame_alpha): Make tests against current
alpha safer.
(handle_one_xevent): Set frame alpha when alpha property
changes.
* src/xterm.h (struct x_output): New flag `alpha_identical_p'.
2022-05-10 09:32:59 +08:00
Po Lu
b7167ba8d1 ; * src/xdisp.c (mark_window_display_accurate_1): Clear vscroll flag. 2022-05-10 08:48:36 +08:00
Po Lu
f54a71fa27 * src/haikuterm.c (haiku_draw_fringe_bitmap): Set stipple flag. 2022-05-09 12:48:13 +00:00
Po Lu
3eb82181fc Fix scroll optimizations being enabled for some rows with stipples
* src/dispnew.c (update_text_area): New parameter `partial_p'.
Set it if not enough glyphs were drawn to determine if a row
doesn't have a stipple.
(update_window_line): Preserve current_row->stipple_p in that
case, after making the desired row current.

* src/xterm.c (x_draw_fringe_bitmap): Set row->stipple.
2022-05-09 20:23:40 +08:00
Po Lu
e195ac3df0 ; * src/haikuterm.c (haiku_draw_underwave): Fix default scale. 2022-05-09 11:21:15 +00:00
Po Lu
5921e31c45 Respect display scale factor drawing underwaves on Haiku
* src/haikuterm.c (haiku_get_scale_factor): New function.
(haiku_draw_underwave): Apply said factor.
2022-05-09 11:10:44 +00:00
Po Lu
52a27a67c1 Fix file-based launching on Haiku
* src/haikuselect.c (Fhaiku_roster_launch): Canonicalize file
names before using them.
2022-05-09 08:22:03 +00:00
Po Lu
09866bb019 Use default external browser by default on Haiku
* lisp/net/browse-url.el (browse-url-default-browser): Use that
by default on Haiku.
(browse-url-default-haiku-browser): New function.
* src/haiku_support.cc (be_roster_launch):
* src/haiku_support.h: New function.  Update prototypes.
* src/haikuselect.c (haiku_message_to_lisp): Encode and decode
files correctly.
(haiku_lisp_to_message): Encode and decode files correctly.
(Fhaiku_roster_launch): New function.
(syms_of_haikuselect): Update defsubrs.
2022-05-09 07:55:16 +00:00
Po Lu
d8a4782310 Fix stipple bitmap caching on Haiku
* src/image.c (image_create_bitmap_from_file): Set file name on
the bitmap rec on Haiku.
2022-05-09 02:52:16 +00:00
Po Lu
6ec29d0566 Allow disabling Motif drag protocol
* lisp/cus-start.el (standard): Add new variable.
* src/xterm.c (x_dnd_update_state, handle_one_xevent): Respect
new variable.
(syms_of_xterm): New variable `x-dnd-disable-motif-drag'.
2022-05-09 10:13:43 +08:00
Po Lu
fd8eaa72a6 Allow precision-scrolling nonselected windows when the minibuffer is resized
* doc/lispref/windows.texi (Vertical Scrolling): Document new
`preserve-vscroll-p' parameter of `set-window-vscroll'.
* etc/NEWS: Announce new parameter.

* lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page)
(pixel-scroll-precision-scroll-up-page): Use that parameter when
setting the vscroll.

* src/window.c (window_scroll_pixel_based, Fset_window_vscroll):
Adjust for new parameter.
* src/window.h (struct window): New flag `preserve_vscroll_p'.

* src/xdisp.c (redisplay_window): Preserve the vscroll inside
force_start on frozen windows with that flag set.  (bug#55312)
2022-05-09 09:37:58 +08:00
Po Lu
3d846efb85 Fix race conditions in handling of unsupported drops on X
* lisp/x-dnd.el (x-dnd-handle-unsupported-drop): Adjust for new
parameters.

* src/keyboard.c (kbd_buffer, kbd_fetch_ptr, kbd_store_ptr):
Export variables.
(kbd_buffer_get_event): Ignore already handled unsupported
drops.
* src/keyboard.h: Update prototypes.

* src/termhooks.h (enum event_kind): Document meaning of
`modifiers' in UNSUPPORTED_DROP_EVENTs.

* src/xterm.c (x_dnd_send_unsupported_drop): Set event modifiers
to current level.
(x_toggle_visible_pointer): Fix fixes fallback.
(x_dnd_begin_drag_and_drop): Handle UNSUPPORTED_DROP_EVENTs
already in the keyboard buffer before starting DND.
(syms_of_xterm): Give timestamp to unsupported drop function.

* src/xterm.h: Update prototypes.
2022-05-09 09:17:28 +08:00
Lars Ingebrigtsen
7546179a01 Don't hang on trying to rename FIFOs between file systems
* src/fileio.c (Frename_file): Don't hang on trying to move FIFOs
(bug#34069).
2022-05-08 16:13:04 +02:00
Po Lu
d6e316db72 Fix display of fringes with stipples on X
* src/xterm.c (x_draw_fringe_bitmap): Set fill style and use
fill function correctly.
2022-05-08 21:28:28 +08:00
Po Lu
4d8527e580 Fix display of fringes with stipples on Haiku
* haikuterm.c (haiku_after_update_window_line): Fix coding
style.
(haiku_draw_fringe_bitmap): Handle display of stipples if
present.
2022-05-08 13:22:03 +00:00
Po Lu
c7bd76a3f0 Set stipple flag on PGTK as well
* pgtkterm.c (pgtk_draw_glyph_string_background):
(pgtk_draw_glyph_string): Set stipple flag on string row.
(pgtk_draw_fringe_bitmap):
(pgtk_defined_color): Fix coding style.
2022-05-08 21:10:45 +08:00
Po Lu
4b20ae908b Set stipple flags on Haiku as well
* src/haikuterm.c (haiku_draw_glyph_string): Set stipple flag
where stipples are actually drawn.  (This is different from X.)
2022-05-08 13:02:00 +00:00
Po Lu
2f1410562e Disable scrolling optimizations when a stipple is present
* src/dispextern.h (struct glyph_row): New field `stippled_p'.
We cannot just use the contents of the glyph row, since it has
to be set in `gui_clear_end_of_line' and is more convenient to
set inside the various draw_glyph_string functions.

* src/dispnew.c (scrolling_window): Disable if a row in the
current matrix has the stipple_p flag set.

* src/xdisp.c (gui_clear_end_of_line):
* src/xterm.c (x_draw_image_glyph_string)
(x_draw_stretch_glyph_string, x_draw_glyph_string): Set
`stipple_p' if a stipple pattern was drawn.
2022-05-08 20:48:42 +08:00
Po Lu
461ac0815c Fix crashes on ordinary menus on macOS
* src/nsmenu.m ([EmacsMenu runMenuAt:forFrame:keymaps:]): Fix
coding style.
([EmacsMenu menu:willHighlightItem:]): Ignore if this is a
context menu.
2022-05-08 19:14:57 +08:00
Po Lu
be60e9e947 Fix bug in `pixel-scroll-precision-mode' on nonselected windows
* src/window.c (Fset_window_vscroll): Mark window for redisplay.
(bug#55299)
2022-05-08 19:02:53 +08:00
Po Lu
1a988d9ff5 Improve handling of invisible cursor alloc failures
* src/xterm.c (x_toggle_visible_pointer): Use Xfixes if cursor
allocation really fails.  This happens when the X server has a
limit on the number of cursors that can be created.
2022-05-08 14:33:34 +08:00
Po Lu
144e9f9b6a Fix file-based stipple on NS
* src/image.c (image_create_bitmap_from_file) [HAVE_NS]: Fix
loading XBM data from file.
2022-05-08 14:28:41 +08:00
Eli Zaretskii
a85e30516e Fix selection dialog display on MS-Windows
* src/w32fns.c (w32_wnd_proc) <WM_PAINT>: Update the frame from
the back buffer when double-buffering is in effect and a selection
dialog is open.
(w32_dialog_in_progress): Indicate to 'w32_wnd_proc' that a
selection dialog is open.  (Bug#55208)
2022-05-08 09:24:29 +03:00
Po Lu
48c422e255 Fix display of hollow box cursor on NS
* src/nsterm.m (ns_draw_window_cursor): Fix verbatim
translations from X.
2022-05-08 13:44:28 +08:00
Po Lu
5eeca488b9 Implement stipples for stretch glyphs
* src/haikuterm.c (haiku_draw_stipple_background): Accept new
arguments for specifying the color explicitly.  All callers
changed.
(haiku_draw_stretch_glyph_string): Draw stipple correctly.
(haiku_draw_glyph_string): Handle stipple correctly when drawing
neighbors.
2022-05-08 05:09:24 +00:00
Po Lu
b205d67f8c Fully implement stipples for text on Haiku
* src/haikufont.c (haikufont_draw): Use
`haiku_draw_background_rect' instead.

* src/haikuterm.c (haiku_draw_plain_background): Change
arguments to accept rect manually.
(haiku_get_bitmap): Delete function.
(haiku_get_bitmap_rec): New function.
(haiku_draw_stipple_background): Accept rect instead of box
sizes.
(haiku_draw_background_rect): New function.
(haiku_maybe_draw_background): Use that instead.
(haiku_draw_image_glyph_string): Add notice.
(haiku_draw_glyph_string): Set `stippled_p' correctly.

* src/haikuterm.h (struct haiku_bitmap_record): New fields for
keeping track of stipple state.
* src/image.c (image_create_bitmap_from_data)
(image_create_bitmap_from_file, free_bitmap_record): Free and
set them accordingly.
2022-05-08 04:42:11 +00:00