1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-18 00:50:44 -08:00
Commit graph

154980 commits

Author SHA1 Message Date
Po Lu
4f46ec8ddd Pacify compiler warning in handle_one_xevent
* src/xterm.c (x_dnd_get_target_window): Set proto_out even if
it won't be used because target is None.  Reported by Lars
Ingebrigtsen <larsi@gnus.org>.
2022-03-16 19:43:06 +08:00
Po Lu
1bf8eca626 Correct last change for return-frame drags
* src/xterm.c (handle_one_xevent): Use `x_any_window_to_frame'
to determine `x_dnd_return_frame_object'.
2022-03-16 17:07:17 +08:00
Po Lu
e8d7139b4e Fix minor bugs with XDND support
* lisp/mouse.el (mouse-drag-and-drop-region): Report more
selection targets for the benefit of Qt and Mozilla.
* lisp/select.el (xselect--encode-string)
(selection-converter-alist): Add new selection targets.

* src/xterm.c (x_dnd_get_window_proxy): New function.
(x_dnd_get_target_window): New argument proto_out, and return
first window with XdndAware instead of bottommost window.
(handle_one_xevent): Use new argument `proto_out'.
2022-03-16 17:03:19 +08:00
Po Lu
1babe5fb2d Fix XI 2.0 build
* src/xterm.c (handle_one_xevent): Move declaration of dummy out
of HAVE_XINPUT2_1.
2022-03-16 15:51:02 +08:00
Po Lu
47dcf72dec Fix tooltip text properties showing up in dragged text
* lisp/mouse.el (mouse-drag-and-drop-region): Directly call
x-show-tip and x-hide-tip instead of going through tooltip-show.
2022-03-16 15:20:10 +08:00
Stefan Kangas
b1c6d5f2b7 Merge from origin/emacs-28
62e830c3d9 * doc/misc/transient.texi: Fix @dircategory to "Emacs misc...
2022-03-16 06:30:35 +01:00
Po Lu
f62a6acd00 Better handle drag-and-drop from one Emacs frame to another
* doc/lispref/frames.texi (Drag and Drop): Document new
parameter `return-frame' to `x-begin-drag'.
* lisp/mouse.el (mouse-drag-and-drop-region): Utilize new
feature.

