Paul Eggert [Wed, 6 Apr 2022 00:48:05 +0000 (17:48 -0700)]
Port Org encode-time usage back to Emacs 25
* lisp/org/ol.el (org-store-link):
* lisp/org/org-clock.el (org-clock-sum)
(org-clock-update-time-maybe):
* lisp/org/org-colview.el (org-colview-construct-allowed-dates):
* lisp/org/org-macro.el (org-macro--vc-modified-time):
* lisp/org/org-macs.el (org-2ft, org-matcher-time):
* lisp/org/org-table.el (org-table-eval-formula):
* lisp/org/org.el (org-read-date, org-display-custom-time)
(org-time-string-to-time, org-timestamp-change):
Don’t assume Emacs 27 encode-time, since standalone Org still
works with Emacs 25 and it’s easier if we minimize differences
from standalone Org. Problem reported by Max Nikulin (Bug#54731).
This reverts much of 2021-12-16T17:40:21Z!eggert@cs.ucla.edu.
Paul Eggert [Wed, 6 Apr 2022 00:20:34 +0000 (17:20 -0700)]
Pacify gcc -Wanalyzer-null-dereference
* src/xterm.c (handle_one_xevent): Don’t dereference HOLD_QUIT if
it’s null. Potential problem found with gcc 11.2.1 20220127 (Red
Hat 11.2.1-9), when configured with --enable-gcc-warnings.
Juri Linkov [Tue, 5 Apr 2022 19:20:16 +0000 (22:20 +0300)]
New commands for navigating completions from the minibuffer.
* lisp/simple.el (minibuffer-local-shell-command-map):
* lisp/minibuffer.el (minibuffer-local-completion-map):
Bind "M-<up>" to minibuffer-choose-previous-completion,
"M-<down>" to minibuffer-choose-next-completion,
"M-S-<up>" to minibuffer-previous-completion,
"M-S-<down>" to minibuffer-next-completion,
"M-RET" to minibuffer-choose-completion.
(with-minibuffer-completions-window): New macro.
(minibuffer-previous-completion, minibuffer-next-completion)
(minibuffer-choose-previous-completion)
(minibuffer-choose-next-completion)
(minibuffer-choose-completion): New commands.
Juri Linkov [Tue, 5 Apr 2022 18:54:11 +0000 (21:54 +0300)]
Use base prefix and suffix instead of completion-base-position (bug#49931)
* lisp/minibuffer.el (minibuffer-completion-help):
Set completion-base-affixes from base-prefix and base-suffix.
In completion-list-insert-choice-function handle
string values of start/end as prefix/suffix.
* lisp/simple.el (completion-base-affixes)
(completion-use-base-affixes): New variables.
(choose-completion): Let-bind base-affixes to completion-base-affixes.
Use base-affixes when completion-use-base-affixes is non-nil.
(completion-setup-function): Sync values of base-affixes and
completion-base-affixes.
Juri Linkov [Tue, 5 Apr 2022 17:52:28 +0000 (20:52 +0300)]
* test/lisp/replace-tests.el: New tests for query-replace (bug#54733)
* test/lisp/replace-tests.el (query-replace-tests): New defconst.
(query-replace--perform-tests): New function.
(query-replace-tests, query-replace-search-function-tests): New ert-deftest.
Robert Pluim [Tue, 1 Mar 2022 14:24:08 +0000 (15:24 +0100)]
Reject invalid time-string in appt-add immediately
* lisp/calendar/appt.el (appt-add): Check the provided time-string for
validity immediately after reading it rather than after reading all
the parameters. (Bug#54210)
Michael Albinus [Tue, 5 Apr 2022 15:08:03 +0000 (17:08 +0200)]
Handle remote system processes
* doc/lispref/files.texi (Magic File Names):
Add list-system-processes and process-attributes.
* doc/lispref/processes.texi (System Processes): Document changes
in list-system-processes and process-attributes.
* doc/misc/tramp.texi (Customizing Completion): Use @ftable.
(Remote processes): Document changes in list-system-processes and
process-attributes.
* etc/NEWS: Document changes in proced, list-system-processes and
process-attributes.
* lisp/proced.el (proced-show-remote-processes): New defcustom.
(proced-remote-directory): Remove.
(proced-filter-alist): Use it.
(proced-user-name): New defun.
(proced-available): Set it to t.
(proced-mode): Adapt docstring.
(proced): Adapt docstring. Acknowledge prefix argument.
(proced-format): Change initialization of `standard-attributes'.
(proced-send-signal, proced-renice): Adapt docstring. Remove
special handling of prefix argument.
Po Lu [Tue, 5 Apr 2022 12:03:48 +0000 (20:03 +0800)]
Mark some data during drag-and-drop
It doesn't make sense to prevent the return frame or movement
frame from being deleted, but we should at least protect them
from garbage collection.
* src/alloc.c (garbage_collect): Call mark_xterm.
* src/xterm.c (x_dnd_begin_drag_and_drop)
(x_dnd_cleanup_drag_and_drop): Clear movement and return frames
upon DND completion.
(mark_xterm): Mark those frames.
* src/xterm.h: Update prototypes.
* lisp/minibuffer.el (completion--insert-one-column) : Remove the extra
new-line at the end.
* lisp/simple.el (next-completion) : Fix behavior when
completion-wrap-movement and remove bobp and eobp. This removes the
extra tab ad the end of the list before wrapping or going to the
minibuffer and apparently also fixes bug#54374
(switch-to-completions) : Simplify condition code and remove comment not
applicable anymore.
Po Lu [Tue, 5 Apr 2022 08:19:02 +0000 (16:19 +0800)]
Allow dropping text to the root window
* src/xterm.c (x_dnd_send_unsupported_drop): Allow dropping to
the root window.
(handle_one_xevent): Send unsupported drops to the last toplevel
instead of the target window.
Po Lu [Tue, 5 Apr 2022 03:37:29 +0000 (11:37 +0800)]
Add support for dragging text onto windows that don't support any DND protocol
* src/xselect.c (x_own_selection): Export function.
(x_handle_selection_request): Handle selection requests to the
pending DND time.
(x_set_pending_dnd_time): New function.
* src/xterm.c (x_dnd_send_unsupported_drop): New function.
Implement according to the suggestions in the XDND protocol
specification.
(x_dnd_get_target_window): Return the toplevel window as well.
(x_dnd_cleanup_drag_and_drop, x_dnd_begin_drag_and_drop)
(x_dnd_update_state, handle_one_xevent): Send unsupported drops
and use last seen toplevel instead of target for `return_frame'.
* src/xterm.h: Update prototypes.
Po Lu [Tue, 5 Apr 2022 00:54:03 +0000 (00:54 +0000)]
Respect new DND options when dragging to ourselves on Haiku
* lisp/mouse.el (mouse-drag-and-drop-region): Allow dragging to
the current frame if we know `return-frame' doesn't work.
* lisp/term/haiku-win.el (haiku-dnd-drag-handler): New function.
* src/haiku_support.cc (MouseMoved): Don't send drag motion
events for the drag frame.
* src/haikuselect.c (haiku_note_drag_motion_1)
(haiku_note_drag_motion_2, haiku_note_drag_motion): New
functions.
(syms_of_haikuselect): New variable `haiku-drag-track-function'.
* src/haikuterm.c (haiku_read_socket): Note mouse motion in that
case.q
* src/haikuterm.h: Update prototypes.
Stefan Monnier [Mon, 4 Apr 2022 19:06:47 +0000 (15:06 -0400)]
OClosure: add support for `slot-value`
* lisp/emacs-lisp/oclosure.el (oclosure--slot-index)
(oclosure--slot-value, oclosure--set-slot-value): New functions.
* lisp/emacs-lisp/eieio-core.el (eieio-oset, eieio-oref):
Consolidate the type test. Use `oclosure--(set-)slot-value`.
(eieio--validate-slot-value, eieio--validate-class-slot-value):
Don't presume `class` is an EIEIO class.
(eieio--class): Fix bogus `:type` info.
(eieio--object-class): Simplify.
(eieio--known-slot-name-p): New function.
(eieio-oref, eieio-oref-default, eieio-oset-default): Use it.
* test/lisp/emacs-lisp/oclosure-tests.el: Require `eieio`.
(oclosure-test): Make `name` field mutable.
(oclosure-test-slot-value): New test.
* doc/misc/ses.texi (The Basics): Document that ses-jump may be
customized.
(Customizing @acronym{SES}): Document new customisations for ses-jump.
* lisp/ses.el (ses-jump-cell-name-function)
(ses-jump-prefix-function): New defcustoms.
(ses-jump-prefix): New defun.
(ses-jump): Make ses-jump use the new defcustoms.
* test/lisp/ses-tests.el (ses-jump-B2-prefix-arg)
(ses-jump-B2-lowcase, ses-jump-B2-lowcase-keys)
(ses-jump-B2-symbol, ses-jump-B2-renamed): New tests.
Reduce GC mark-phase recursion by using explicit stack (bug#54698)
An explict stack of objects to be traversed for marking replaces
recursion for most common object types: conses, vectors, records, hash
tables, symbols, functions etc. Recursion is still used for other
types but those are less common and thus not as likely to cause a
problem.
The stack grows dynamically as required which eliminates almost all C
stack overflow crashes in the GC. There is also a nontrivial GC
performance improvement.
* src/alloc.c (GC_REMEMBER_LAST_MARKED, GC_CDR_COUNT): New.
(mark_char_table, struct mark_entry):
Remove (subsumed into process_mark_stack).
(struct mark_entry, struct mark_stack, mark_stk)
(mark_stack_empty_p, mark_stack_pop, grow_mark_stack)
(mark_stack_push_value, mark_stack_push_values)
(process_mark_stack): New.
(mark_object, mark_objects):
Just push the object(s) and let process_mark_stack do the work.
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.
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.
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.
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: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.
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.
* 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 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 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.
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).
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.
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.
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.
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.
* 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.
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 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 [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.
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 #'...