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

157089 commits

Author SHA1 Message Date
Lars Ingebrigtsen
00a0226ba5 Allow hooks to alter the process in prolog-ensure-process
* lisp/progmodes/prolog.el (prolog-ensure-process): Start the mode
after starting the process, so that the mode hook can talk to the
process (bug#46003).
2022-06-07 16:39:22 +02:00
Stefan Monnier
a98413726f find-func.el: Fix bug#41104
* lisp/emacs-lisp/find-func.el (find-function-advised-original): Look
at the actual function definition rather than
`advice--symbol-function` which sometimes returns only the advice.

* test/lisp/emacs-lisp/find-func-tests.el
(find-func-tests--find-library-verbose): Add test.
2022-06-07 10:31:17 -04:00
Po Lu
3864308c20 Add selection stuff to DND tests
* test/lisp/dnd-tests.el (dnd-tests-selection-table): New
defvar.
(gui-set-selection): Actually implement in a way that validates
the local value and stores it for future use.
(dnd-tests-verify-selection-data): New function.
(dnd-tests-begin-text-drag): Add tests for the contents of
various selections.
2022-06-07 21:45:17 +08:00
Po Lu
6a4444aa39 Fix coding style of some Haiku files
* src/haiku_support.cc: (FrameResized):
(class EmacsView, AfterResize): Fix coding and initializer
style.

* src/haiku_support.h (struct haiku_resize_event): Rename
confusingly named fields.
* src/haikuterm.c (haiku_read_socket): Update accordingly.
2022-06-07 12:13:42 +00:00
Lars Ingebrigtsen
254d2a1477 Simplify mode line for vc-print-root-log
* lisp/vc/vc.el (vc-print-root-log): Don't display "from <file>"
(bug#45007).
2022-06-07 13:23:54 +02:00
Po Lu
4918ef0915 Fix more bugs with DND selection handling
* src/xterm.c (x_defer_selection_requests)
(x_release_selection_requests): New functions.
(x_dnd_begin_drag_and_drop): Use those functions to defer
selections instead.  Fix error signalled when ownership of
XdndSelection is lost.
(handle_one_xevent): Likewise.
2022-06-07 18:24:10 +08:00
Lars Ingebrigtsen
dc546d1ca0 Clarify highlight-changes-rotate-faces doc string
* lisp/hilit-chg.el (highlight-changes-rotate-faces): Doc string
clarification (bug#44150).
2022-06-07 12:22:10 +02:00
Po Lu
6fe133c3ae Remove mentions of GNOME MediaKeys from dbus documentation examples
* doc/misc/dbus.texi (Properties and Annotations):
* lisp/net/dbus.el (dbus-get-all-managed-objects): Remove
mentions of obsolete GNOME APIs from example text.
2022-06-07 15:44:05 +08:00
Po Lu
3bdeedd8ac Improve compatibility with some clients of the Motif drop protocol
* lisp/select.el (x-dnd-targets-list): New defvar.
(xselect-convert-to-targets): Convert XdndSelection based on the
DND targets list.
* src/xfns.c (Fx_begin_drag): Pass new argument.
* src/xselect.c (struct x_selection_request): New struct.
(x_push_current_selection_request):
(x_pop_current_selection_request): New functions.
(x_selection_request_lisp_error, x_reply_selection_request)
(x_handle_selection_request, x_convert_selection)
(syms_of_xselect_for_pdumper): Correctly handle recursive
requests for MULTIPLE by maintaining a stack of selection
requests, converted selections, and other data.
* src/xterm.c (x_dnd_begin_drag_and_drop): New argument
`selection_target_list'.  Bind it to the DND targets list.
(syms_of_xterm): New defvar and associated defsym.
* src/xterm.h: Update prototypes.
2022-06-07 13:49:41 +08:00
Po Lu
6871e649b5 Add new drag-and-drop test
* test/lisp/dnd-tests.el (dnd-tests-get-local-file-uri): New
test.
2022-06-07 13:07:26 +08:00
Po Lu
192de232bf Fix leak of event data on GTK+ 2.x
* src/xterm.c (handle_one_xevent): Fix goto XI_OTHER for
valuator motion events generated on scroll bars.
2022-06-07 12:59:37 +08:00
Po Lu
f6f5634378 Update Haiku drag-and-drop code
* lisp/term/haiku-win.el (haiku-drag-and-drop): Don't allow
dropping on places other than the text area (it doesn't work).
Also respect mouse-yank-at-point.
2022-06-07 02:44:08 +00:00
Po Lu
c60cb3baa7 Don't allow dropping on invalid drop sites
* lisp/x-dnd.el (x-dnd-drop-data): If dropping on something
other than the text area, don't set point.
(x-dnd-handle-xdnd, x-dnd-handle-motif): Don't pretend dropping
on the mode line is ok.
2022-06-07 10:39:55 +08:00
Po Lu
cbc0d8f7c7 Don't display mouse face during mouse drag-and-drop
* lisp/mouse.el (mouse-drag-and-drop-region): Don't display
mouse face, since it leads to a lot of flicker.
2022-06-07 10:27:03 +08:00
Po Lu
e21c761d13 Prevent crashes with very large Motif targets tables
* src/xterm.c (xm_setup_dnd_targets): Catch errors around
xm_write_targets_table lest we get a BadAlloc error.
2022-06-07 09:45:41 +08:00
Po Lu
2267b48cac Fix two crashes when a display connection is lost
This fixes errors caused by invalid error traps being left on
the error handler stack if an IO error causes a non-local exit
out of the protected code, and another crash caused by
delete_frame trying to read async input.

* src/eval.c (unwind_to_catch, push_handler_nosignal): Save and
restore the X error handler stack.
* src/lisp.h (struct handler): [HAVE_X_WINDOWS]: New field
`x_error_handler_depth'.

* src/xterm.c (struct x_error_message_stack): Make string a
regular string.
(x_unwind_errors_to): New function.
(x_error_catcher, x_catch_errors_with_handler)
(x_uncatch_errors_after_check, x_uncatch_errors): Update the
stack depth.
(x_check_errors): Stop manually unwinding since unwind_to_catch
now does that for us.
(x_had_errors_p, x_clear_errors): Update for new type of
`string'.
(x_connection_closed): Block input between just before
delete_frame to when the terminal is unlinked.

* src/xterm.h: Update prototypes.
2022-06-07 09:26:15 +08:00
Lars Ingebrigtsen
8c252e2326 Fix execute-extended-command help text for remapped commands
* lisp/simple.el (execute-extended-command): Don't provide
misleading help text for remapped commands (bug#23543).
2022-06-06 16:43:12 +02:00
Stephen Berman
dc9337aacd Allow using xref buttons in non-*Help* buffers
* lisp/help-mode.el (help-buffer): Allow using the xref buttons in
non-*Help* buffers (bug#8147) (but display the result in a *Help*
buffer).
2022-06-06 16:12:39 +02:00
Eli Zaretskii
f3062c4104 ; * lisp/emacs-lisp/lisp.el (raise-sexp): Doc fix. (Bug#55788) 2022-06-06 17:10:21 +03:00
Lars Ingebrigtsen
7edf3d2902 Make find-file-noselect not pick buffers with broken symlinks
* lisp/files.el (find-buffer-visiting): Improve doc string.
(find-file-noselect): Don't pick buffers with broken symlinks,
because that's too confusing (bug#41414).
2022-06-06 15:49:36 +02:00
Lars Ingebrigtsen
4c2ba16500 Improve scheme-mode syntax-rules indentation
* lisp/progmodes/scheme.el (syntax-rules): Indent syntax-rules
with a parameter better (bug#40869).
2022-06-06 15:32:03 +02:00
Lars Ingebrigtsen
5f12e288a5 Improve find-sibling-file error reporting
* lisp/files.el (find-sibling-file): Improve error reporting.
2022-06-06 14:34:50 +02:00
Po Lu
cf599c9fb8 Update comments in X error handling code
* src/xterm.c (struct x_error_message_stack, x_error_message)
(x_error_catcher, x_catch_errors, x_had_errors_p)
(x_clear_errors): Long-overdue comment update.  Describe the
fields of the error message stack, and the fact that
`x_error_message' is a stack, not a pointer to a string (which
has been true since 2006).  Also describe the updated conditions
used to find an applicable error handler and to call
x_uncatch_errors_after_check.
2022-06-06 20:23:20 +08:00
Po Lu
10641eaf5b Add drag-and-drop API tests
* test/lisp/dnd-tests.el: New file.
(dnd-tests-begin-text-drag):
(dnd-tests-begin-file-drag):
(dnd-tests-begin-drag-files): New tests.
2022-06-06 19:51:47 +08:00
Po Lu
c3127f5638 Improve handling of remote files during drag-and-drop
* lisp/dnd.el (dnd-begin-drag-files): Don't fail if one remote
file couldn't be downloaded.
2022-06-06 19:07:07 +08:00
Mattias Engdegård
138d2f22f7 Test warning suppressions with lexical binding
* test/lisp/emacs-lisp/bytecomp-tests.el
(test-byte-comp-compile-and-load): Add lexical cookie to file being
compiled as part of the test.
(bytecomp-test--with-suppressed-warnings): Comment out the test
for suppressing warnings when attempting to let-bind `nil`,
as that (1) doesn't work and (2) is a silly thing to do anyway.
2022-06-06 10:54:30 +02:00
Po Lu
3cbdd59146 Fix several more issues with running Lisp during drag-and-drop
* src/xterm.c (handle_one_xevent): Fix _NET_WM_PING cycle again
and set mouse_moved flags during drag-and-drop so reading mouse
events from Lisp continues to work.
2022-06-06 16:01:41 +08:00
Po Lu
31bc62b6ad Signal an error XdndSelection was lost during drag-and-drop
* src/xselect.c (x_handle_selection_clear): Signal an error if
ownership of XdndSelection was lost during drag-and-drop.
2022-06-06 12:48:40 +08:00
Po Lu
9062856ed0 Make mouse input work properly inside the debugger during DND
* src/xterm.c (x_dnd_begin_drag_and_drop): Set
`x_dnd_recursion_depth'.
(handle_one_xevent): If the recursive edit level is higher than
when DND started, handle mouse events normally.
2022-06-06 12:35:10 +08:00
Stefan Monnier
5ee4209f30 cl-typep: Emit warning when using a type not known to be a type
`cl-typep` has used a heuristic that if there's a `<foo>-p` function,
then <foo> can be used as a type.  This made sense in the past where
most types were not officially declared to be (cl-)types, but nowadays
this just encourages abuses such as using `cl-typecase` with
"types" like `fbound`.  It's also a problem for EIEIO objects, where
for historical reasons `<foo>-p` tests if the object is of type
exactly `<foo>` whereas (cl-typep OBJ <foo>) should instead test
if OBJ is a *subtype* of `<foo>`.

So we change `cl-typep` to emit a warning whenever this "-p" heuristic
is used, to discourage abuses, encourage the use of explicit
`cl-deftype` declarations, and try and detect some misuses of
`<foo>-p` for EIEIO objects.

* lisp/emacs-lisp/eieio.el (defclass): Define as type not only at
run-time but also for the current compilation unit.

* lisp/emacs-lisp/eieio-core.el (class, eieio-object): Define as types.

* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Don't abuse the
"-p" heuristic.

* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies):
Add entries for frames, windows, markers, and overlays.
(cl-typep): Emit a warning when using a predicate that is not known to
correspond to a type.

* lisp/files.el (file-relative-name): Fix error that can trigger if
there's an(other) error between loading `files.el` and loading
`minibuffer.el`.
2022-06-06 00:04:00 -04:00
Po Lu
b90d2a6a63 Rework X selections to make it safe to run the debugger inside converters
* src/keyboard.c (prev_kbd_event): Delete function.
(readable_events): Return 1 if
x_detect_pending_selection_requests returns true.
(kbd_buffer_unget_event): Also delete function, since nested
selection requests are really handled correctly.
(kbd_buffer_get_event): Handle events from the special X
deferred selection queue as well.

* src/keyboard.h: Update prototypes.

* src/xselect.c (struct selection_event_queue)
(selection_input_event_equal, x_queue_event)
(x_start_queuing_selection_requests)
(x_stop_queuing_selection_requests): Delete structs, since they
are no longer required.
(x_handle_selection_request, x_handle_selection_event): Allow
nested selection events.

* src/xterm.c (struct x_selection_request_event): New struct.
(x_handle_pending_selection_requests_1)
(x_handle_pending_selection_requests): Handle all events in the
new selection event queue.
(x_push_selection_request, x_detect_pending_selection_requests):
New functions.
(x_dnd_begin_drag_and_drop): Drain the selection queue here as
well.
(handle_one_xevent): When inside a nested event loop, just push
selections to that queue.
(XTread_socket): Allow reading X events if x_dnd_unwind_flag is
true, even though DND is in progress.
(x_delete_display): Delete pending selection events for the
display that is going away.

* src/xterm.h: Update prototypes.
2022-06-06 11:08:19 +08:00
Stefan Monnier
0a36671f41 pcomplete.el: Fix part of bug#50470
Try and handle the case where `pcomplete-parse-arguments-function`
directly returns a list of completions.

* lisp/pcomplete.el (pcomplete-parse-arguments): Don't modify the
buffer if we're not allowed to.  Instead use the buffer's current
content as the "pattern to be completed" and return the list
of completions as is.  Also, use `try-completions` to simplify the
previous code.
2022-06-05 19:51:29 -04:00
Lars Ingebrigtsen
f5e8e7a7b9 Add nohandle-guide images for tree-widget
These are copies of the guide.* files
2022-06-06 00:42:56 +02:00
Lars Ingebrigtsen
fbc0cc0e9f Re-re-fix previous describe-function change
* lisp/help-fns.el (describe-function): Put back binding removed
by mistake in previous change.
2022-06-05 22:52:59 +02:00
Lars Ingebrigtsen
46822e9c5e Fix key binding buffer issue in describe-function better
* lisp/help-fns.el (describe-function): Revert previous change here.
(describe-function-1): Just use describe-function-orig-buffer
instead of the key-buffer binding -- this will also make the
rendering results correct when hitting `g' and `l'.
2022-06-05 22:48:28 +02:00
Lars Ingebrigtsen
b1ed72fd70 Clarify syntax-ppss doc string
* lisp/emacs-lisp/syntax.el (syntax-ppss): Clarify doc string.
2022-06-05 22:37:32 +02:00
Lars Ingebrigtsen
50cbb727b5 Simplify set-goal-column
* lisp/simple.el (set-goal-column): Simplify the code.
2022-06-05 22:29:08 +02:00
Lars Ingebrigtsen
3f388d7929 Make `C-h f' look up key bindings in the current buffer again
* lisp/help-fns.el (describe-function): Pass in the correct buffer
to look up key bindings in.
(describe-function-1): Use it.
2022-06-05 21:48:21 +02:00
Lars Ingebrigtsen
bb9c899b07 Make the goal column work for the scrolling commands, too
* doc/emacs/basic.texi (Moving Point): Document it.
* lisp/simple.el (set-goal-column): Update doc string.

* lisp/window.el (scroll-up-command, scroll-down-command): Make
the goal column take effect for these commands, too (bug#17346).
2022-06-05 21:35:56 +02:00
Lars Ingebrigtsen
8c00e21df2 Move two more variables from autoload.el to loaddefs-gen.el
* lisp/emacs-lisp/loaddefs-gen.el (generated-autoload-file)
(generated-autoload-load-name): Move the remaining two autoload.el
variables used by loaddefs-gen.el from autoload.el.
2022-06-05 20:32:01 +02:00
Lars Ingebrigtsen
3406e4064f Make finder/cus-dep scraping use generate-lisp-file functions
* lisp/finder.el (finder-compile-keywords):
* lisp/cus-dep.el (custom-make-dependencies): Use
generate-lisp-file functions directly instead of piggy-backing on
the autoload.el functions.  (This is part of making autoload.el obsolete.)
2022-06-05 20:17:30 +02:00
Stefan Kangas
251e7c3018 Don't generate separate autoload file for htmlfontify
* lisp/hfy-cmap.el: Update file local to no longer put htmlfontify
autoloads in htmlfontify-loaddefs.el.
* lisp/htmlfontify.el (htmlfontify-loaddefs): Don't require.
* test/lisp/htmlfontify-tests.el (htmlfontify-autoload): Delete
test (bug#52400).
2022-06-05 18:23:17 +02:00
Lars Ingebrigtsen
98d454627c Rename generate-file to generate-lisp-file
* lisp/url/url-cookie.el (url-cookie-write-file):
* lisp/international/titdic-cnv.el (tit-process-header)
(miscdic-convert):
* lisp/international/ja-dic-cnv.el (skkdic-convert):
* lisp/international/emoji.el (emoji--generate-file):
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric):
* admin/unidata/unidata-gen.el (unidata-gen-file)
(unidata-gen-charprop): Adjust callers.

* lisp/emacs-lisp/generate-lisp-file.el: Renamed from
generate-file.el.  Also rename some keyword parameters and require
a generator function.
2022-06-05 17:48:39 +02:00
Eli Zaretskii
e8a941cf70 ; * etc/NEWS: Fix wording of entry about 'file-expand-wildcards'. 2022-06-05 17:53:43 +03:00
Lars Ingebrigtsen
9d2f4a8d5a Add convenience functions for generating Emacs Lisp files
* lisp/url/url-cookie.el (url-cookie-write-file):
* lisp/international/titdic-cnv.el (tit-process-header):
* lisp/international/ja-dic-cnv.el (skkdic-convert):
* lisp/international/emoji.el (emoji--generate-file):
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric)

* admin/unidata/unidata-gen.el (unidata-gen-file)
(unidata-gen-charprop): Use the new functions.

* lisp/emacs-lisp/generate-file.el: New file to provide
convenience functions for generated files.  It's not always
trivial to know which parts of the trailer that has to be
obfuscated to avoid not getting byte-compiled etc, and some parts
of the headers/trailers are usually forgotten when hand-coding
these.
2022-06-05 16:36:34 +02:00
Eli Zaretskii
ac6660a2d0 ; * lisp/international/fontset.el (setup-default-fontset): Fix comment. 2022-06-05 17:08:49 +03:00
समीर सिंह Sameer Singh
0e2b70b659 Add a fallback font for Tamil Supplement characters
* lisp/international/fontset.el (setup-default-fontset): Add
and entry for "Noto Sans Tamil Supplement".  (Bug#55807)
2022-06-05 17:05:35 +03:00
JD Smith
11dadfbf3b Make the Unicode tree widget prettier
* lisp/tree-widget.el (tree-widget-nohandle-guide): New widget:
"One small change is needed to accommodate this
style. `tree-widget-guide’ specifies a single vertical bar “guide”
widget. In the unicode tree, two separate vertical bars are needed
— one “plain” (│), and one which connects to the horizontal
“handle” preceding the node (├)."
(tree-widget--cursors):
(tree-widget):
(tree-widget-value-create): Use it.

Copyright-paperwork-exempt: yes
2022-06-05 15:59:37 +02:00
Lars Ingebrigtsen
408fa62148 Add new command find-sibling-file
* doc/emacs/files.texi (Visiting): Document it.
* lisp/files.el (file-expand-wildcards): Fix up the regexp expansion.
(find-sibling-rules, find-sibling-file): New user option and command.
(find-sibling-file--search): New helper function.
2022-06-05 15:49:29 +02:00
Po Lu
fcb4d836f0 Fix file name encoding of Motif drop protocol file selections
* lisp/select.el (xselect-convert-to-filename):
(xselect-convert-to-dt-netfile): Encode in the file name coding
system instead of `raw-text-unix'.
2022-06-05 21:16:38 +08:00