* src/xfns.c (Fx_begin_drag): New parameter `return-frame'.
* src/xterm.c (x_dnd_begin_drag_and_drop): New parameter
return_frame_p.
(handle_one_xevent): Set new flags and return frame whenever
appropriate.
* src/xterm.h: Update prototypes.
2022-03-16 12:33:15 +08:00
Po Lu
5ff13718a5 * src/xfns.c (Fx_begin_drag): Improve doc string. 2022-03-16 11:45:57 +08:00
Po Lu
e53fba3fd4 Add support for dragging text from Emacs to other programs
This still probably needs some more protection from
malfunctioning clients which delete windows at random, but I
don't know if that's a problem in practice.

* doc/emacs/frames.texi (Drag and Drop):
* doc/lispref/frames.texi (Drag and Drop): Document new
features.

* etc/NEWS: Announce new function `x-begin-drag' and new user
option `mouse-drag-and-drop-region-cross-program'.

* lisp/mouse.el (mouse-drag-and-drop-region-cross-program): New
user option.
(x-begin-drag): New variable declaration.
(mouse-drag-and-drop-region): If the mouse moves out of an Emacs
frame, begin a window system drag.
* lisp/x-dnd.el (x-dnd-handle-xdnd): Remove left-over debugging
code.

* src/xfns.c (Fx_set_mouse_absolute_pixel_position): Fix
indentation of opening paren.
(Fx_begin_drag): New function.
(syms_of_xfns): Define new subr.
* src/xselect.c (x_timestamp_for_selection): New function.

* src/xterm.c (X_DND_SUPPORTED_VERSION): New preprocessor
declaration.
(x_dnd_get_window_proto, x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave, x_dnd_send_drop, x_set_dnd_targets)
(x_dnd_begin_drag_and_drop): New functions.
(handle_one_xevent): Handle drag-and-drop motion and button
events when active.
(x_free_frame_resources): If f is the DND source, stop
drag-and-drop.
(x_term_init): Intern new atoms.
(syms_of_xterm): New symbol QXdndSelection.

* src/xterm.h (struct x_display_info): New atoms
Xatom_XdndAware, Xatom_XdndSelection, Xatom_XdndTypeList,
Xatom_XdndActionCopy, Xatom_XdndActionMove,
Xatom_XdndActionLink, Xatom_XdndActionAsk,
Xatom_XdndActionPrivate, Xatom_XdndActionList,
Xatom_XdndActionDescription, Xatom_XdndProxy, Xatom_XdndEnter,
Xatom_XdndPosition, Xatom_XdndStatus, Xatom_XdndLeave,
Xatom_XdndDrop, and Xatom_XdndFinished.
2022-03-16 11:31:29 +08:00
Po Lu
bf7d66aa1a Fix build with GTK 3.18.0 or earlier
* src/gtkutil.c (xg_update_scroll_bar_pos)
(xg_update_horizontal_scrollbar_pos): Avoid
gtk_widget_queue_allocate on older GTK versions.
2022-03-16 08:42:33 +08:00
Eli Zaretskii
5e8fbf7789 Clean up implementation of N0 per UAX#9
* src/bidi.c (bidi_resolve_brackets): Instead of requiring
prev_for_neutral's type to be known, fall back on SOS, per
the UBA.
2022-03-15 21:21:20 +02:00
Juri Linkov
62e830c3d9 * doc/misc/transient.texi: Fix @dircategory to "Emacs misc features" for dir. 2022-03-15 19:28:50 +02:00
Sam Steingold
d932e256a4 Extract gnus-collect-urls-from-article' from gnus-summary-browse-url'
* lisp/gnus-sum.el (gnus-collect-urls-from-article):
New function, extracted from `gnus-summary-browse-url'.
(gnus-summary-browse-url): Use it.
2022-03-15 12:22:48 -04:00
Stefan Monnier
b63f325e2e * lisp/url/url-vars.el: Cosmetic changes
(url-mime-separator-chars): Simplify.
(url-interactive-p): Tweak docstring.
2022-03-15 10:18:07 -04:00
Stefan Monnier
7d9f9d4d8e doctex-mode: Try and fix bug#35140
* lisp/textmodes/tex-mode.el (doctex-syntax-propertize-rules):
Add support for the new ^^X and consider the first ^ of ^^A to be the
closing char for the previous comment.
(doctex-font-lock-^^A): Simplify accordingly.
2022-03-15 10:12:46 -04:00
Lars Ingebrigtsen
55bcad776d Fix byte-code button in help--describe-command
* lisp/help.el (help--describe-command): Fix byte-code button
(bug#24235).
2022-03-15 12:44:50 +01:00
Lars Ingebrigtsen
8a9b4cfdff Revert "New command `gnus-summary-browse-all-urls' bound to "v""
This reverts commit f52dcfd03a.

It was never agreed that this should be added.
2022-03-15 12:36:06 +01:00
Po Lu
e547ca1f89 Fix some minor glitches with Haiku scroll bars
* src/haiku_support.cc (MouseDown): Don't start overscroll if
dragging started inside a button.
2022-03-15 04:46:01 +00:00
Po Lu
90742d7b01 Fix crashes when trying to pop up a menu on GTK 2
* src/xterm.c (handle_one_xevent): Respect finish when
dispatching copy.
2022-03-15 12:14:56 +08:00
Po Lu
2bfa184e29 Fix some issues with input on GTK 2 builds
* src/xfns.c (setup_xi_event_mask): Don't ask for XI key press
on GTK 2.
2022-03-15 12:10:31 +08:00
Po Lu
8cc8dfd67e Fix extraneous ifdef in xwidgets code
* xterm.c (handle_one_xevent): Pass GesturePinchEnd events to
xwidgets regardless of no-longer-present define.
2022-03-15 10:28:54 +08:00
Po Lu
299e475361 * src/xterm.c (handle_one_xevent): Fix use of wrong motion structure. 2022-03-15 10:24:13 +08:00
Po Lu
3bf5c2a838 Stop relying on dynlib for PGTK interrupt input
* src/pgtkterm.c (pgtk_term_init): Use dlopen and dlsym directly
instead of dynlib functions.  (bug#54378)
2022-03-15 08:54:30 +08:00
Thomas Fitzsimmons
e56eb02a25 EUDC: Fix a bug and some docstrings
* lisp/net/eudc.el (eudc-register-protocol): Add doc string.
(eudc-expand-inline): Add TRY-ALL-SERVERS to docstring.
(eudc-query-with-words): Fix early-return bug reported by
Alexander Adolf.
(eudc-menu): Add doc string.
(eudc-install-menu): Likewise.
2022-03-14 17:36:35 -04:00
Paul Eggert
5c13c33e0c Another fix for the no-toolkit build
This should be better in the long run.
* oldXMenu/Activate.c (XMenuActivate): Revert previous change,
eliminating the goto it introduced.
* oldXMenu/XMenuInt.h: Include <attribute.h>, for FALLTHROUGH.
2022-03-14 13:14:54 -07:00
Paul Eggert
0d0703e9c4 Prefer CALLN
* src/bytecode.c (Fbyte_code):
* src/composite.c (Fclear_composition_cache):
Prefer CALLN to doing it by hand.
* src/fns.c (ccall2): Remove.  All uses replaced by CALLN.
2022-03-14 09:06:20 -07:00
Sam Steingold
f52dcfd03a New command `gnus-summary-browse-all-urls' bound to "v"
* lisp/gnus-sum.el (gnus-collect-urls-from-article): New function,
  extracted from `gnus-summary-browse-url'.
(gnus-summary-browse-url): Use it; also use `browse-url-button-open-url'
  to handle the prefix argument.
(gnus-summary-browse-all-urls): New command.
(gnus-summary-mode-map): Bind `gnus-summary-browse-all-urls' to "v".
2022-03-14 11:28:02 -04:00
Po Lu
a359a9dfd4 Fix the no toolkit build
* Activate.c (XMenuActivate): Stop relying on fallthroughs
inside switch statement.  (bug#54382)
2022-03-14 21:49:12 +08:00
Lars Ingebrigtsen
2f2bb883da Fix RFC2047 encoding of Disposition-Notification-To
* lisp/mail/rfc2047.el (rfc2047-header-encoding-alist): Encode
Disposition-Notification-To as an address header (bug#54383).
2022-03-14 14:46:42 +01:00
Po Lu
b72dd3d0c5 Handle position specification hints on X toolkit builds
* src/xterm.c (x_wm_set_size_hint): Set PPosition and USPosition
independently of Xt.
2022-03-14 21:40:38 +08:00
Stefan Monnier
5d33f81542 * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Simplify Edebug spec 2022-03-14 09:28:18 -04:00
Lars Ingebrigtsen
f8cc706fb3 Improve the execute-kbd-macro doc string
* src/macros.c (Fexecute_kbd_macro): Improve the doc string
(bug#14206).
2022-03-14 12:17:24 +01:00
Philipp Stephani
f3df7916b2 Make Edebug specification for 'cl-defstruct' more lenient.
For example, 'xref-item' uses the list form of ':noinline'.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Accept ':noinline' and
':named' with an argument.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct/edebug): New
unit test.
2022-03-14 10:59:03 +01:00
Lars Ingebrigtsen
637dde4aba Don't always escape "." and "?" in `prin1'
* src/print.c (print_object): Only escape "." and "?" when
appearing as the first character in a symbol (bug#23130).
2022-03-14 10:29:54 +01:00
Martin Rudalics
15c61cb359 Init 'rest' in 'balance-windows-2' (Bug#54380)
* lisp/window.el (balance-windows-2): Give 'rest' an initial
value (Bug#54380).
2022-03-14 10:26:36 +01:00
Po Lu
a1fa3d24d7 Clean up some Haiku toolkit code
* src/haiku_io.c (haiku_read_with_timeout): Accept `bigtime_t'
instead of `time_t' for values which are cast to bigtime_t
anyway.
* src/haiku_support.cc (BMenu_run): Read all help events instead
of just one.
* src/haiku_support.h: Update prototypes.
2022-03-14 06:48:53 +00:00
Stefan Kangas
1a07854e0e ; Merge from origin/emacs-28
The following commit was skipped:

8e7a3f21e0 Fix evaluation of negated argument predicates in Eshell
2022-03-14 06:30:42 +01:00
Stefan Kangas
be38fed34e Merge from origin/emacs-28
1ec4063017 ; * admin/make-tarball.txt: Minor updates.
2022-03-14 06:30:41 +01:00
Po Lu
faab1b2002 Fix extraneous overscroll activation on Haiku
* src/haiku_support.cc (class EmacsScrollBar): New field
`maybe_overscroll'.
(MouseDown): Set that field.
(MouseUp): Clear that field.
(MouseMoved): Also test `maybe_overscroll' to ensure that a grab
started inside the scroll bar.
2022-03-14 02:46:11 +00:00
Po Lu
a63bac7ade Fix tool-bar highlight persisting after mouse moves onto WM frame
* src/xterm.c (handle_one_xevent): Always report MotionNotify
coordinates in terms of the edit widget.
2022-03-14 09:07:13 +08:00
Glenn Morris
485a8fcbf4 * src/bytecode.c: Include sysstdio.h, for fprint, stderr.
; Ref https://hydra.nixos.org/build/169207408
2022-03-13 18:03:11 -07:00
Po Lu
17fd48efab Enable overscroll on Haiku horizontal scroll bars
* src/haiku_support.cc (MouseMoved): Handle horizontal
directions correctly.
* src/haikuterm.c (haiku_set_horizontal_scroll_bar_thumb):
Enable overscrolling on scroll bar widget.
2022-03-14 00:54:10 +00:00
Po Lu
57172d0a35 Fix scroll bar movement right before overscroll begins on Haiku
* src/haikuterm.c (haiku_set_scroll_bar_thumb): Make sure value
and size are within bounds even if portion adjustment is off.
2022-03-14 00:45:00 +00:00
Lars Ingebrigtsen
510f1f2e72 Really fix find-func for defgeneric
* lisp/emacs-lisp/find-func.el (find-function-regexp): Really add
defgeneric.
2022-03-13 21:15:35 +01:00
Lars Ingebrigtsen
525c01c43a Make vtable sorting stable
* lisp/emacs-lisp/vtable.el (vtable--sort): Make the sorting
stable.
2022-03-13 21:13:49 +01:00
Paul Eggert
dd91aac508 Clang debug notes
* etc/DEBUG: Don’t imply Clang works as well as GCC when
debugging Emacs.  Mention a coverage problem with Clang.
2022-03-13 12:04:22 -07:00
Jim Porter
8e7a3f21e0 Fix evaluation of negated argument predicates in Eshell
* lisp/eshell/em-pred.el (eshell-add-pred-func): Let-bind 'pred' so
the lambdas see the original value (bug#54369).

Committed on the wrong branch.

Do not merge to master.
2022-03-13 20:00:35 +01:00
Jim Porter
ea3c147d2d Fix evaluation of negated argument predicates in Eshell
* lisp/eshell/em-pred.el (eshell-add-pred-func): Let-bind 'pred' so
the lambdas see the original value (bug#54369).
2022-03-13 19:59:07 +01:00
Mattias Engdegård
edb8481ce1 * src/bytecode.c (sf_set_ptr): Cast pointer to type of right size. 2022-03-13 19:35:50 +01:00
Mattias Engdegård
3ed79cdbf2 Separate bytecode stack
Use a dedicated stack for bytecode, instead of using the C stack.
Stack frames are managed explicitly and we stay in the same
exec_byte_code activation throughout bytecode function calls and
returns.  In other words, exec_byte_code no longer uses recursion
for calling bytecode functions.

This results in better performance, and bytecode recursion is no
longer limited by the size of the C stack.  The bytecode stack is
currently of fixed size but overflow is handled gracefully by
signalling a Lisp error instead of the hard crash that we get now.

In addition, GC marking of the stack is now faster and more precise.
Full precision could be attained if desired.

* src/alloc.c (ATTRIBUTE_NO_SANITIZE_ADDRESS): Make non-static.
* src/bytecode.c (enum stack_frame_index, BC_STACK_SIZE)
(sf_get_ptr, sf_set_ptr, sf_get_lisp_ptr, sf_set_lisp_ptr)
(sf_get_saved_pc, sf_set_saved_pc, init_bc_thread, free_bc_thread)
(mark_bytecode, Finternal_stack_stats, valid_sp): New.
(exec_byte_code): Adapt to use the new bytecode stack.
(syms_of_bytecode): Add defsubr.
* src/eval.c (unwind_to_catch): Restore saved stack frame.
(push_handler_nosignal): Save stack frame.
* src/lisp.h (struct handler): Add act_rec member.
(get_act_rec, set_act_rec): New.
* src/thread.c (mark_one_thread): Call mark_bytecode.
(finalize_one_thread): Free bytecode thread state.
(Fmake_thread, init_threads): Set up bytecode thread state.
* src/thread.h (struct bc_thread_state): New.
(struct thread_state): Add bytecode thread state.
2022-03-13 17:51:49 +01:00