1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 07:41:28 -08:00
Commit graph

45332 commits

Author SHA1 Message Date
Eli Zaretskii
dcc97fec29 Allow ensuring that a window's starting point is never invisible
* src/xdisp.c (syms_of_xdisp) <make-window-start-visible>: New
buffer-local variable.
(redisplay_window): If 'make-window-start-visible' is non-nil,
don't accept window-start position that is in invisible text or is
covered by a "replacing" 'display' property.  (Bug#14582)
2022-02-03 19:36:43 +02:00
Eli Zaretskii
abd59ad923 Fix "Buffers->Frames" submenu in daemon sessions
* lisp/menu-bar.el (menu-bar-update-buffers): Detect the initial
frame by its special terminal's name.  (Bug#53740)

* src/terminal.c (init_initial_terminal): Add comment about using
the initial-terminal's name in menu-bar.el.
2022-02-03 13:00:47 +02:00
Po Lu
9b0cdf461c * src/haikufont.c (haikufont_draw): Allocate string buffer on stack. 2022-02-03 10:34:50 +00:00
Po Lu
d35c4ee10a Stop creating cairo contexts in haiku_begin_cr_clip
* src/haikufont.c (haikufont_draw):
* src/ftcrfont.c (ftcrfont_draw): Stop holding the draw lock.
* src/haiku_support.cc (class EmacsView): New field
`cairo_context'.
(DetachCairoSurface): Destroy cairo_context.
(AttachCairoSurface): Create cairo_context from the surface.
(EmacsView_cairo_surface): Delete function.
(EmacsView_cairo_context): New function.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_begin_cr_clip):
(haiku_end_cr_clip): Retrieve the existing cairo context instead
of creating a new one.
* src/haikuterm.h (FRAME_CR_CONTEXT): New macro.
2022-02-03 07:50:36 +00:00
Po Lu
fc79118f19 Obtain draw lock outside haiku_start_clip
* src/haikuterm.c (haiku_start_clip):
(haiku_end_clip): Stop obtaining the draw lock.
(haiku_draw_glyph_string): Set draw lock here instead.
2022-02-03 07:16:10 +00:00
Po Lu
3d7f17bf80 * src/haikuterm.c (haiku_draw_text_decoration): Don't lock for draws. 2022-02-03 05:21:33 +00:00
Po Lu
abdb198474 Simplify box display code on Haiku
* src/haikuterm.c (haiku_calculate_relief_colors): Remove
`rgbout_c' parameter.
(haiku_draw_relief_rect): Push state if performing additional
clipping.
(haiku_draw_string_box): Stop passing clip rects to the relief
drawing functions.
(haiku_draw_glyph_string): Fix calls to haiku_draw_string_box
for new parameters.
2022-02-03 05:16:35 +00:00
Po Lu
11ee58de9d Fix display of text decorations with defaulted foreground on Haiku
* src/haikuterm.c (haiku_draw_text_decoration): Remove parameter
`dcol' and use face->foreground instead.  All callers changed.
2022-02-03 01:57:00 +00:00
Po Lu
60fe17c958 Fix background daemon on Haiku
* src/emacs.c (DAEMON_MUST_EXEC): Define when using the Haiku
application kit.
2022-02-03 01:47:29 +00:00
Alan Mackenzie
aa795a6223 New file lisp/emacs-lisp/debug-early.el for backtraces in early bootstrap
This is also used in batch mode in general.

* lisp/debug-early.el (debug-early-backtrace, debug-early): New functions.

* lisp/loadup.el (top level): Load debug-early.el as first file.

* src/eval.c (signal_or_quit): Remove the condition in the batch mode section
of not being in dumping or bootstrap, since it is no longer needed.  Test that
'debug-early's symbol-function is bound.  Ensure there is enough working space
in specpdl and eval_depth.
(syms_of_eval): New DEFSYM for Qdebug_early.  Initialise Vdebugger to
Qdebug_early rather than Qnil.
2022-02-02 20:35:39 +00:00
Po Lu
70a184b141 Improve correctness of generated xwidget events
* src/xwidget.c (xw_maybe_synthesize_crossing): Add new
parameters for controlling the crossing mode.  Also improve the
accuracy of generated crossing events when the mouse pointer
moves outside the toplevel from an inferior of it.  All callers
changed.
(xw_notify_virtual_upwards_until):
(xw_notify_virtual_downwards_until): New parameters for crossing
mode.  All callers changed.
2022-02-02 19:05:54 +08:00
Po Lu
fded822c80 Send button events before setting xwidget passive grab
* src/xwidget.c (xwidget_button_1): Send button event before
any grab processing.
2022-02-02 15:33:48 +08:00
Po Lu
e7047b4aba * src/nsselect.m (ns_get_foreign_selection): Fix GCC warning. 2022-02-02 15:19:52 +08:00
Po Lu
e3e0deb86d Make behaviour of `mouse-autoselect-window' consistent with X on NS
* src/nsterm.m ([EmacsView mouseMoved:]): Ignore if
`selected_window' is a minibuffer window.
2022-02-02 15:19:52 +08:00
Po Lu
d4c2f5b524 Improve behaviour of `mouse-autoselect-window' on Haiku
* src/haikuterm.c (haiku_read_socket): Don't select windows if
the selected window is a minibuffer window or a popup is
activated.
2022-02-02 04:56:55 +00:00
Po Lu
6869679be5 Fix display of vertical window dividers on Haiku
* src/haikuterm.c (haiku_draw_window_divider): Make drawing
consistent with X.
2022-02-02 02:25:00 +00:00
Po Lu
f1f0608fd1 Don't use XRender to fill rectangles unless an alpha channel exists
* src/xterm.c (x_clear_area): Don't use XRender unless
`alpha_bits' is set.
2022-02-02 09:17:31 +08:00
Mattias Engdegård
4af491605c ; * src/eval.c (funcall_subr): Fix last change 2022-02-01 20:45:36 +01:00
Andrea Corallo
02054d9cd1 * Improve 'maybe_defer_native_compilation'
* src/comp.c (maybe_defer_native_compilation): Always store the
function name in Vcomp_deferred_pending_h if pending for deferred
compilation.
2022-02-01 18:05:51 +01:00
Mattias Engdegård
a20f2b0ff9 Speed up calls to C primitives
* src/eval.c (funcall_subr): Test most likely cases first (conforming
calls to finite-arity or n-adic SUBRs), and the error cases last,
instead of doing it the other way around.  Simplify.
2022-02-01 17:37:05 +01:00
Po Lu
2b9c648de6 * src/pgtkterm.c (pgtk_draw_rectangle): Fix trivial typo. (bug#53677) 2022-02-01 20:15:37 +08:00
Andrea Corallo
e7fd6fe7ec Rename comp--loadable' into comp--compilable'
* lisp/startup.el (comp--compilable): Rename from `comp--loadable'.
(startup--require-comp-safely): Update accordingly.
(startup--honor-delayed-native-compilations): Likewise.
* src/comp.c (syms_of_comp): Update.
(maybe_defer_native_compilation): Likewise.
2022-02-01 11:30:17 +01:00
Stefan Kangas
30ebb54410 Merge from origin/emacs-28
31ef751f94 Clarify documentation of a "face's font"
29bdedf12f Bind Qdebugger to Qdebug in signal_or_quit.
2022-02-01 06:57:16 +01:00
Po Lu
558c4dafa3 Clean up Haiku display structures
* src/haikufns.c (haiku_set_parent_frame): Set `parent_desc'
correctly.

* src/haikuterm.h (C_FRAME, C_FONT, C_TERMINAL):
(struct haiku_display_info):
(struct haiku_output): Get rid of C_* preprocessor defines,
since these files are no longer included in any way by C++ files.
2022-02-01 05:39:28 +00:00
Po Lu
103ddfe387 Display images with a mask correctly when `alpha-background' is set
* src/xterm.c (x_query_frame_background_color): Return value
adjusted for background alpha.
(x_draw_image_glyph_string): Respect `alpha-background' when
generating background pixmap.
2022-02-01 12:58:00 +08:00
Po Lu
d6d73224a2 Make fringe bitmaps respect alpha-background
* src/xterm.c (x_draw_fringe_bitmap): Respect alpha-background
on non-overlay fringe bitmaps.
* src/xterm.h (struct x_display_info): New field `alpha_mask'.
2022-02-01 09:38:26 +08:00
Eli Zaretskii
31ef751f94 Clarify documentation of a "face's font"
* doc/lispref/display.texi (Attribute Functions)
(Face Attributes): Clarify that the :font attribute of a face and
the font returned by 'face-font' are by default for ASCII
characters.  (Bug#53664)
2022-01-31 19:29:54 +02:00
Alan Mackenzie
29bdedf12f Bind Qdebugger to Qdebug in signal_or_quit.
* src/eval.c (signal_or_quit): Bind the correct variable, Qdebugger (not
Vdebugger) to Qdebug in the section for errors in batch jobs.
(syms_of_eval): New DEFSYM for Qdebugger.
2022-01-31 17:20:45 +00:00
Stefan Monnier
1d1b664fbb (function-history): New symbol property (bug#53632)
Rework the code we have in Fdefalias that tries to keep track
of definitions so as to be able to undo them later.

We used to store in `load-history` when an autoload is redefined as
a non-autoload and in the `autoload` symbol property we used to store
the autoload data that used to be used before it got overriden.

Instead, store the history of the function definition of
a symbol in its `function-history` symbol property.
To make this list cheap in the default case, the latest value is not stored
in the list (since it's in the `symbol-function`) and neither is the first
file.  So if there's only been a single definition (the most common case),
the list is empty and the property is just not present at all.

The patch also gets rid of the `autoload` vs `defun` distinction in
`load-history` which seems unnecessary (a significant part of the
motivation for this patch was to get rid of the special handling of
autoloads in this part of the code).

* src/data.c (add_to_function_history): New function.
(defalias): Use it.  Don't add the `t` entries for autoloads and always
use `defun` regardless of the kind of definition.
Change `Vautoload_queue` to only hold the function
symbols since the rest is now available from `function-history`.
* src/eval.c (un_autoload): Adjust accordingly.

* src/lread.c (load-history): Udate docstring.

* lisp/loadhist.el (loadhist-unload-filename): New var.
(unload-feature): Bind it.
(loadhist-unload-element): Document its availability.
(loadhist--restore-autoload): Delete var.
(loadhist--unload-function): Delete function.
(loadhist-unload-element): Delete the `t` and `autoload` methods.
Rewrite the `defun` method using `function-history`.

* lisp/help-fns.el: Require `seq`.
(help-fns--autoloaded-p): Rewrite.
(help-fns-function-description-header): Adjust call accordingly.

* doc/lispref/loading.texi (Where Defined): Remove `autoload` and `t`
entries from `load-history` since we don't generate them any more.
Document the `function-history` which replaces the `autoload` property.
(Unloading): Adjust symbol property name accordingly.

* test/lisp/loadhist-resources/loadhist--bar.el:
* test/lisp/loadhist-resources/loadhist--foo.el: New files.
* test/lisp/loadhist-tests.el (loadhist-tests-unload-feature-nested)
(loadhist-tests-unload-feature-notnested): New tests.
2022-01-31 11:07:26 -05:00
Po Lu
6da021fce8 Fix artifacting on PGTK when bits are copied with an alpha channel
* src/pgtkterm.c (x_draw_stretch_glyph_string): Draw background
respecting `alpha-background'.
(pgtk_copy_bits): Use CAIRO_OPERATOR_SOURCE to draw onto the
destination surface.
2022-01-31 21:13:41 +08:00
Po Lu
4efab4330e ; * src/gtkutil.c (xg_create_frame_widgets): Avoid private GTK symbol. 2022-01-31 21:01:45 +08:00
Po Lu
46473a4eac Implement `alpha-background' on PGTK
* src/ftcrfont.c (ftcrfont_draw): Respect alpha-background where
appropriate.
* src/gtkutil.c (xg_create_frame_widgets): Swap some
conditionals around to get the right visual and signal handlers
on PGTK.
(xg_widget_style_updated): Likewise.
* src/pgtkfns.c (pgtk_set_alpha_background): New function.
(pgtk_frame_parm_handlers): Add it instead of the generic param
handler.
(Fx_create_frame): Fix typo.
* src/pgtkterm.c (pgtk_fill_rectangle):
(pgtk_set_cr_source_with_gc_foreground):
(pgtk_set_cr_source_with_gc_background):
(pgtk_set_cr_source_with_color): New argument
`respect_alpha_backend'.  All callers changed.
* src/pgtkterm.h: Update function prototypes.
2022-01-31 20:21:04 +08:00
Po Lu
790ad61fcf Fix accesses to GTK structures on tooltip frames
* src/xfns.c (xic_set_preeditarea): Don't set the GTK context on
tooltip frames.
(x_set_alpha_background): Don't make tooltip frames paintable.
* src/xterm.c (x_xr_ensure_picture): Get rid of GDK visual code.
This is now done in a better way inside xg_create_frame_widgets.
(bug#53654)
2022-01-31 18:38:24 +08:00
Po Lu
2ce7ac1c50 * src/haikufns.c (Fx_display_visual_class): Return correct values. 2022-01-31 10:14:52 +00:00
Po Lu
5edef4e98c Improve portability of GDK visual code
* src/gtkutil.c (xg_create_frame_widgets): Look up the visual
instead of assuming it based on the depth.
2022-01-31 18:13:19 +08:00
Po Lu
1472b046ea * src/xterm.c (x_term_init): Avoid freeze with 24-bit visuals. 2022-01-31 18:08:07 +08:00
Po Lu
79896d3eb7 Improve portability of alpha channel handling on TrueColor visuals
* src/xfns.c (select_visual): Always ask for a TrueColor visual.
* src/xfont.c (xfont_draw):
* src/xftfont.c (xftfont_draw): Test `alpha_bits' instead of
n_planes.
* src/xterm.c (x_fill_rectangle, x_clear_rectangle): Likewise.
(x_query_colors, x_alloc_nearest_color): Remove code that
hard-coded alpha mask.
(x_term_init): Calculate alpha bits and offset and populate
field appropriately.
* src/xterm.h (struct x_display_info): New fields `alpha_bits'
and `alpha_offset'.
(x_make_truecolor_pixel): Stop hardcoding the value of the alpha
mask.
2022-01-31 18:05:13 +08:00
Po Lu
cb91643c97 Fix motion not being reported on GTK when mouse moves over toolbar
* src/gtkutil.c (xg_event_is_for_scrollbar): Make code
consistent between XI2 and Core Input.
2022-01-31 13:53:44 +08:00
Po Lu
eb9dd32130 Make cursor alpha consistent with a transparent background
* src/xfont.c (xfont_draw):
* src/xftfont.c (xftfont_shape):
* src/xterm.c (x_clear_glyph_string_rect): Don't respect
background alpha when drawing the cursor.
2022-01-31 13:06:14 +08:00
Po Lu
ae8332b830 * src/xterm.c (x_xrender_color_from_gc_foreground): Fix omission error. 2022-01-31 12:58:11 +08:00
Po Lu
04f9c3b8df Fix the X toolkit build
* src/xterm.c (x_after_update_window_line): Update calls to
`x_fill_rectangle'.
2022-01-31 11:59:52 +08:00
Po Lu
a31914dda5 Fix tooltip frame creation with 32-bit visuals
* src/xfns.c (x_create_tip_frame): Define CWColormap and
CWBorderPixel to use a 32-bit visual if available.
2022-01-31 11:53:10 +08:00
Po Lu
2f32333cff Fix the no toolkit build.
* src/xfns.c (x_window): Use n_planes instead of CopyFromParent
for depth.
2022-01-31 10:37:49 +08:00
Po Lu
0a34aeee7e Fix builds without GTK
* src/xfns.c (x_set_alpha_background): Don't call
gtk_widget_set_app_paintable without GTK.
2022-01-31 10:30:24 +08:00
Po Lu
1555453694 Implement `alpha-background' on non-Cairo builds
* src/frame.c (gui_set_alpha_background): Recompute basic faces
so xft face ext info gets reset.
* src/gtkutil.c (xg_create_frame_widgets): Attach to style
updated signal.
(xg_update_frame_menubar): Set menu bar visual correctly.
(xg_widget_style_updated): New function.

* src/xfns.c (x_set_alpha_background): New function.
(x_frame_parm_handlers): Use x_set_alpha_background instead.

* src/xfont.c (xfont_draw):
* src/xftfont.c (xftfont_draw): Handle `alpha-background'
parameter.

* src/xterm.c (x_xr_ensure_picture): Export function.
(x_update_opaque_region): New function.
(x_fill_rectangle): New parameter `respect_alpha_background'.
All callers changed.
(handle_one_xevent): Set opaque region on ConfigureNotify.
(x_drop_xrender_surfaces): Set opaque region.
(x_xrender_color_from_gc_foreground):
(x_xrender_color_from_gc_background): Premultiply alpha with
components if asked for.
* src/xterm.h (struct x_display_info): New atom
`Xatom_net_wm_opaque_region'.
2022-01-31 10:15:47 +08:00
Juri Linkov
1b83e58adb * lisp/frame.el: Don't require 'frameset.el' (bug#51883).
(clone-frame): Use frame-internal-parameters.
(undelete-frame--handle-delete-frame): Instead of using frameset-save,
save frame-parameters except frame-internal-parameters and 'display'
on non-graphic display.  Also save window-state from window-state-get.
(undelete-frame): Instead of using frameset-restore,
set default-frame-alist for make-frame (like in clone-frame),
and restore window-state with window-state-put.

* lisp/frameset.el (frameset-session-filter-alist): Append
parameters from frame-internal-parameters with the filter :never.
Remove :name that is now in frame-internal-parameters.
(frameset-persistent-filter-alist): Remove outer-window-id,
parent-id, window-id that are now in frame-internal-parameters,
included here via frameset-session-filter-alist.

* src/frame.c (frame-internal-parameters): New variable.
2022-01-30 18:40:09 +02:00
Po Lu
71174a16da Handle correctly errors during frame creation on Haiku
* src/haikufns.c (haiku_create_frame): Only block input where
required.

* src/haiku_support.cc (BCursor_delete): Accept NULL values of
`cursor'.
2022-01-30 13:23:52 +00:00
Po Lu
988d3d79ba Use XRender to composite fringe bitmaps
This will allow us to apply transforms such as scaling in the
future.

* src/xterm.c (x_draw_fringe_bitmap): Composite fringe bitmaps
with XRender if available.
2022-01-30 16:02:58 +08:00
Po Lu
26a9acc86a Fix some problems with inconsistent visuals on GDK
* src/xterm.c (x_xr_ensure_picture): Use the visual GDK used
instead of our own.
2022-01-30 14:04:12 +08:00
Po Lu
2886520160 Use consistent font when displaying menu equivalent keys on Haiku
* src/haiku_support.cc (DrawContent): Set plain font when
drawing key text.
2022-01-30 05:20:15 +00:00