1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-16 16:20:40 -08:00
Commit graph

154998 commits

Author SHA1 Message Date
Po Lu
667775e1ae Make GTK inspector available on PGTK
* src/pgtkfns.c (Fx_gtk_debug): New function.
(syms_of_pgtkfns): Define new subr.
2022-03-17 11:51:32 +08:00
Po Lu
bbfad0a788 ; * lisp/term/haiku-win.el (x-begin-drag): Fix compiler warning. 2022-03-17 11:49:23 +08:00
Po Lu
dfdd2f6f23 * lisp/term/haiku-win.el (x-begin-drag): Fix type code of B_MIME_TYPE. 2022-03-17 03:46:35 +00:00
Po Lu
00172ae0c8 Implement cross-program drag-and-drop on Haiku
* doc/lispref/frames.texi (Drag and Drop): Fix documentation of
`x-begin-drag' to match actual function arity.
* lisp/term/haiku-win.el (haiku-dnd-selection-value): New
variable.
(haiku-dnd-selection-converters): New variable.
(haiku-dnd-convert-string): New function.
(gui-backend-get-selection, gui-backend-set-selection): Handle
XdndSelection specially.
(x-begin-drag): New function.

* src/haiku_select.cc (be_create_simple_message)
(be_add_message_data): New functions.
* src/haiku_support.cc (WAIT_FOR_RELEASE): New message type.
(class EmacsView, MouseUp): If waiting for release, reply and
drop event.
(be_drag_message, be_drag_message_thread_entry): New functions.
* src/haiku_support.h: Update prototypes.

* src/haikuselect.c (lisp_to_type_code, haiku_lisp_to_message)
(Fhaiku_drag_message): New functions.
(syms_of_haikuselect): Define new subr.

* src/haikuselect.h: Update prototypes.
2022-03-17 03:42:19 +00:00
Po Lu
c223e2aefc Improve GTK support for X11 drag-n-drop
* src/xterm.c (x_dnd_begin_drag_and_drop): Run nested GTK event
loop instead, so GTK gets the correct events.
2022-03-17 08:55:16 +08:00
Paul Eggert
f7e0e5b7ae Simplify generate-new-buffer-name randomness
* src/buffer.c (Fgenerate_new_buffer_name):
Simplify by calling get_random instead of Frandom;
that’s random enough here.
2022-03-16 17:52:42 -07:00
Paul Eggert
2ef037c0dd Improve random bignum generation
* src/bignum.c (get_random_limb, get_random_limb_lim)
(get_random_bignum): New functions, for more-efficient
generation of random bignums without using Frem etc.
* src/fns.c (get_random_fixnum): New function.
(Frandom): Use it, and get_random_bignum.
Be consistent about signalling nonpositive integer arguments;
since zero is invalid, Qnatnump is not quite right here.
* src/sysdep.c (get_random_ulong): New function.
2022-03-16 17:52:41 -07:00
Alan Mackenzie
31a2428d6f Strip positions from symbols before the eval in eval-{when,and}-compile.
This fixes bug #54079.

* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment): Change
the position of 'byte-run-strip-symbol-positions' in the eval-when-compile
entry.  Add a call to `byte-run-strip-symbol-positions' in the
eval-and-compile entry.
2022-03-16 19:23:24 +00:00
Robert Pluim
0e5f8e24af Report buffer-name when local mode-line is invalid
* lisp/files.el (hack-local-variables-prop-line): Add '(buffer-name)'
to the message reporting the malformed mode-line.
2022-03-16 19:05:17 +01:00
Robert Pluim
a86205b060 Guard against custom entries that can contain NULs
There are custom entries that contain lambda's as values by default,
which can result in them containing embedded NULs after
byte-compilation, which wreaks havoc when they are saved to .emacs and
later read in.  (Bug#52554)

* lisp/cus-edit.el (custom-save-all): Bind
print-escape-control-characters to t.
* lisp/startup.el (startup--load-user-init-file): Bind
inhibit-null-byte-detection to t.
2022-03-16 18:58:49 +01:00
Robert Pluim
fa8c93ad9a Improve error message for 'not running' processes
The current error message is simply 'not running', but
'status_message' can give information about why the process is in that
state, such as network errors, so return that as well.  (Bug#53762)

* src/process.c (send_process, Fprocess_send_eof): Add the output of
'status_message' to the error string.
2022-03-16 18:58:49 +01:00
Manuel Giraud
6b2e6a53ec * lisp/net/tramp-sh.el (tramp-find-file-exists-command): Fix comment. 2022-03-16 17:38:18 +01:00
Robert Pluim
679b9cc9ff Link with libdl when using pgtk
* configure.ac: Define LIBMODULES on GNU/Linux when using pgtk, even
when not using modules, since pgtkterm.c uses dlsym.  (Bug#54378)
2022-03-16 15:31:27 +01:00
Po Lu
d5e8f483f9 * doc/lispref/frames.texi (x-begin-drag): Improve wording. 2022-03-16 21:47:37 +08:00
Po Lu
549d0a4413 Fix 32-bit Haiku build
* src/haikuselect.h (be_enum_message): Fix declaration for
32-bit types.
2022-03-16 13:43:37 +00:00
Po Lu
79f3d9c8f3 Add support for dropping plain text on Haiku
* haiku-win.el (haiku-dnd-handle-drag-n-drop-event): Handle
`text/plain'.
2022-03-16 13:28:53 +00:00
Po Lu
3de3f12b94 Redo Haiku DND support
* lisp/term/haiku-win.el (haiku-dnd-handle-drag-n-drop-event):
Update for new DND event format.
* src/haiku_io.c (haiku_len): Handle DRAG_AND_DROP_EVENTs.
* src/haiku_select.cc (be_enum_message, be_get_refs_data)
(be_get_message_data): New function.
* src/haiku_support.cc (class Emacs): Remove `RefsReceived'.
(MessageReceived): Generate new kind of drag-n-drop events.
* src/haiku_support.h (enum haiku_event_type): Rename
`REFS_EVENT' to `DRAG_AND_DROP_EVENT'.
(struct haiku_refs_event): Delete struct.
(struct haiku_drag_and_drop_event): New struct.
* src/haikuselect.c (haiku_message_to_lisp): New function.
(syms_of_haikuselect): New symbols.
* src/haikuselect.h: Update prototypes.
* src/haikuterm.c (haiku_read_socket): Handle new type of
drag-and-drop events by serializing drop message to Lisp and
letting Lisp code do the processing.
* src/haikuterm.h: Update prototypes.
2022-03-16 13:28:53 +00:00
Eli Zaretskii
65f92837fa Fix last change in frames.texi
* doc/lispref/frames.texi (Drag and Drop): Improve and clarify the
wording.
2022-03-16 14:46:36 +02:00
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