Po Lu [Thu, 31 Mar 2022 09:21:37 +0000 (17:21 +0800)]
Implement Motif drop protocol
This is the second most widely implemented drag-and-drop
protocol on X Windows, but seems to have some unsolvable
problems (i.e. stuff will keep accumulating in the drag window
as long the target lists keep changing.) The implementation is
not yet complete and doesn't work with some programs.
* lisp/select.el (xselect-convert-xm-special): New functions.
(selection-converter-alist): Add new converters.
* lisp/x-dnd.el (x-dnd-handle-motif): Ignore messages sent by
the receiver.
* src/xterm.c (xm_targets_table_byte_order): New enum;
(SWAPCARD32, SWAPCARD16): New macros.
(xm_targets_table_rec, xm_drop_start_message)
(xm_drag_initiator_info, xm_drag_receiver_info): New structures.
(XM_DRAG_SIDE_EFFECT, xm_read_targets_table_header)
(xm_read_targets_table_rec, xm_find_targets_table_idx)
(x_atoms_compare, xm_write_targets_table)
(xm_write_drag_initiator_info, xm_get_drag_window)
(xm_setup_dnd_targets, xm_send_drop_message)
(xm_read_drag_receiver_info): New functions.
(x_dnd_compute_toplevels): Correctly free some temp data.
(x_dnd_get_window_proxy, x_dnd_get_window_proto)
(x_set_frame_alpha): Likewise.
(handle_one_xevent): If the window has no XDND proto but has
motif drag receiver data, send a motif drop protocol request.
(x_term_init): New atoms for Motif DND support.
* src/xterm.h (struct x_display_info): Add new atoms.
Stefan Monnier [Wed, 30 Mar 2022 17:54:56 +0000 (13:54 -0400)]
cl-generic: Use OClosures for `cl--generic-isnot-nnm-p`
Rewrite the handling of `cl-no-next-method` to get rid of the hideous
hack used in `cl--generic-isnot-nnm-p` and also to try and move
some of the cost to the construction of the effective method rather
than its invocation. This speeds up method calls measurably when
there's a `cl-call-next-method` in the body.
* lisp/loadup.el ("emacs-lisp/oclosure"): Load.
* lisp/emacs-lisp/oclosure.el (oclosure-define): Remove workaround now
that we're preloaded.
* lisp/emacs-lisp/cl-generic.el (cl--generic-method): Rename `uses-cnm`
to `call-con` to reflect it's not a boolean any more.
(cl-defmethod): Adjust to the new name and new values.
(cl-generic-define-method): Adjust to the new name.
(cl--generic-lambda): Use the new `curried` calling convention.
(cl--generic-no-next-method-function): Delete function.
(cl--generic-nnm): New type.
(cl-generic-call-method): Rewrite to support the various
calling conventions.
(cl--generic-nnm-sample, cl--generic-cnm-sample): Delete consts.
(cl--generic-isnot-nnm-p): Rewrite using `oclosure-type`.
(cl--generic-method-info): Add support for new calling convention.
Stefan Monnier [Wed, 30 Mar 2022 17:49:31 +0000 (13:49 -0400)]
EIEIO tests: Fix failure when `eieio-core.el` is interpreted
* lisp/emacs-lisp/eieio-core.el (eieio--validate-slot-value)
(eieio--slot-name-index): Use the `cl--class` accessor functions.
Andrea Corallo [Wed, 30 Mar 2022 15:13:27 +0000 (17:13 +0200)]
* src/pdumper.c (dump_get_max_page_size): Rename from 'dump_get_page_size'.
Andrea Corallo [Wed, 30 Mar 2022 15:12:43 +0000 (17:12 +0200)]
* src/pdumper.c: Remove getpagesize.h dependecy.
Michael Albinus [Wed, 30 Mar 2022 11:16:54 +0000 (13:16 +0200)]
Extend signal-process and proced.el
* doc/lispref/processes.texi (Signals to Processes):
Document changes in signal-process.
* etc/NEWS: Mention changes in proced.el and signal-process.
* lisp/proced.el (proced-signal-function): Declare it obsolete.
(proced-remote-directory): New user option.
(proced-mode): Adapt docstring.
(proced-send-signal, proced-renice): Handle interactive prefix argument.
* lisp/net/tramp.el (tramp-signal-process): New defun. Add it to
`signal-process-functions'.
* src/process.c (Finternal_default_signal_process): New defun,
providing the hitherto existing implementation of Fsignal_process.
(Fsignal_process): Loop through Vsignal_process_functions.
(Vsignal_process_functions): New defvar.
(Qinternal_default_signal_process, Qsignal_process_functions):
Declare symbols.
(Sinternal_default_signal_process): Declare subroutine.
* test/lisp/net/tramp-tests.el (tramp-test31-signal-process): New test.
Michael Albinus [Wed, 30 Mar 2022 09:16:57 +0000 (11:16 +0200)]
; Extend Tramp FAQ
* doc/misc/tramp.texi (Frequently Asked Questions): Explain Tramp
temporary file identification.
Po Lu [Wed, 30 Mar 2022 08:36:10 +0000 (16:36 +0800)]
Remove local copies of remote files created for drag-and-drop
* lisp/dired.el (dired-mouse-drag): Remove last dragged remote
file and save a record of any local copy created.
(dired-remove-last-dragged-local-file): New function.
Po Lu [Wed, 30 Mar 2022 08:24:45 +0000 (08:24 +0000)]
Ignore mouse movement correctly on Haiku during drag and drop
* src/haikuselect.c (haiku_unwind_drag_message): New function.
(Fhaiku_drag_message): Set `haiku_dnd_in_progress' to false.
* src/haikuterm.c (haiku_read_socket): Fix overriding of
need_flush when reading events from multiple frames.
* src/haikuterm.h (haiku_dnd_in_progress): New variable.
* src/xdisp.c (note_mouse_highlight): Ignore if said variable is
true.
Po Lu [Wed, 30 Mar 2022 08:13:35 +0000 (08:13 +0000)]
Prevent signals when dragging nonexistent files on Haiku
* lisp/term/haiku-win.el (x-begin-drag): Bind
`haiku-signal-invalid-refs' to nil.
* src/haiku_support.cc (MouseMoved): Send motion events while
dragging as well.
* src/haikuselect.c (haiku_lisp_to_message): Respect new
variable.
(syms_of_haikuselect): New variable `haiku-signal-invalid-refs'.
Po Lu [Wed, 30 Mar 2022 06:20:13 +0000 (14:20 +0800)]
; * lisp/dired.el (dired-mouse-drag): Create local copy if file is remote.
Po Lu [Wed, 30 Mar 2022 03:25:50 +0000 (11:25 +0800)]
Disallow building with non-toolkit scroll bars on non-X systems
* configure.ac: Prevent building without toolkit scroll bars on
non-X systems, where they're not implemented. (bug#54629)
Po Lu [Wed, 30 Mar 2022 01:17:58 +0000 (09:17 +0800)]
Avoid calling XGetAtomName in a loop when fetching monitor attributes
* src/xfns.c (x_get_monitor_attributes_xrandr): Avoid syncing on
each monitor when waiting for XGetAtomName when built with XCB.
Po Lu [Wed, 30 Mar 2022 00:57:23 +0000 (08:57 +0800)]
Add some optimizations to ShapeNotify handling
* src/xterm.c (handle_one_xevent): Do bounding rect
optimizations on ShapeNotify events as well.
Michael Albinus [Tue, 29 Mar 2022 17:36:28 +0000 (19:36 +0200)]
Handle process property `remote-command' in Tramp
* doc/misc/tramp.texi (Remote processes): New subsection "Process
properties of asynchronous remote processes".
* lisp/net/tramp.el (tramp-handle-make-process):
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
* lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process)
Set `remote-command' process property.
(tramp-scp-direct-remote-copying): Rename connection property.
* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process, tramp-test31-interrupt-process)
(tramp--test-async-shell-command): Check process property
`remote-command'.
Lars Ingebrigtsen [Tue, 29 Mar 2022 15:12:01 +0000 (17:12 +0200)]
ipv6 addresses aren't suspicious
* lisp/international/textsec.el (textsec--ipvx-address-p): New
function.
(textsec-domain-suspicious-p): Use it to say that ipv6 addresses
aren't suspicious (bug#54624).
Jim Porter [Sat, 26 Mar 2022 22:12:48 +0000 (15:12 -0700)]
Don't use 'eshell-convert' when all we want is a number
* lisp/eshell/em-hist.el (eshell/history): Use 'string-to-number'
instead of 'eshell-convert'.
* lisp/eshell/em-basic.el (eshell/umask): Simplify implementation and
be more careful about parsing numeric umasks to set.
Jim Porter [Sat, 26 Mar 2022 22:09:51 +0000 (15:09 -0700)]
Add tests for Eshell's umask command
'em-basic-test/umask-set' fails when passing an actual number to the
command, but this is fixed in the subsequent commit.
test/lisp/eshell/em-basic-tests.el: New file.
Thomas Fitzsimmons [Tue, 29 Mar 2022 12:34:38 +0000 (14:34 +0200)]
Fix eww bookmark writing
* lisp/net/eww.el (eww-write-bookmarks): Ensure that the complete
bookmarks are written (bug#54612).
Po Lu [Tue, 29 Mar 2022 10:31:24 +0000 (18:31 +0800)]
Rewrite desktop workarea computation to avoid too many calls to XSync
* src/xfns.c (x_get_net_workarea): Rewrite using XCB without
using long_offset and long_length, since the data transfer is
usually negligible compared to the roundtrip delay.
Mattias Engdegård [Tue, 29 Mar 2022 09:14:11 +0000 (11:14 +0200)]
Fix typo in ERC DCC code in verbose mode
* lisp/erc/erc-dcc.el (erc-dcc-send-block): Typo causing incorrect
message when `erc-dcc-verbose` is set.
Stefan Monnier [Tue, 29 Mar 2022 07:23:38 +0000 (03:23 -0400)]
* lisp/emacs-lisp/oclosure.el (oclosure--define): Autoload
Po Lu [Tue, 29 Mar 2022 06:35:09 +0000 (06:35 +0000)]
Specially decode more selection types on Haiku
* src/haiku_select.cc (be_get_point_data, be_add_point_data):
New functions.
* src/haikuselect.c (haiku_message_to_lisp, lisp_to_type_code)
(haiku_lisp_to_message): Accept new types `size_t', `ssize_t'
and `point'.
(Fhaiku_drag_message): Update doc string.
(syms_of_haikuselect): New defsyms.
* src/haikuselect.h: Update prototypes.
Po Lu [Tue, 29 Mar 2022 05:58:40 +0000 (13:58 +0800)]
Temporarily fix the oclosure bootstrap
* lisp/emacs-lisp/oclosure.el (oclosure-define): Load oclosure
from source if `oclosure--define' is not defined during byte
compilation.
Po Lu [Tue, 29 Mar 2022 01:08:22 +0000 (09:08 +0800)]
Don't loop through useless region when searching for DND toplevel
* src/xterm.c (x_dnd_compute_toplevels): Optimize for the
bounding rect being the window dimensions.
Juri Linkov [Mon, 28 Mar 2022 18:00:32 +0000 (21:00 +0300)]
Add search function to search within filenames in Dired and WDired (bug#14013)
* lisp/dired-aux.el (dired-isearch-filenames-mode): Use
dired-isearch-search-filenames on isearch-search-fun-function
instead of dired-isearch-filter-filenames on isearch-filter-predicate.
(dired-isearch-filter-filenames): Remove function.
(dired-isearch-search-filenames): Add function.
* lisp/isearch.el (isearch-message-prefix): Add isearch-search-fun-function
to the list of supported advice-functions along with isearch-filter-predicate.
* lisp/replace.el (replace-search): Add comment.
* lisp/wdired.el (wdired-search-replace-filenames): New defcustom.
(wdired-isearch-filter-read-only): Remove function.
(wdired-change-to-wdired-mode, wdired-change-to-dired-mode):
Add and remove dired-isearch-search-filenames on isearch-search-fun-function
instead of wdired-isearch-filter-read-only on isearch-filter-predicate.
Also set/unset replace-search-function and replace-re-search-function.
Remove and restore isearch-mode-hook with dired-isearch-filenames-setup.
The problem is that dired-isearch-filenames-setup adds
dired-isearch-filenames-end to isearch-mode-end-hook that removes
dired-isearch-search-filenames added to isearch-search-fun-function
in wdired-change-to-wdired-mode. Then replace-highlight can't use
dired-isearch-search-filenames.
Stefan Monnier [Mon, 28 Mar 2022 14:53:14 +0000 (10:53 -0400)]
Add OClosures, a cross between functions and structs
We here just add the new type. It is not fully self-contained.
It requires cooperation from `cconv.el` on the one hand, and it
hijacks the docstring info to hold the type of OClosure objects.
This does imply that OClosures can't have docstrings, tho this
limitation will be lifted in subsequent patches.
* lisp/emacs-lisp/oclosure.el: New file.
* test/lisp/emacs-lisp/oclosure-tests.el: New file.
* doc/lispref/functions.texi (OClosures): New section.
* src/eval.c (Ffunction): Accept symbols instead of strings for docstrings.
* src/doc.c (store_function_docstring): Avoid overwriting an OClosure type.
* lisp/emacs-lisp/cconv.el (cconv--convert-function): Tweak ordering of
captured variables.
(cconv-convert): Add case for `oclosure--fix-type`.
Po Lu [Mon, 28 Mar 2022 12:34:03 +0000 (20:34 +0800)]
Fix doc of `gui-get-selection' as to what is really valid as `data'
* doc/lispref/frames.texi (Window System Selections):
* lisp/select.el (gui-set-selection): Don't say `data' can be a
cons or list of two integers, since that's not supported.
Po Lu [Mon, 28 Mar 2022 12:28:53 +0000 (12:28 +0000)]
Minor fixes to Haiku selection support
* lisp/term/haiku-win.el (haiku-selection-bounds): New function.
(haiku-dnd-convert-string, haiku-select-encode-xstring)
(haiku-select-encode-utf-8-string): Handle position pairs
correctly.
(gui-backend-set-selection): Adjust for new airity.
* src/haikuselect.c (Fhaiku_selection_put): Fix arity.
Po Lu [Mon, 28 Mar 2022 10:41:12 +0000 (18:41 +0800)]
Improve portability of XCB configure checks
* configure.ac: Look for xcb_aux_sync in -lxcb-aux if it's not
in -lxcb-util.
Michael Albinus [Mon, 28 Mar 2022 10:02:23 +0000 (12:02 +0200)]
Do not register Tramp file name handlers twice
* lisp/net/tramp.el (tramp-register-autoload-file-name-handlers):
* lisp/net/tramp-archive.el (tramp-register-archive-file-name-handler):
Check, whether the real file name handler is already registered.
Po Lu [Mon, 28 Mar 2022 05:52:17 +0000 (13:52 +0800)]
Avoid extra sync when fetching DND proxy window
* src/xterm.c (x_dnd_get_proxy_proto): New function.
(x_dnd_get_target_window): Use it on XCB to determine window
proxy and proto for toplevel window.
Po Lu [Mon, 28 Mar 2022 00:59:50 +0000 (08:59 +0800)]
Clean up some uses of XInternAtom
* src/xfns.c (x_set_undecorated, x_set_no_focus_on_map, x_window)
(set_machine_and_pid_properties): Move calls to XInternAtom for
static string to use previously interned atoms.
(Fx_change_window_property): Use XCB if available to avoid extra
call to XSync.
* src/xterm.c (x_term_init):
* src/xterm.h (struct x_display_info): New atoms _MOTIF_WM_HINTS
and _NET_WM_PID.
Po Lu [Mon, 28 Mar 2022 00:39:37 +0000 (08:39 +0800)]
; * src/xterm.c (x_dnd_compute_toplevels): Use right enum on XCB.
Po Lu [Sun, 27 Mar 2022 13:36:45 +0000 (13:36 +0000)]
Store latin-1 content into the Haiku clipboard as well
* lisp/term/haiku-win.el (haiku-normal-selection-encoders): New
variable.
(haiku-select-encode-utf-8-string, haiku-select-encode-xstring):
New functions.
(gui-backend-set-selection): Use new selection encoder functions
instead of hard-coding UTF-8.
(haiku-dnd-handle-drag-n-drop-event): Rename to
`haiku-drag-and-drop'.
* src/haiku_select.cc (be_lock_clipboard_message): Accept new
argument `clear'.
(be_unlock_clipboard): Accept new argument `discard'.
* src/haikuselect.c (Fhaiku_selection_data): Change calls to
`be_lock_clipboard_message' and `be_unlock_clipboard'.
(haiku_unwind_clipboard_lock): New function.
(Fhaiku_selection_put): Accept new meaning of `name' which means
to set the selection message.
* src/haikuselect.h: Update prototypes.
Po Lu [Sun, 27 Mar 2022 11:53:49 +0000 (19:53 +0800)]
Clean up PGTK cursor blanking code
* src/pgtkterm.c (XTframe_rehighlight): Rename to
`pgtk_frame_rehighlight_hook'. All callers changed.
(x_toggle_visible_pointer): Rename to
`pgtk_toggle_visible_pointer'. All callers changed.
(x_setup_pointer_blanking, XTtoggle_invisible_pointer): Delete
functions.
(pgtk_create_terminal): Use new names for various hooks.
(pgtk_term_init): Set up blank cursor directly.
* src/pgtkterm.h (struct pgtk_display_info): Remove
`toggle_visible_pointer'.
Po Lu [Sun, 27 Mar 2022 07:51:41 +0000 (15:51 +0800)]
Don't wait for XdndFinished messages if the target did not send status
* src/xterm.c (x_dnd_send_leave): Return if we should wait for a
XdndFinished message.
(handle_one_xevent): Use that value for
`x_dnd_waiting_for_finish'.
Augusto Stoffel [Fri, 25 Mar 2022 07:46:57 +0000 (08:46 +0100)]
Always run 'isearch-lazy-count-update-hook' with point at match
* lisp/isearch.el (isearch-lazy-highlight-buffer-update): Run
'isearch-lazy-count-update-hook' outside of save-excursion, so point
is at the current match.
Po Lu [Sun, 27 Mar 2022 05:01:18 +0000 (13:01 +0800)]
Fix processing of DND grab on non-XI2 builds
* src/xterm.c (handle_one_xevent): Process DND grab flag
correctly.
Stefan Kangas [Sun, 27 Mar 2022 04:30:16 +0000 (06:30 +0200)]
Merge from origin/emacs-28
1bef52ce73 * doc/emacs/anti.texi (Antinews): Unannounce removal of Mo...
Po Lu [Sun, 27 Mar 2022 01:48:37 +0000 (09:48 +0800)]
Fix no-toolkit build
* src/xterm.c (x_top_window_to_frame): Declare correctly on
no-toolkit builds.
Po Lu [Sun, 27 Mar 2022 00:53:12 +0000 (08:53 +0800)]
Avoid excessive synchronization when handling ShapeNotify events
* src/xterm.c (handle_one_xevent): Use XCB to handle ShapeNotify
events when we want both the bounding and input rects.
Po Lu [Sun, 27 Mar 2022 00:34:25 +0000 (00:34 +0000)]
; * src/haikuimage.c (syms_of_haikuimage): Remove duplicate DEFSYM.
Mattias Engdegård [Sat, 26 Mar 2022 15:44:18 +0000 (16:44 +0100)]
Fix reader infinite recursion for circular mixed-type values
Make sure that the value added to the `read_objects_completed` set is
the one we actually return; previously this wasn't the case for conses
because of an optimisation (bug#54501).
Also add a check for vacuous self-references such as #1=#1# instead of
returning a nonsense value from thin air.
* src/lread.c (read1): Treat numbered conses correctly as described
above. Detect vacuous self-references.
* test/src/lread-tests.el (lread-test-read-and-print)
(lread-test-circle-cases, lread-circle): Add tests.
Eli Zaretskii [Sat, 26 Mar 2022 12:29:11 +0000 (15:29 +0300)]
; * src/image.c (syms_of_image): Fix whitespace.
Po Lu [Sat, 26 Mar 2022 12:16:46 +0000 (12:16 +0000)]
Enable the native display of BMP images on Haiku
* src/image.c (syms_of_image): Also register `bmp' image type on
Haiku when native image APIs are enabled.
Po Lu [Sat, 26 Mar 2022 12:01:58 +0000 (12:01 +0000)]
Fix crash when timer signals or throws inside a popup menu on Haiku
* src/haikumenu.c (haiku_process_pending_signals_for_menu_1)
(haiku_process_pending_signals_for_menu_2): New functions.
(haiku_process_pending_signals_for_menu): Catch non local exits
around `timer_check'.
Po Lu [Sat, 26 Mar 2022 11:38:30 +0000 (19:38 +0800)]
; * src/xterm.c (x_dnd_compute_toplevels): Fix cookie leak if rc is 0.
Po Lu [Sat, 26 Mar 2022 10:13:47 +0000 (10:13 +0000)]
Fix processing of emacs:window_id inside DND messages if it already exists
* src/haiku_support.cc (MessageReceived): Use DropPoint instead
of getting it manually.
(be_drag_message): Replace window_id if it already exists.
Michael Albinus [Sat, 26 Mar 2022 09:40:16 +0000 (10:40 +0100)]
; Improve readablity in grep.el
* lisp/progmodes/grep.el (grep-compute-defaults): Set a more
readable value for `grep-quoting-style'.
Michael Albinus [Sat, 26 Mar 2022 09:39:39 +0000 (10:39 +0100)]
Don't let Tramp block dired (Bug#54542)
* lisp/dired.el (dired-find-buffer-nocreate): Avoid avoid hangs in
remote buffers with a blocked connection. (Bug#54542)
* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
Extend suppression rules.
Po Lu [Sat, 26 Mar 2022 09:12:34 +0000 (17:12 +0800)]
Minor fixes to last change
* src/Makefile.in: Add XSHAPE_LIBS and XSHAPE_CFLAGS.
(LIBES, EMACS_CFLAGS): Likewise.
* src/xterm.c (x_dnd_compute_toplevels): Fix build without
HAVE_XCB_SHAPE.
Po Lu [Sat, 26 Mar 2022 09:10:42 +0000 (17:10 +0800)]
Also fetch shapes via XCB for drag and drop
* configure.ac: Also look for xcb-shape.
* src/xterm.c (HAVE_XCB_SHAPE_INPUT_RECTS): New define.
(x_dnd_compute_toplevels): Use XCB for input shapes if possible.
Eli Zaretskii [Sat, 26 Mar 2022 08:52:41 +0000 (11:52 +0300)]
Use native image APIs on MS-Windows by default
* src/w32term.c (syms_of_w32term) <w32-use-native-image-API>: Now
t by default on W2K and later systems, but only on WINDOWSNT
builds.
* etc/NEWS: Announce the change.
Eli Zaretskii [Sat, 26 Mar 2022 08:31:46 +0000 (11:31 +0300)]
Support display of BMP images on MS-Windows
* src/w32image.c (w32_can_use_native_image_api): Support BMP
images.
* src/image.c (syms_of_image) <Qbmp>: New symbol.
[HAVE_NTGUI]: Add 'bmp' to list of supported image types.
* doc/lispref/display.texi (Image Formats): Document built-in
support for BMP images.
* etc/NEWS: Announce the change.
Eli Zaretskii [Sat, 26 Mar 2022 07:28:52 +0000 (10:28 +0300)]
Improve 'desktop--emacs-pid-running-p'
* lisp/desktop.el (desktop--emacs-pid-running-p): Avoid false
negatives on MS-Windows and with some symlinks to Emacs
executables. (Bug#1474)
Po Lu [Sat, 26 Mar 2022 06:46:00 +0000 (14:46 +0800)]
* doc/emacs/anti.texi (Antinews): Unannounce removal of Motif.
Stefan Kangas [Sat, 26 Mar 2022 05:30:21 +0000 (06:30 +0100)]
Merge from origin/emacs-28
4ec9f9edd1 Fix eshell-explicit-command-char doc string typo
Po Lu [Sat, 26 Mar 2022 04:20:23 +0000 (12:20 +0800)]
Fix crash when windows are destroyed by faulty clients
* src/xterm.c (x_dnd_compute_toplevels): Make sure
property_reply is non-NULL before testing its format and length.
Po Lu [Sat, 26 Mar 2022 04:14:52 +0000 (12:14 +0800)]
Avoid excessive synchronization when initiating drag-and-drop
* src/xterm.c (x_dnd_compute_toplevels): Use XCB to get WM
state, attributes, geometry and to translate coordinates. This
avoids 4 calls to XSync.
Po Lu [Sat, 26 Mar 2022 02:17:12 +0000 (10:17 +0800)]
Fix compiler warning in x-dnd.el
* lisp/x-dnd.el (x-dnd-xdnd-to-action): Move declaration
earlier.
Po Lu [Sat, 26 Mar 2022 02:15:53 +0000 (10:15 +0800)]
Avoid ClientMessage overhead when dragging stuff to other frames
* lisp/dired.el (dired-mouse-drag): Handle correctly dragging
from dired buffers in nonselected windows.
* lisp/x-dnd.el (x-dnd-handle-drag-n-drop-event): Understand new
client message type.
* src/xterm.c (x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave): Ignore if window is the top window of a
frame.
(x_dnd_send_drop): Send special DND event in that case.
Po Lu [Sat, 26 Mar 2022 00:45:08 +0000 (08:45 +0800)]
Fix minor issues with dired-mouse-drag-files
* lisp/dired.el (dired-mouse-drag-files): Update doc string and
add setter.
(dired-insert-set-properties): Don't insert misleading tooltip
if feature is not available.
Andrew G Cohen [Fri, 25 Mar 2022 22:58:23 +0000 (06:58 +0800)]
; * lisp/gnus/nnselect.el (nnselect-get-artlist): Fix last change.
Andrew G Cohen [Fri, 25 Mar 2022 08:06:34 +0000 (16:06 +0800)]
; Restore regexp-quote for gnus subject match
* lisp/gnus/gnus-sum.el (gnus-summary-limit-include-thread): Restore
regexp-quote that was inadvertently dropped in commit 2021-12-21 "Fix
gnus subject matching when subject is empty".
Lars Ingebrigtsen [Fri, 25 Mar 2022 18:01:51 +0000 (19:01 +0100)]
Fix eshell-explicit-command-char doc string typo
* lisp/eshell/esh-ext.el (eshell-explicit-command-char): Fix typo
in doc string (bug#54567).
Lars Ingebrigtsen [Fri, 25 Mar 2022 16:32:40 +0000 (17:32 +0100)]
Fix (bounds-of-thing-at-point 'number)
* lisp/thingatpt.el (number): Make (bounds-of-thing-at-point
'number) work (bug#54555).
Lars Ingebrigtsen [Fri, 25 Mar 2022 16:20:35 +0000 (17:20 +0100)]
Fix reporting of read error line/columns in the init file
* src/lread.c (invalid_syntax_lisp): The comments here said that
we were supposed to be called with point in the readcharfun
buffer. This was not the case (at least) when reading the Emacs
init file, so the reported line/column was always wrong (1 and 0,
respectively) (bug#54550).
Lars Ingebrigtsen [Fri, 25 Mar 2022 15:44:01 +0000 (16:44 +0100)]
Improve pp-last-sexp ergonomics
* lisp/emacs-lisp/pp.el (pp-last-sexp): Ignore ,@?
before a sexp, because eval-ing that will always lead to an error
(bug#54537).
Po Lu [Fri, 25 Mar 2022 13:41:30 +0000 (13:41 +0000)]
Implement new drag and drop parameter on Haiku
* lisp/term/haiku-win.el (x-begin-drag): Implement
`allow-current-frame'.
* src/haiku_support.cc (be_drag_message): New argument
`allow_same_view'.
* src/haiku_support.h: Update prototypes.
* src/haikuselect.c (Fhaiku_drag_message): New parameter
`allow-same-frame'.
Po Lu [Fri, 25 Mar 2022 13:24:03 +0000 (21:24 +0800)]
Allow dragging files from dired to windows on the same frame
* doc/lispref/frames.texi (Drag and Drop): Document new
parameter to `x-begin-drag'.
* lisp/dired.el (dired-mouse-drag): Utilize new parameter.
* lisp/term/haiku-win.el (x-begin-drag): Add new parameter.
* src/xfns.c (Fx_begin_drag): New parameter
`allow-current-frame'. Fix typo and update doc string.
* src/xterm.c (x_dnd_get_window_proto): Respect
`x_dnd_allow_current_frame'.
(x_dnd_begin_drag_and_drop): New parameter
`allow_current_frame'.
* src/xterm.h: Update prototypes.
Eli Zaretskii [Fri, 25 Mar 2022 12:39:44 +0000 (15:39 +0300)]
Improve documentation of 'completion-auto-select'
* lisp/simple.el (completion-auto-select):
* doc/emacs/mini.texi (Completion Options): Improve documentation
and description of customization options of 'completion-auto-select'.
Po Lu [Fri, 25 Mar 2022 12:33:23 +0000 (20:33 +0800)]
Make it easier to select text inside dired when mouse dragging is on
* lisp/dired.el (dired-insert-set-properties): Only set drag
keymap on the filename itself.
Michael Albinus [Fri, 25 Mar 2022 08:28:44 +0000 (09:28 +0100)]
* admin/notes/emba: Mention workflow rules for branches.
Po Lu [Fri, 25 Mar 2022 08:21:17 +0000 (16:21 +0800)]
Fix quitting DND while waiting for finish
* src/xterm.c (x_dnd_begin_drag_and_drop): Always clear finish
flag before quitting.
Po Lu [Fri, 25 Mar 2022 08:15:57 +0000 (16:15 +0800)]
Take window shapes into account when processing drag and drop
* configure.ac: Test for the Nonrectangular Window Shape
extension.
* msdos/sed1v2.inp: Update.
* src/xterm.c (struct x_client_list_window): New fields for
shapes.
(x_dnd_free_toplevels): Free shapes.
(x_dnd_compute_toplevels): Populate window shapes.
(x_dnd_get_target_window_2): New function.
(x_dnd_get_target_window_1): Test WM state of window before
taking it into account.
(x_dnd_begin_drag_and_drop): Use outer window as the initial
last seen window.
(x_dnd_update_state): Small fixes to frame tracking.
(handle_one_xevent): Handle ShapeNotify events correctly.
(x_term_init): Test for the Nonrectangular Window Shape
extension.
* src/xterm.h (struct x_display_info): New atom `WM_STATE'.
Stefan Kangas [Fri, 25 Mar 2022 05:30:16 +0000 (06:30 +0100)]
Merge from origin/emacs-28
d3d6f1c9bd Clarify the description of "selected tags table"
Po Lu [Fri, 25 Mar 2022 03:09:43 +0000 (11:09 +0800)]
Use _NET_CLIENT_LIST_STACKING to optimize drag and drop window discovery
* src/xterm.c (struct x_client_list_window): New struct.
(x_dnd_free_toplevels, x_dnd_compute_toplevels)
(x_dnd_get_target_window_1): New functions.
(x_dnd_get_target_window): Search in the toplevel list if it
exists.
(x_dnd_cleanup_drag_and_drop): Clean up toplevel list.
(x_dnd_begin_drag_and_drop): Compute toplevel list if the
window manager supports it.
(handle_one_xevent): Update the toplevel list if prudent.
Philip Kaludercic [Thu, 24 Mar 2022 18:11:01 +0000 (20:11 +0200)]
Fix wrapping of 'previous-completion' at the beginning of buffer
* lisp/simple.el (next-completion): Prevent an error of
'previous-completion' at the beginning of completions buffer.
Also fix 'previous-completion' to wrap to the last completion.
(bug#54374)
Juri Linkov [Thu, 24 Mar 2022 17:54:14 +0000 (19:54 +0200)]
Small fixes for the new feature 'second-tab' of 'completion-auto-select'
* lisp/simple.el (completion-auto-select): Extend the docstring.
Eli Zaretskii [Thu, 24 Mar 2022 15:22:43 +0000 (17:22 +0200)]
Clarify the description of "selected tags table"
* doc/emacs/maintaining.texi (Select Tags Table): Clarify the
distinction between the "selected tags table" and the "current
list of tags tables". (Bug#54543)
Augusto Stoffel [Thu, 24 Mar 2022 15:05:39 +0000 (15:05 +0000)]
Handle invisible text in Eldoc when calculating size
Co-authored-by: João Távora <joaotavora@gmail.com>
* lisp/emacs-lisp/eldoc.el (eldoc--echo-area-substring,
eldoc-display-in-echo-area): Take invisible text into consideration
when counting lines to crop an echo-area message.
(Version): Bump.
Eli Zaretskii [Thu, 24 Mar 2022 14:55:28 +0000 (16:55 +0200)]
; * etc/NEWS: Fix wording of a recently added entry.
Po Lu [Thu, 24 Mar 2022 13:23:58 +0000 (21:23 +0800)]
Allow fetching events from other displays inside DND
* src/xterm.c (x_dnd_begin_drag_and_drop): Get the next event
from the app connection instead on Xt.
Mauro Aranda [Thu, 24 Mar 2022 12:41:20 +0000 (09:41 -0300)]
; Fix filename in undigest-tests.el header
Michael Albinus [Thu, 24 Mar 2022 11:50:34 +0000 (12:50 +0100)]
Adapt Tramp to dired--insert-disk-space assumptions
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Do not modify disk space information when
`dired--insert-disk-space' is available. (Bug#54512)
Lars Ingebrigtsen [Thu, 24 Mar 2022 10:39:13 +0000 (11:39 +0100)]
Fix autoinsert.el byte compilation warning
* lisp/autoinsert.el (sgml-tag): Fix a byte compilation warning.
Jimmy Aguilar Mena [Thu, 24 Mar 2022 10:23:32 +0000 (11:23 +0100)]
Merge 'completion-auto-select new value secont-tab'
This includes the second-tab value for completion-auto-select and
documentation related.
Jimmy Aguilar Mena [Thu, 24 Mar 2022 10:05:26 +0000 (11:05 +0100)]
Add documentation entries for completion-auto-select user option.
Jimmy Aguilar Mena [Tue, 22 Mar 2022 20:24:13 +0000 (21:24 +0100)]
Add completion-auto-select second-tab value.
* lisp/minibuffer.el (completion--in-region-1) : Change if with cond and
check if completion-auto-select.
* lisp/simple.el (completion-auto-select) : Move before first use.
(completion-setup-function) : Make a more precise check for when
completion-auto-select is t.
Stefan Monnier [Thu, 24 Mar 2022 09:32:10 +0000 (05:32 -0400)]
* lisp/select.el (xselect-convert-to-targets): Use `delete-dups` and `delq`
Stefan Monnier [Thu, 24 Mar 2022 09:19:19 +0000 (05:19 -0400)]
* lisp/autoinsert.el (auto-insert-alist): Expose lambdas as code
Stefan Monnier [Thu, 24 Mar 2022 09:12:45 +0000 (05:12 -0400)]
(archive-*-write-file-member): Fix relative file name
* lisp/arc-mode.el (archive-*-write-file-member): Set the pwd
Lars Ingebrigtsen [Thu, 24 Mar 2022 09:09:47 +0000 (10:09 +0100)]
Do some NEWS tagging
Po Lu [Thu, 24 Mar 2022 08:59:03 +0000 (16:59 +0800)]
Avoid crashes if async input arrives when setting properties for DND
* src/xterm.c (x_dnd_begin_drag_and_drop): Block input around
non-async signal safe functions.
Lars Ingebrigtsen [Thu, 24 Mar 2022 08:59:40 +0000 (09:59 +0100)]
Mention frame-text-* function in frame-pixel-* doc strings
* src/frame.c (Fframe_native_width, Fframe_native_height): Link to
`frame-text-*' functions.
Lars Ingebrigtsen [Thu, 24 Mar 2022 08:54:38 +0000 (09:54 +0100)]
Fix image-mode-fit-frame some more
* lisp/image-mode.el (image-mode-fit-frame): Use frame-text-width
and fit-frame-to-buffer instead of computing things ourselves
(bug#37630). This makes things work better across platforms.
Po Lu [Thu, 24 Mar 2022 08:36:47 +0000 (16:36 +0800)]
Fix some bugs with drag and drop and Mozilla
* src/xfns.c (Fx_begin_drag): Call maybe_quit when iterating
through potentially long lists. Also allow specifying
XdndActionAsk manually again, since it's useful for debugging.
* src/xterm.c (x_dnd_begin_drag_and_drop): Delete XdndActionList
and XdndActionDescription if they were not specified.
Stefan Kangas [Thu, 24 Mar 2022 08:23:31 +0000 (09:23 +0100)]
Load desktop without prompting if process is dead
* doc/emacs/misc.texi (Saving Emacs Sessions): Document the new
'check' value.
* etc/NEWS: Announce the change (bug#1474).
* lisp/desktop.el (desktop-load-locked-desktop): Add new value 'check'
to load desktop file without prompting if locking Emacs process does
not exist on the local machine. (Bug#1474)
(desktop-read): Extract function from here...
(desktop--load-locked-desktop-p): ...to here. New function handles
the semantics of 'desktop-load-locked-desktop', including above new
value 'check'.
(desktop--emacs-pid-running-p): New function.
* test/lisp/desktop-tests.el: New file with tests for the above.
Po Lu [Thu, 24 Mar 2022 05:50:55 +0000 (13:50 +0800)]
Fix setter for hl-line-sticky-flag when hl-line is not loaded
* lisp/hl-line.el (hl-line-sticky-flag): Wrap most of setter
around (featurep 'hl-line). Reported by Michael Heerdegen
<michael_heerdegen@web.de>.