Jürgen Hötzel [Fri, 4 Mar 2022 09:08:14 +0000 (10:08 +0100)]
Use correct signal oldset in posix_spawn implementation
posix_spawn was restoring the wrong signal set, which still had
SIGCHLD and SIGINT masked, causing problems with child processes that
spawned child processes. (Bug#54667)
See the thread ending at
https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00067.html
for more details.
* src/callproc.c (emacs_spawn): Pass oldset parameter.
(emacs_posix_spawn_init_attributes): Use correct oldset.
(emacs_posix_spawn_init): Remove intermediate function.
Stefan Monnier [Mon, 4 Apr 2022 13:55:03 +0000 (09:55 -0400)]
test/lisp/edmacro-tests.el: Adjust to recent changes
Stefan Monnier [Mon, 4 Apr 2022 13:13:10 +0000 (09:13 -0400)]
edmacro.el: Silence warnings due to kmacro changes
* lisp/edmacro.el (edit-kbd-macro): Use `kmacro-p` and kmacro accessors.
(edmacro-finish-edit): Use `kmacro-p` and the new `kmacro` constructor.
Po Lu [Mon, 4 Apr 2022 12:32:46 +0000 (20:32 +0800)]
Handle mouse movement correctly during DND from one of our own frames
* lisp/dnd.el (dnd-handle-movement): Select the window specified
in posn.
* lisp/term/x-win.el (x-dnd-movement): New function.
(x-dnd-movement-function): Set it as the default.
* src/frame.c (delete_frame): Prevent deleting the drop source
frame.
* src/xterm.c (x_dnd_send_position): Set new mouse movement
flags if the target window is one of our own frames.
(x_dnd_begin_drag_and_drop): Call DND movement function whenever
appropriate.
(x_free_frame_resources): Remove useless code.
(syms_of_xterm): New defvar `x-dnd-movement-function'.
* src/xterm.h: Update prototypes.
Po Lu [Mon, 4 Apr 2022 11:37:12 +0000 (11:37 +0000)]
Fix generation of extra DND events while dragging on Haiku
* src/haiku_support.cc (be_drag_message): Set new DND flag.
(be_drag_and_drop_in_progress): New function.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_read_socket): Don't store DND motion
events if DND is in progress.
Po Lu [Mon, 4 Apr 2022 11:07:01 +0000 (19:07 +0800)]
* src/xterm.c: Explain meaning of drag-and-drop state variables.
Lars Ingebrigtsen [Mon, 4 Apr 2022 10:48:47 +0000 (12:48 +0200)]
Further fixes for cl--generic-describe and (function ...)
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe): Fix the #'
problem for defmethods, too (bug#54628).
Mattias Engdegård [Mon, 21 Mar 2022 10:20:37 +0000 (11:20 +0100)]
Inline call0..8
Inlining these trivial functions gives a healthy speed boost to many
common functions such as `sort`, `mapcar` etc.
* src/eval.c (call0, ..., call8): Move functions...
* src/lisp.h (call0, ..., call8): ...here and declare them inline.
Mattias Engdegård [Wed, 16 Mar 2022 16:01:57 +0000 (17:01 +0100)]
Speed up comparisons between 2 fixnums
Since <, <=, > and >= have their own byte-ops, the corresponding
functions are mostly used as arguments to higher-order functions.
This optimisation is particularly beneficial for sorting, where the
comparison function is time-critical.
* src/data.c (Flss, Fgtr, Fleq, Fgeq):
* src/fileio.c (Fcar_less_than_car):
Fast path for calls with 2 fixnum arguments.
Mattias Engdegård [Wed, 16 Mar 2022 15:24:24 +0000 (16:24 +0100)]
Rewrite string-greaterp and string> using string-lessp
Since string-lessp has its own byte-op, using it is much faster than
calling string-greaterp even with the need to bind a temporary
variable.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-string-greaterp): New.
(string-greaterp, string>): Set byte-optimizer.
Mattias Engdegård [Wed, 16 Mar 2022 14:17:19 +0000 (15:17 +0100)]
Faster `string-lessp` for unibyte arguments
Since this function is commonly used as a sorting predicate
where it is time-critical, this is a useful optimisation.
* src/fns.c (Fstring_lessp): Add fast path for the common case
when both arguments are unibyte.
* test/src/fns-tests.el (fns-tests--string-lessp-cases)
(fns-tests-string-lessp): New test.
Po Lu [Mon, 4 Apr 2022 05:42:36 +0000 (13:42 +0800)]
Respect frame extents during drag and drop
* xterm.c (struct x_client_list_window): New fields for frame
extents.
(x_dnd_compute_toplevels): Set window frame extents.
(x_dnd_get_target_window_1): Return None if the mouse is in a
frame extent.
(x_dnd_get_target_window): Likewise.
Po Lu [Mon, 4 Apr 2022 05:17:18 +0000 (13:17 +0800)]
Don't baselessly ignore frames after passing through the root window
* src/xterm.c (x_dnd_begin_drag_and_drop):
(handle_one_xevent): Don't rely on target not being None to set
x_dnd_return_frame to 2.
Po Lu [Mon, 4 Apr 2022 05:10:01 +0000 (13:10 +0800)]
Improve behavior of dragging text to windows on top of frames
* doc/lispref/frames.texi (Drag and Drop): Document new meaning
of `return-frame' in `x-begin-drag'.
* lisp/mouse.el (mouse-drag-and-drop-region): Use `now' when
calling `x-begin-drag'.
* src/xfns.c (Fx_begin_drag): Update doc string.
* src/xterm.c (x_dnd_begin_drag_and_drop): Accept return_frame
as a Lisp_Object and handle Qnow correctly.
(XTmouse_position): Ignore tooltip frames when processing
`drag-source'.
(syms_of_xterm): New defsym `now'.
* src/xterm.h: Update prototypes.
Andrew G Cohen [Thu, 10 Mar 2022 01:30:00 +0000 (09:30 +0800)]
Replace list and vector sorting with TIMSORT algorithm
* src/Makefile.in (base_obj): Add sort.o.
* src/deps.mk (fns.o): Add sort.c.
* src/lisp.h: Add prototypes for inorder, tim_sort.
* src/sort.c: New file providing tim_sort.
* src/fns.c: Remove prototypes for removed routines.
(merge_vectors, sort_vector_inplace, sort_vector_copy): Remove.
(sort_list, sort_vector): Use tim_sort.
* test/src/fns-tests.el (fns-tests-sort): New sorting unit tests.
Mattias Engdegård [Sat, 5 Mar 2022 10:12:54 +0000 (11:12 +0100)]
Add optional GC marking function to specpdl unwind_ptr record
Add a new `record_unwind_protect_ptr_mark` function for use with C data
structures that use the specpdl for clean-up but also contain possibly
unique references to Lisp objects.
* src/eval.c (record_unwind_protect_ptr_mark): New.
(record_unwind_protect_module, set_unwind_protect_ptr):
Set the mark function to NULL.
(mark_specpdl): Call the mark function if present.
* src/lisp.h (unwind_ptr): Add a mark function pointer to the
SPECPDL_UNWIND_PTR case.
Po Lu [Sun, 3 Apr 2022 23:25:27 +0000 (07:25 +0800)]
* src/xterm.c (x_dnd_get_target_window): Look at root window proxies too.
Juri Linkov [Sun, 3 Apr 2022 16:51:46 +0000 (19:51 +0300)]
* lisp/tab-bar.el (tab-bar-undo-close-tab): Update tab-bar-lines (bug#54684)
Philipp Stephani [Sun, 3 Apr 2022 15:51:04 +0000 (17:51 +0200)]
; * lisp/emacs-lisp/cl-macs.el (cl-struct-slot-value): Fix typo.
Po Lu [Sun, 3 Apr 2022 13:35:28 +0000 (13:35 +0000)]
Fix various bugs with mouse dragging on Haiku
* src/haikuterm.c (haiku_mouse_position): Rewrite so that
different track-mouse types can be handled more consistently.
Jim Porter [Sun, 27 Mar 2022 19:09:58 +0000 (12:09 -0700)]
Fix handling of '\\' inside double-quotes in Eshell
Previously, Eshell would get confused and think the following command
was unterminated due to the second double-quote looking like it was
escaped:
echo "\\"
* lisp/eshell/esh-util.el (eshell-find-delimiter): Correct docstring
and treat '\' as an escapeable character when using backslash escapes.
* test/lisp/eshell/eshell-tests.el
(eshell-test/escape-special-quoted): Adapt test.
James Thomas [Sun, 3 Apr 2022 12:14:24 +0000 (14:14 +0200)]
Ensure re-encoding after change in gnus-inews-do-gcc
* lisp/gnus/gnus-msg.el (gnus-inews-do-gcc): Re-encode the message
body if it has been modified by gnus-gcc-pre-body-encode-hook
(bug#54687).
Lars Ingebrigtsen [Sun, 3 Apr 2022 12:07:55 +0000 (14:07 +0200)]
Have global minor modes say so in the doc string
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Allow
saying whether it's a global minor mode or not.
(easy-mmode--mode-docstring): Use it.
(define-minor-mode): Pass in the data.
Po Lu [Sun, 3 Apr 2022 11:33:52 +0000 (19:33 +0800)]
Implement `drag-source' values of `track-mouse' on PGTK.
* src/frame.c (Fmouse_position, mouse_position)
(Fmouse_pixel_position): Fix crashes when mouse_position_hook
stores nil.
* src/pgtkterm.c (pgtk_mouse_position): Behave appropriately.
Po Lu [Sun, 3 Apr 2022 11:20:56 +0000 (19:20 +0800)]
Implement `drag-source' values of track-mouse on NS
* src/nsterm.m (ns_mouse_position): Don't return frame when
appropriate.
Po Lu [Sun, 3 Apr 2022 11:08:42 +0000 (11:08 +0000)]
Implement (sort of) `drag-source' on Haiku
* src/haikuterm.c (haiku_mouse_or_wdesc_frame)
(haiku_mouse_position): Behave reasonably when track_mouse is
Qdrag_source.
Po Lu [Sun, 3 Apr 2022 10:59:12 +0000 (18:59 +0800)]
Make dragging stuff to a window above a frame work
* doc/lispref/frames.texi (Mouse Tracking):
* etc/NEWS: Announce new `drag-source' value of `track-mouse'.
* lisp/mouse.el (mouse-drag-and-drop-region): Use new value of
`track-mouse' during interprogram drag and drop.
* src/keyboard.c (make_lispy_position): Handle nil values of f
correctly.
* src/xdisp.c (define_frame_cursor1): Ignore if `drag-source' as
well.
(syms_of_xdisp): New defsym `drag-source'.
* src/xterm.c (XTmouse_position): Implement `drag-source'.
(mouse_or_wdesc_frame): Likewise.
Po Lu [Sun, 3 Apr 2022 07:23:01 +0000 (15:23 +0800)]
Don't touch WAYLAND_DISPLAY in browse-url
* lisp/net/browse-url.el (browse-url): Don't touch
WAYLAND_DISPLAY. (bug#53969)
Po Lu [Sun, 3 Apr 2022 05:32:25 +0000 (13:32 +0800)]
Look for DND proxies on the root window as well
* src/xterm.c (x_dnd_get_target_window): If nothing was found on
the COW, look at the root window.
Po Lu [Sun, 3 Apr 2022 01:59:14 +0000 (09:59 +0800)]
Implement new DND features on GNUstep
* lisp/term/ns-win.el (ns-drag-n-drop): Handle special `lambda'
drag-n-drop events.
* src/nsterm.m: ([EmacsView wantsPeriodicDraggingUpdates]):
([EmacsView draggingUpdated:]): New functions.
Po Lu [Sun, 3 Apr 2022 01:26:32 +0000 (01:26 +0000)]
Implement new DND options on Haiku
* lisp/term/haiku-win.el (haiku-drag-and-drop): Handle special
drag and drop motion events.
* src/haiku_support.cc (MouseMoved): Set `dnd_message' flag.
* src/haiku_support.h (struct haiku_mouse_motion_event): New
member `dnd_message'.
* src/haikuterm.c (haiku_read_socket): Create special DND events
when the mouse moves with a drop message.
Po Lu [Sun, 3 Apr 2022 01:14:24 +0000 (09:14 +0800)]
Add user options to move point and scroll window during DND
* doc/emacs/frames.texi (Drag and Drop):
* etc/NEWS: Document new options 'dnd-scroll-margin' and
'dnd-indicate-insertion-point'.
* lisp/dnd.el (dnd-protocol-alist):
(dnd-open-remote-file-function):
(dnd-open-file-other-window): Add right group to defcustoms.
(dnd-scroll-margin, dnd-indicate-insertion-point): New user
options.
(dnd-handle-movement): New function.
* lisp/x-dnd.el (x-dnd-handle-xdnd):
(x-dnd-handle-motif): Call `dnd-handle-movement' when
appropriate.
Po Lu [Sun, 3 Apr 2022 00:52:26 +0000 (08:52 +0800)]
Fix Motif drag-and-drop on servers without XI2
* src/xterm.c (handle_one_xevent): Pass right flags to the
receiver when handling drops for core button events.
Po Lu [Sun, 3 Apr 2022 00:42:52 +0000 (08:42 +0800)]
Fix incorrect usage of XM_DRAG_SIDE_EFFECT
* src/xterm.c (xm_send_top_level_leave_message)
(handle_one_xevent): Pass corret alt side effects and flags to
XM_DRAG_SIDE_EFFECT.
Basil L. Contovounesios [Sat, 2 Apr 2022 16:40:05 +0000 (19:40 +0300)]
; Pacify obsoletion warnings in image-tests.el.
Lars Ingebrigtsen [Sat, 2 Apr 2022 14:53:24 +0000 (16:53 +0200)]
Fix bootstrap errors after previous easy-mmode change
* lisp/subr.el (ensure-empty-lines, string-lines): Moved from
subr-x so that they can be used in early bootstrap files.
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring):
Don't use string-empty-p because of bootstrap issues.
Lars Ingebrigtsen [Sat, 2 Apr 2022 14:36:39 +0000 (16:36 +0200)]
Fix regression in tex alignment
* lisp/align.el (align-rules-list): Make alignment in tex mode
work better again (bug#54663).
Sean Whitton [Sat, 2 Apr 2022 14:08:41 +0000 (16:08 +0200)]
em-extpipe: Catch eshell-incomplete thrown while parsing
* lisp/eshell/em-extpipe.el (em-extpipe--or-with-catch): New macro.
(eshell-parse-external-pipeline): Use new macro to treat
`eshell-incomplete' as a failure of the parse function to move us
forward (Bug#54603). Thanks to Jim Porter <jporterbugs@gmail.com> for
the report and for help isolating the problem.
* test/lisp/eshell/eshell-tests.el
(eshell-test/lisp-command-with-quote): New test for Bug#54603, thanks
to Jim Porter <jporterbugs@gmail.com> (bug#54603).
August Feng [Sat, 2 Apr 2022 14:01:43 +0000 (16:01 +0200)]
Add S-SPC key sequence to bookmark-bmenu-mode-map
* lisp/bookmark.el (bookmark-bmenu-mode-map): Add an S-SPC binding
for symmetry (bug#54672).
Copyright-paperwork-exempt: yes
Lars Ingebrigtsen [Sat, 2 Apr 2022 13:55:29 +0000 (15:55 +0200)]
Put the define-minor-mode boilerplate at the end of the doc strings
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Put
the boilerplate at the end of the doc string.
Eli Zaretskii [Sat, 2 Apr 2022 13:45:26 +0000 (16:45 +0300)]
; Improve documentation of 'font-lock-ignore'
* etc/NEWS:
* lisp/font-lock.el (font-lock-ignore):
* doc/lispref/modes.texi (Customizing Keywords): Clarify the
documentation of 'font-lock-ignore'.
* doc/emacs/display.texi (Font Lock): Mention 'font-lock-ignore'.
Lars Ingebrigtsen [Sat, 2 Apr 2022 13:19:05 +0000 (15:19 +0200)]
Further tweaks to cl--generic-describe
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe): Further
tweak the look of the implementation output.
Po Lu [Sat, 2 Apr 2022 12:48:09 +0000 (20:48 +0800)]
* lisp/dired.el (dired-mouse-drag): Offer HOST_NAME as well.
Po Lu [Sat, 2 Apr 2022 12:12:12 +0000 (20:12 +0800)]
Fix crash when retrieving window property with invalid atom data
This happens when dropping files from dtfile, which somehow puts
non-atom stuff in window properties of type ATOM_PAIR.
* src/xselect.c (x_atom_to_symbol): Catch errors around
XGetAtomName.
Po Lu [Sat, 2 Apr 2022 08:38:19 +0000 (16:38 +0800)]
Compute size of structs with flexible arrays correctly in Motif DND code
* src/xterm.c (xm_read_targets_table_rec, xm_setup_dnd_targets):
Use FLEXSIZEOF instead of sizeof on struct xm_targets_table_rec.
Po Lu [Sat, 2 Apr 2022 08:31:06 +0000 (16:31 +0800)]
; * src/sqlite.c: Fix up header comment.
Po Lu [Sat, 2 Apr 2022 07:59:15 +0000 (15:59 +0800)]
Fix error on mouse move over something not a window while dragging text
* lisp/mouse.el (mouse-drag-and-drop-region): Handle non-window
values of `posn-window' correctly.
Po Lu [Sat, 2 Apr 2022 07:48:57 +0000 (15:48 +0800)]
; * lisp/mouse.el (mouse-drag-and-drop-region-scroll-margin): Fix type.
Po Lu [Sat, 2 Apr 2022 07:45:00 +0000 (15:45 +0800)]
Add new option `mouse-drag-and-drop-region-scroll-margin'
* etc/NEWS: Announce new user option.
* lisp/mouse.el (mouse-drag-and-drop-region-scroll-margin): New
user option.
(mouse-drag-and-drop-region): Implement "scroll margin" like
behavior during mouse movement.
Po Lu [Sat, 2 Apr 2022 06:59:08 +0000 (14:59 +0800)]
Implement DELETE selection target for cross program drags
* lisp/mouse.el (mouse-drag-and-drop-region): Make sure mark
stays deactivated if a "cut" operation was performed.
* lisp/select.el (xselect-convert-to-delete): Don't clear
selection contents if it's the XdndSelection.
Po Lu [Sat, 2 Apr 2022 03:44:15 +0000 (11:44 +0800)]
Work around dynamic drag bugs in modern Motif
* src/xterm.c (xm_send_top_level_leave_message): Send a motion
event with impossible coordinates by default.
(handle_one_xevent): Slightly update drop motion message
parameters.
(syms_of_xterm): New variable `x-dnd-fix-motif-leave'.
Po Lu [Sat, 2 Apr 2022 01:53:03 +0000 (09:53 +0800)]
Make Motif drag work on window managers that don't support client lists
* xterm.c (x_dnd_send_xm_leave_for_drop): New function.
(x_dnd_get_wm_state_and_proto): New field `motif_out'.
(x_dnd_get_target_window): Return Motif protocol style if
looking for windows via XTranslateCoordinates.
(x_dnd_cleanup_drag_and_drop, x_dnd_begin_drag_and_drop)
(x_dnd_update_state, handle_one_xevent): Send toplevel leave
along with drops.
Dmitry Gutov [Sat, 2 Apr 2022 01:34:52 +0000 (04:34 +0300)]
* lisp/progmodes/xref.el (xref-search-program): Fix typo.
Manuel Uberti [Mon, 28 Mar 2022 12:26:50 +0000 (14:26 +0200)]
Support ugrep in xref-search-program-alist
* lisp/progmodes/xref.el
(xref-search-program-alist)
(xref-search-program): Add entries for ugrep (bug#54608).
Stefan Monnier [Sat, 2 Apr 2022 00:07:33 +0000 (20:07 -0400)]
kmacro: Represent it as an OClosure
Merge the old lambda+list into a single OClosure object which plays
both roles at the same time. Take advantage of it to provide a
`cl-print-object` method so kmacro objects print nicely using the
`key-parse` syntax.
Also replace the old `kmacro-lambda-form` with a new `kmacro` constructor
which takes a `key-parse` syntax, so that the code inserted with
`insert-kbd-macro` is now more readable.
* lisp/kmacro.el (kmacro): New OClosure type.
(kmacro-ring-head): Use `kmacro` constructor.
(kmacro-push-ring): Convert `elt` from old representation if needed.
(kmacro-split-ring-element, kmacro-view-ring-2nd, kmacro-view-macro):
Adapt to new representation.
(kmacro-exec-ring-item): Turn into obsolete alias.
(kmacro-call-ring-2nd, kmacro-end-or-call-macro): Adjust accordingly.
(kmacro-start-macro): Simplify call to `kmacro-push-ring`.
(kmacro): New constructor function. Replaces `kmacro-lambda-form`.
(kmacro-lambda-form): Use it and declare obsolete.
(kmacro-extract-lambda): Rewrite and declare obsolete.
(kmacro-p): Rewrite.
(cl-print-object): New method.
(kmacro-bind-to-key, kmacro-name-last-macro): Simplify.
* lisp/macros.el (macro--string-to-vector): New function.
(insert-kbd-macro): Use it. Generate code using the `kmacro` constructor.
* test/lisp/kmacro-tests.el (kmacro-tests-kmacro-bind-to-single-key):
Silence warning.
(kmacro-tests-name-last-macro-bind-and-rebind): Strengthen the test a bit.
(kmacro-tests--cl-print): New test.
Andrew G Cohen [Fri, 1 Apr 2022 06:10:51 +0000 (14:10 +0800)]
; gnus/nnselect must get headers from the right group
* lisp/gnus/nnselect.el (nnselect-retrieve-headers): Make sure we are
in the right group. It might have been affected by another request.
Eli Zaretskii [Fri, 1 Apr 2022 19:00:04 +0000 (22:00 +0300)]
; * etc/NEWS: Fix typos. Reported by "T.V Raman" <raman@google.com>.
Augusto Stoffel [Tue, 8 Mar 2022 10:23:56 +0000 (11:23 +0100)]
New user option 'font-lock-ignore'
* lisp/font-lock (font-lock-ignore): New defcustom.
(font-lock-compile-keywords): Call 'font-lock--filter-keywords'.
(font-lock--match-keyword, font-lock--filter-keywords): New functions,
implement the functionality described in 'font-lock-ignore'.
* doc/lispref/modes.texi: Describe 'font-lock-ignore'.
Stefan Monnier [Fri, 1 Apr 2022 14:02:32 +0000 (10:02 -0400)]
cl-generic: Rework obsolescence checks for defmethod
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Silence obsolescence
warnings in the included methods.
(cl-defmethod): Reuse standard obsolescence checks.
* lisp/emacs-lisp/seq.el (seq-contains): Remove redundant
`with-suppressed-warnings`.
Ignacio [Sun, 13 Mar 2022 20:05:18 +0000 (21:05 +0100)]
Better check for when clipboard or primary selection have changed
Previously it was done by just comparing new and old selection
text, now we use also selection timestamps for systems that
support it (only enabled in X for now). (bug#53894)
* lisp/select.el: (gui--last-selection-timestamp-clipboard)
(gui--last-selection-timestamp-primary): New variables.
(gui--set-last-clipboard-selection)
(gui--set-last-primary-selection)
(gui--clipboard-selection-unchanged-p)
(gui--primary-selection-unchanged-p): New functions.
Stefan Monnier [Fri, 1 Apr 2022 12:54:55 +0000 (08:54 -0400)]
OClosure: Add support for defmethod dispatch
* lisp/emacs-lisp/oclosure.el (oclosure--class): Add slot `allparents`.
(oclosure--class-make): Add corresponding arg `allparents`.
(oclosure, oclosure--build-class): Pass the new arg to the constructor.
(oclosure--define): Make the predicate function understand subtyping.
* lisp/emacs-lisp/cl-preloaded.el (cl--class-allparents): Move from
`cl-generic.el`.
* lisp/emacs-lisp/cl-generic.el (cl--generic-class-parents): Move to
`cl-preloaded.el` and rename to `cl--class-allparents`.
Adjust all callers.
(cl--generic-oclosure-tag, cl-generic--oclosure-specializers): New functions.
(cl-generic-generalizers) <oclosure-struct>: New generalizer.
* test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test-gen):
New generic function.
(oclosure-test): Add test for dispatch on oclosure types.
Po Lu [Fri, 1 Apr 2022 11:57:42 +0000 (19:57 +0800)]
Implement the Motif drag protocol
* src/xterm.c (struct x_client_list_window): New field
`xm_protocol_style'.
(xm_top_level_enter_message, xm_drag_motion_message)
(xm_top_level_leave_message): New structures.
(xm_setup_drag_info, xm_send_top_level_enter_message)
(xm_send_drag_motion_message, xm_send_top_level_leave_message):
New functions.
(x_dnd_compute_toplevels): Compute `xm_protocol_style'.
(x_dnd_get_target_window_1, x_dnd_get_target_window): New
parameter `motif_out'. Place the xm protocol style in it if
necessary.
(x_dnd_cleanup_drag_and_drop, x_dnd_begin_drag_and_drop)
(x_dnd_update_state, handle_one_xevent): Handle Motif drag
protocol messages.
(x_free_frame_resources): Cancel Motif drag protocol operations
correctly.
Protesilaos Stavrou [Fri, 1 Apr 2022 09:51:14 +0000 (12:51 +0300)]
Update modus-themes to their version 2.3.0
* doc/misc/modus-themes.org (Enable and load): Clarify wording.
(Sample configuration with and without use-package): Improve sample
code on how to set up the themes.
(Customization Options): Update sample configuration.
(Option for box buttons, Option for mode line presentation)
(Option for completion framework aesthetics)
(Option for Org agenda constructs)
(Option for the headings' overall style): Document how to optionally
pass number values as a cons cell.
(Option for mouseover effects): Document new boolean user option.
(More accurate colors in terminal emulators): Write about the color
range in terminal emulators and provide sample palette for XTerm.
(Override colors): Use American English.
(Near-monochrome syntax highlighting): Provide sample code on how to
achieve a monochrome style.
(Full support for packages or face groups)
(Indirectly covered packages): Update lists of supported packages.
(Note on display-fill-column-indicator-mode): Reword node.
(Note on prism.el): Use American English.
(Note on SHR colors): Clarify statement.
(Note on the Notmuch logo): Remark that the Notmuch logo can be
disabled.
(Port the Modus themes to other platforms?): Use American English.
(Sources of the themes): Fix capitalization of proper nouns.
(Acknowledgements): Update list of contributors to the project.
* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-vivendi-theme.el: Ensure that the theme is reified
as expected both at compiletime and runtime.
* etc/themes/modus-themes.el (require): Require 'cl-lib' and 'subr-x'
at compiletime.
(seq): Require the 'seq' library.
(modus-themes-completion-standard-first-match)
(modus-themes-completion-standard-selected)
(modus-themes-completion-extra-selected): Use correct symbol for
deprecated faces.
(modus-themes-slanted-constructs): Provide it as an alias of
'modus-themes-italic-constructs'.
(modus-themes-variable-pitch-headings): Remove obsolete user option.
(modus-themes-no-mixed-fonts): Remove obsolete user option alias.
(modus-themes-intense-mouseovers): Add new user option.
(modus-themes--headings-choice): Accept value as a cons cell.
(modus-themes-headings, modus-themes-org-agenda): Update user option
to accept number value as a cons cell.
(modus-themes-scale-headings, modus-themes-scale-1, modus-themes-scale-2)
(modus-themes-scale-3, modus-themes-scale-4, modus-themes-scale-title)
(modus-themes-scale-small): Remove obsolete user options.
(modus-themes-mode-line): Update user option to accept number values
as cons cells.
(modus-themes-mode-line-padding): Remove obsolete user option.
(modus-themes-completions): Add support for the 'text-also' property
and update it accordingly.
(modus-themes-success-deuteranopia): Remove obsolete user option.
(modus-themes-box-buttons): Update user option to accept number values
as cons cells.
(modus-themes--warn, modus-themes--list-or-warn)
(modus-themes--alist-or-seq): Add functions to check for correct value
in some user options.
(modus-themes--current-theme): Return the first Modus theme from
'current-enable-themes' (bug#54598).
(modus-themes--lang-check, modus-themes--prompt, modus-themes--paren)
(modus-themes--syntax-foreground, modus-themes--syntax-extra)
(modus-themes--syntax-string, modus-themes--syntax-comment)
(modus-themes--heading, modus-themes--agenda-structure)
(modus-themes--agenda-date, modus-themes--mode-line-attrs)
(modus-themes--completion, modus-themes--link, modus-themes--link-color)
(modus-themes--region, modus-themes--hl-line, modus-themes--button):
Make private functions check for the desired value. Refine them where
necessary.
(modus-themes-faces, modus-themes-custom-variables): Update supported
faces and relevant variables.
Michael Albinus [Fri, 1 Apr 2022 07:01:35 +0000 (09:01 +0200)]
More robust checks for directory buffers in image-mode
* lisp/image-mode.el (image-mode--directory-buffers): Apply more
robust checks for directory buffers. (Bug#54606)
Po Lu [Fri, 1 Apr 2022 06:13:44 +0000 (14:13 +0800)]
Only read 16 bytes of motif drag receiver info
* src/xterm.c (xm_drag_receiver_info): Only read 16 bytes of
receiver info.
(handle_one_xevent): Fix default XM drop action.
Po Lu [Fri, 1 Apr 2022 03:59:38 +0000 (03:59 +0000)]
Simplify Haiku drag-and-drop implementation
* lisp/term/haiku-win.el (x-begin-drag): Bind `mouse-highlight'
to nil.
* src/haikuselect.c (haiku_unwind_drag_message)
(Fhaiku_drag_message):
* src/haikuterm.h (HAVE_CHAR_CACHE_MAX):
* src/xdisp.c (note_mouse_highlight): Delete
`haiku_dnd_in_progress' variable.
Po Lu [Fri, 1 Apr 2022 03:50:14 +0000 (11:50 +0800)]
Support Motif DND help
* src/xterm.c (x_dnd_xm_use_help): New state variable.
(x_dnd_begin_drag_and_drop): Clear new variable.
(handle_one_xevent): Set new variable if we get a key press
event F1 during the drag-and-drop session, and use help action
when dropping onto a Motif program if it is set.
Po Lu [Fri, 1 Apr 2022 02:29:00 +0000 (10:29 +0800)]
; * src/xterm.c: Update commentary.
Po Lu [Fri, 1 Apr 2022 01:50:58 +0000 (09:50 +0800)]
Make dropping files on Motif programs work
* lisp/dired.el (dired-mouse-drag): Announce "FILE" and
"FILE_NAME" as targets as well.
* lisp/select.el (xselect-convert-to-filename): Handle
XdndSelection specially.
(xselect-convert-to-xm-file): New function.
(selection-converter-alist): Add new converters.
Po Lu [Fri, 1 Apr 2022 00:47:45 +0000 (08:47 +0800)]
Avoid extra sync if we didn't get the right wmstate
* src/xterm.c (x_dnd_get_wm_state_and_proto): Always set proto
version.
(x_dnd_get_target_window): Optimize accordingly.
Po Lu [Fri, 1 Apr 2022 00:39:40 +0000 (08:39 +0800)]
Fix a build warning on the non-XI2 build
* src/xterm.c (xm_read_drop_start_reply): Take a const XEvent as
msg.
Eli Zaretskii [Thu, 31 Mar 2022 16:15:45 +0000 (19:15 +0300)]
Fix a bug in configure.ac that failed the --without-x build
* configure.ac (USE_TOOLKIT_SCROLL_BARS): Fix test for unsupported
scroll-bars configuration. (Bug#54629)
Po Lu [Thu, 31 Mar 2022 13:53:04 +0000 (21:53 +0800)]
Fix Motif DND on window managers that don't support client lists
* src/xterm.c (x_dnd_compute_toplevels): Fix usage of
`x_uncatch_errors_after_check'.
(x_dnd_get_wm_state_and_proto): New function.
(x_dnd_get_target_window): Also return first toplevel window
found.
Po Lu [Thu, 31 Mar 2022 13:28:09 +0000 (21:28 +0800)]
Implement missing parts of the Motif drag and drop protocol
* src/xterm.c (xm_drop_start_reply): New structure.
(xm_get_drag_window): Don't grab the server since this leads to
weird freezes when creating the drag window.
(xm_read_drop_start_reply): New function.
(x_dnd_begin_drag_and_drop): Set Motif finish flag to 0.
(handle_one_xevent): When starting a motif drop, set the finish
flag to 1. When the receiver replies to our drop message, set
the finish flag to 2 if the drop was accepted, and only clear
the waiting for finish flag when a selection request for
XmTRANSFER_SUCCESS or XmTRANSFER_FAILURE arrives.
(x_term_init): New atoms.
* src/xterm.h (struct x_display_info): New atoms.
Lars Ingebrigtsen [Thu, 31 Mar 2022 11:36:40 +0000 (13:36 +0200)]
Tweak how functions are formatted in Implementation in *Help*
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe): Include
the function name in the implementations (bug#54628). This
clarifies what we're talking about here, and avoids getting
(function ...) translated into #'...
Po Lu [Thu, 31 Mar 2022 10:52:01 +0000 (18:52 +0800)]
Minor fixes to treatment of `allow_current_frame'
* src/xterm.c (x_dnd_send_drop): Don't send special event for
wrong frame.
(x_dnd_send_drop): Fix condition for returning
XdndActionPrivate.
Po Lu [Thu, 31 Mar 2022 09:30:13 +0000 (17:30 +0800)]
; * src/xterm.c (handle_one_xevent): Respect current window in Motif DND.
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.