1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

171299 commits

Author SHA1 Message Date
Adam Porter
c94d680f6e Handle the case where 'vtable-update-object' doesn't find old object
* lisp/emacs-lisp/vtable.el (vtable-update-object): If OLD-OBJECT
is not found, don't call ELT, since SEQ-POSITION may return nil.
(Bug#69664)
2024-03-14 12:46:46 +02:00
Tim Landscheidt
6d1c1fca0a ; Simplify (with-current-buffer (get-buffer ...) ...)
There's no need to call 'get-buffer', since 'with-current-buffer'
does that internally.
* lisp/calendar/todo-mode.el (todo-merge-category):
* lisp/comint.el (comint-dynamic-list-completions):
* lisp/emacs-lisp/checkdoc.el (checkdoc-error):
* lisp/emacs-lisp/debug.el (debug, debugger-record-expression):
* lisp/emacs-lisp/eieio-opt.el (eieio-browse):
* lisp/emacs-lisp/re-builder.el (reb-restart-font-lock):
* lisp/erc/erc-dcc.el (erc-dcc-do-LIST-command):
* lisp/eshell/em-unix.el (eshell-poor-mans-grep):
* lisp/gnus/gnus-group.el (gnus-add-mark):
* lisp/net/eww.el (eww-next-bookmark, eww-previous-bookmark):
* lisp/net/sieve.el (sieve-upload):
* lisp/net/tramp-cmds.el (tramp-cleanup-some-buffers):
* lisp/obsolete/quickurl.el (quickurl-list-populate-buffer):
* lisp/org/ob-calc.el: (org-babel-execute:calc):
* lisp/org/org-agenda.el (org-agenda-use-sticky-p):
* lisp/pcomplete.el (pcomplete-show-completions):
* lisp/progmodes/bug-reference.el
(bug-reference--try-setup-gnus-article):
* lisp/progmodes/idlw-help.el
(idlwave-highlight-linked-completions):
* lisp/progmodes/verilog-mode.el (verilog-preprocess):
* lisp/replace.el (occur-1):
* lisp/term.el (term-dynamic-list-completions):
* lisp/time.el (world-clock-update):
* lisp/url/url-cache.el (url-store-in-cache):
* lisp/vc/vc-cvs.el (vc-cvs-merge, vc-cvs-merge-news):
* lisp/vc/vc-rcs.el (vc-rcs-system-release):
* lisp/vc/vc-svn.el (vc-svn-merge, vc-svn-merge-news):
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--get-error-string-for-export):
* test/lisp/erc/erc-dcc-tests.el
(pcomplete/erc-mode/DCC--get-1flag)
(pcomplete/erc-mode/DCC--get-2flags)
(pcomplete/erc-mode/DCC--get-2flags-reverse):
* test/lisp/erc/erc-networks-tests.el
(erc-networks--rename-server-buffer--existing--noreuse):
* test/lisp/erc/erc-scenarios-services-misc.el
(erc-scenarios-services-misc--reconnect-retry-nick):
* test/lisp/erc/erc-tests.el (erc--refresh-prompt):
Replace (with-current-buffer (get-buffer ...) ...) with
(with-current-buffer ...).
2024-03-14 12:40:26 +02:00
Phil Hagelberg
3807f380b3 bug#69685: Add language server for Fennel to eglot
* lisp/progmodes/eglot.el (eglot-server-programs): Add
fennel-ls language server.

Copyright-paperwork-exempt: yes
2024-03-14 11:52:06 +02:00
StrawberryTea
fd0a6cb172 ffap.el: Exclude angle brackets from file names in XML
* lisp/ffap.el (ffap-string-at-point-mode-alist): Add elements for
XML, to better recognize file names in XML buffers.

Copyright-paperwork-exempt: yes
2024-03-14 11:47:04 +02:00
Visuwesh
cb9ee24ea6 Add bounds-of-thing-at-point property for 'number'
* lisp/thingatpt.el (thing-at-point-decimal-regexp)
(thing-at-point-hexadecimal-regexp): Extract regexps from...
(number-at-point): ...here.  Use them in 'number-at-point'.
(number): Add 'bounds-of-thing-at-point' property as
`forward-word' does not always return the right boundary,
e.g., in latex-mode buffers.  (Bug#69239)
2024-03-14 11:39:33 +02:00
Eli Zaretskii
a60804ab95 ; Fix last change (bug#68604)
* lisp/xwidget.el (xwidget-webkit-disable-javascript): Move from
here...
* lisp/cus-start.el (standard): ...to here.

* src/xwidget.c (syms_of_xwidget)
<xwidget-webkit-disable-javascript>: Doc fix.

* doc/emacs/misc.texi (Embedded WebKit Widgets): Fix wording.
2024-03-14 11:32:00 +02:00
Noé Lopez
f6a27bc32d Add user option to disable JavaScript in xwidget webview
* src/xwidget.c: Add the 'xwidget-webkit-disable-javascript'
variable to disable JavaScript in WebKit sessions.  (Bug#68604)

* etc/NEWS:
* doc/emacs/misc.texi (Embedded Webkit Widgets): Document
the change.
2024-03-14 11:17:24 +02:00
Adam Porter
013114664e * lisp/emacs-lisp/vtable.el (vtable-update-object): Fix.
The order of the arguments to 'seq-position' was wrong, and it did not
compare the correct values.  (Bug#69664)
2024-03-14 10:48:29 +02:00
Eli Zaretskii
7971537d3c ; Fix last change to compile with mingw.org's MinGW
* src/w32xfns.c:
* src/w32fns.c (WTS_VIRTUAL_CLASS) [!MINGW_W64]: Declare.
* src/w32xfns.c: Include wtsapi32.h.
2024-03-14 10:22:52 +02:00
Raffael Stocker
e7b1743b79 Fix resetting keyboard hook state on MS-Windows
Register session notifications so Emacs is notified when the
computer is being locked, as required to reset the low level
keyboard hook state.  (Bug#69083).
* src/w32term.h:
* src/w32fns.c (setup_w32_kbdhook, remove_w32_kbdhook)
(w32_wnd_proc, globals_of_w32fns, maybe_pass_notification):
Register and manage session notifications in GUI Emacs.
* src/w32console.c (initialize_w32_display, find_ime_window):
* src/w32xfns.c (drain_message_queue): Register notifications
and reset keyboard hook state in console Emacs.
* src/w32.c (term_ntproc): Un-register session notifications
when terminating.
2024-03-14 10:01:06 +02:00
Po Lu
1b94f800ae * exec/trace.c (rpl_stpcpy): Replace stpcpy if absent. 2024-03-14 14:21:49 +08:00
Po Lu
30bc867aec Improve /proc/self/exe substitution on Android
* exec/configure.ac (USER_SWORD): New macro.

* exec/exec.c (format_pid): Export this function.

* exec/exec.h:

* exec/trace.c (canon_path): New function.
(handle_readlinkat, handle_openat): Test complete file name
against /proc/self/exe, and further check for /proc/pid/exe.
2024-03-14 13:45:48 +08:00
Po Lu
db5c8bda63 ; * java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Another fix. 2024-03-14 08:24:42 +08:00
Gerd Möllmann
d95f2a882d ns_select fix for macOS terminals (bug#69561)
* src/nsterm.m (ns_select_1): Return early for terminals.
2024-03-13 20:27:20 +01:00
Eric Abrahamsen
c5945e0f9e Fix name of gnus-notification(s)-close; ignore argument
* lisp/gnus/gnus-notifications.el (gnus-notifications-close): Original
name was probably a typo.
2024-03-13 07:38:49 -07:00
Po Lu
e7e285ec34 Fix crash when displaying notifications on Android 3.0
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Don't call setPriority until Jelly Bean.
2024-03-13 15:35:40 +08:00
Gerd Möllmann
4ac4cec652 Prevent freezes on macOS (bug#69561)
* src/nsterm.m (ns_select_1): Store pending input_events. Always call
[NSApp run].
2024-03-13 07:09:09 +01:00
Po Lu
6b40d557c4 Port more notification senders to non-XDG systems
* doc/lispref/os.texi (Desktop Notifications): Document that
`:timeout' is now implemented.

* java/org/gnu/emacs/EmacsDesktopNotification.java
(EmacsDesktopNotification): New field delay.
(display1): Set delay on Android 8.0 and up.

* lisp/erc/erc-desktop-notifications.el
(erc-notifications-notify): Call Android or Haiku notification
functions on those systems.

* lisp/gnus/gnus-notifications.el (gnus-notifications-action)
(gnus-notification-close): Remove dismissed notifications from
the notification to message map.
(gnus-notifications-notify): Call android-notifications-notify
if possible.

* src/androidselect.c (android_init_emacs_desktop_notification):
Update accordingly.
(android_notifications_notify_1): New argument TIMEOUT.
(Fandroid_notifications_notify): New argument QCtimeout.
(syms_of_androidselect) <QCtimeout>: New symbol.
2024-03-13 11:01:39 +08:00
Stefan Monnier
4afafa0370 Try and avoid hardcoding lists of function types
* lisp/bind-key.el (bind-key--get-binding-description):
Show docstrings for compiled functions also.  Don't hardcode knowledge
about various particular kinds of functions.

* lisp/emacs-lisp/bytecomp.el (display-call-tree): Remove special
support for functions with a `byte-code` body since we never generate
that nowadays.  Don't hardcode knowledge
about various particular kinds of functions.
2024-03-12 16:09:23 -04:00
Stefan Monnier
8df6739077 Cleanup some type predicates
Use the new `cl--define-built-in-type` to reduce the manually
maintained list of built-in type predicates.
Also tweak docstrings to use "supertype" rather than "super type",
since it seems to be what we use elsewhere.

* lisp/subr.el (special-form-p): Remove redundant `fboundp` test.
(compiled-function-p): Don'Return nil for subrs that aren't functions.

* lisp/emacs-lisp/cl-macs.el (type predicates): Trim down the list.

* lisp/emacs-lisp/cl-preloaded.el (cl--define-built-in-type):
Register the corresponding predicate if applicable.
(atom, null): Specify the predicate name explicitly.
2024-03-12 15:43:43 -04:00
Stefan Monnier
3e96dd4f88 cl-generic: Signal an error when a type specializer won't work
* lisp/emacs-lisp/cl-generic.el (cl--generic--unreachable-types): New var.
(cl-generic-generalizers :extra "typeof"): Use it to signal an
error for those types we can't handle.
2024-03-12 12:00:17 -04:00
Eli Zaretskii
0cc4409461 ; * admin/MAINTAINERS: Add Daniel Pettersson. 2024-03-12 15:30:18 +02:00
Daniel Pettersson
7c552b22e6 Jsonrpc: improve performance of process filter function
`run-at-time' keeps `timer-list' list sorted by inserting each
timer based on the timer value.  This means that
`timer--time-less-p' needs is executed ~N*N/2 times for each N
pending messages.  This means that jsonrpc becomes unusable
for connections that generate a lot messages at the same time.

* lisp/jsonrpc.el (Version): Bump to 1.0.25.
(jsonrpc--process-filter): Improve performance by activating
timers in a different order.  (Bug#69241)
2024-03-12 15:22:24 +02:00
Stefan Monnier
d5773276fb (comp-known-predicates): Fix overly optimistic functionp
* lisp/emacs-lisp/comp.el (comp-known-predicates): `functionp` can also
be true for `cons` objects.
2024-03-12 08:48:09 -04:00
Po Lu
3ed5777fa7 Fix CheckJNI crash on Android 2.2
* src/androidfns.c (syms_of_androidfns_for_pdumper): Don't free
local reference to script name if nonexistent.
2024-03-12 12:24:59 +08:00
Po Lu
fd293c7c67 ; Check in missing change to AndroidManifest.xml.in
* java/AndroidManifest.xml.in: Register CancellationReceiver.
2024-03-12 10:46:20 +08:00
Stefan Monnier
2704ec54fd (gnus-convert-old-newsrc): Remove ancient converters
* lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): Remove converters
from 2004 and before.
* lisp/gnus/legacy-gnus-agent.el: Delete file.
2024-03-11 22:00:10 -04:00
Po Lu
7ea3a46403 Resolve inconsistency between Android and XDG notifications
* doc/lispref/os.texi (Desktop Notifications):

* src/androidselect.c (android_notifications_notify_1)
(Fandroid_notifications_notify, android_notification_action)
(syms_of_androidselect): Rename `:on-cancel' to `:on-close'.
2024-03-12 09:59:27 +08:00
Po Lu
fd33b637e9 ; Fix omission from last change
* src/androidselect.c (android_notification_deleted): Adjust for
changed notification list format.
2024-03-12 09:54:54 +08:00
Po Lu
d7ded99608 Implement notification residency on Android
* doc/lispref/os.texi (Desktop Notifications): Document support
for `:resident'.

* java/org/gnu/emacs/EmacsService.java (cancelNotification):

* src/android.c (android_init_emacs_service):

* src/android.h (struct android_emacs_service): New function.

* src/androidselect.c (android_notifications_notify_1)
(Fandroid_notifications_notify): New parameter QCresident; save
it within notification lists.
(android_notification_deleted, android_notification_action):
Adjust for changes to the format of notification lists and
cancel non-resident notifications when an action is selected.
(syms_of_androidselect): <QCresident>: New symbol.
2024-03-12 09:48:53 +08:00
Po Lu
bf38783c32 Fix notification cancellation detection on Android
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Don't specify FLAG_ONE_SHOT in cancel intents.
2024-03-12 08:51:52 +08:00
Po Lu
a7a37341ca Implement notification callbacks on Android
* doc/lispref/os.texi (Desktop Notifications): Document that
:on-cancel, :on-action and :actions are now supported on
Android.

* java/org/gnu/emacs/EmacsActivity.java (onNewIntent): New
function.

* java/org/gnu/emacs/EmacsDesktopNotification.java
(NOTIFICATION_ACTION, NOTIFICATION_TAG, NOTIFICATION_DISMISSED):
New constants.  <actions, titles>: New fields.
(insertActions): New function.
(display1, display): Insert actions on Jelly Bean and up, and
arrange to be notified when the notification is dismissed.
(CancellationReceiver): New class.

* java/org/gnu/emacs/EmacsNative.java (sendNotificationDeleted)
(sendNotificationAction): New functions.

* src/android.c (sendDndDrag, sendDndUri, sendDndText): Correct
return types.
(sendNotificationDeleted, sendNotificationAction)
(android_exception_check_5, android_exception_check_6): New
functions.

* src/android.h:

* src/androidgui.h (struct android_notification_event): New
structure.
(union android_event): New member for notification events.

* src/androidselect.c (android_init_emacs_desktop_notification):
Update JNI signatures.
(android_notifications_notify_1, Fandroid_notifications_notify):
New arguments ACTIONS, ACTION_CB and CANCEL_CB.  Convert and
record them as appropriate.
(android_notification_deleted, android_notification_action): New
functions.
(syms_of_androidselect): Prepare a hash table of outstanding
notifications.
<QCactions, QCon_action, QCon_cancel> New defsyms.

* src/androidterm.c (handle_one_android_event)
<ANDROID_NOTIFICATION_DELETED>
<ANDROID_NOTIFICATION_ACTION>: Dispatch event contents to
androidselect.c for processing.

* src/androidterm.h:

* src/androidvfs.c (java_string_class): Export.

* src/keyboard.c (kbd_buffer_get_event) <NOTIFICATION_EVENT>:
Call callback specified by the event.

* src/termhooks.h (enum event_kind) [HAVE_ANDROID]: New
enum NOTIFICATION_EVENT.
2024-03-11 21:41:14 +08:00
Basil L. Contovounesios
75cfc6c73f ; Fix error message in last change to bindat.el
Remove trailing period as per "(elisp) Error Symbols".

Relates to the following discussion:
https://lists.gnu.org/r/emacs-devel/2023-10/msg00473.html
https://lists.gnu.org/r/emacs-devel/2024-03/msg00340.html
2024-03-11 11:16:20 +01:00
Paul Eggert
2d61ebb505 Change bare-symbol back to match intent
Also, attempt to document the intent better.
Problem reported by Alan Mackenzie (Bug#69684).
* src/data.c (Fbare_symbol): Do not signal if the SYM is a symbol
with position and symbols-with-pos-enabled is nil.  Instead,
ignore symbols-with-pos-enabled, as that was the intent.
* test/src/data-tests.el (data-tests-bare-symbol):
New test, to help prevent this bug from reoccurring.
2024-03-11 00:34:27 -07:00
Michael Heerdegen
bbc53e0bcf Improve pp-emacs-lisp-code backquote form printing
* lisp/emacs-lisp/pp.el (pp--quoted-or-unquoted-form-p): New helper
function.
(pp--insert-lisp): Take care of quoted, backquoted and
unquoted expressions; print using an recursive call.
(pp--format-list): Exclude more cases from printing as a function call
by default.  Print lists whose second-last element is an (un)quoting
symbol using dotted list syntax; e.g. (a b . ,c) instead of (a b \, c).
2024-03-11 05:24:59 +01:00
Michael Heerdegen
9a2ce74c37 Fix pp-emacs-lisp-code printing of symbols
* lisp/emacs-lisp/pp.el (pp--insert-lisp): Print symbols
readably (bug#69168).
2024-03-11 05:24:59 +01:00
Petteri Hintsanen
ed43ad5b56 (bindat--unpack-item): Sanitize vector length
Copyright-paperwork-exempt: yes

* lisp/emacs-lisp/bindat.el (bindat--unpack-item): Sanitize vector length
2024-03-10 23:30:11 -04:00
Andreas Schwab
887789eecc Avoid dependency on nonexisting target in lispref makefile
* doc/lispref/Makefile.in (auxfiles): Change target into a
variable.
($(buildinfodir)/elisp.info): Adjust dependency.
(infoclean): Clean $(auxfiles).
2024-03-10 23:05:47 +01:00
Jim Porter
46afc91c9f Let 'browse-url-interactive-arg' return more values for NEW-WINDOW-FLAG
Previously it always returned t or nil for NEW-WINDOW-FLAG, but now it
can return the actual prefix arg when appropriate.  This lets functions
for 'browse-url-browser-function' consult it and do more things than
just open a new window or not (for example, you could use "C--" as the
prefix arg to do something special in a custom function).

* lisp/net/browse-url.el (browse-url-interactive-arg): Use 'xor' to
adjust the value of 'current-prefix-arg'.
(browse-url): Update docstring.
2024-03-10 14:05:09 -07:00
Stefan Monnier
c17ecd2dcd syncdoc-type-hierarchy.el: Sort and remove comp dependency
* admin/syncdoc-type-hierarchy.el: Delay loading `org-table` so as
not to "pollute" the table with Org-specific types.
(syncdoc-all-types): Sort the types topologically from the root.
(syncdoc-hierarchy): Use `cl--class-parents` instead if
`comp--direct-supertypes` so we don't depend on `comp-cstr`.
(syncdoc-make-type-table): Sort the table so supertypes always come before
their subtypes.
(syncdoc-make-type-table): Require `org-table` here.

* doc/lispref/elisp_type_hierarchy.jpg:
* doc/lispref/elisp_type_hierarchy.txt: Refresh.
2024-03-10 15:12:00 -04:00
Tim Ruffing
2fdb281a27 * src/keyboard.c (read_key_sequence): Remove MSVC compatibility hack 2024-03-10 10:40:21 -04:00
Tim Ruffing
df3e0bcbdb * lisp/calc/calc-prog.el: Switch to new method of detecting end of kbd macro
'read-char' will no longer return -1 as of
ac82baea1c41ec974ad49f2861ae6c06bda2b4ed. This switches to a cleaner
method of detecting whether the end of a keyboard macro has been
reached.

* lisp/calc/calc-prog.el (calc--at-end-of-kmacro-p): New function.
(calc-kbd-skip-to-else-if): Use the function.

Co-authored-by: Stefan Monnier <monnier@iro.umontreal.ca>
2024-03-10 10:40:19 -04:00
Tim Ruffing
d444390ec5 Remove workarounds for solved 'read-event' bug
* lisp/subr.el (read-char-choice-with-read-key):
* lisp/net/dbus.el (dbus-call-method):
Remove workarounds for the bug fixed in the previous commit
ac82baea1c41ec974ad49f2861ae6c06bda2b4ed, where 'read-event',
'read-char' and 'read-char-exclusively' could return wrongly -1.
In the case of lisp/dbus.el, this reverts commit
7177393826.
2024-03-10 10:40:16 -04:00
Tim Ruffing
6f46dd516b Continue reading in 'read-event' etc. at the end of a keyboard macro
This fixes a bug that could make 'read-event', 'read-char', and
'read-char-exclusive' erroneously return -1, an internal magic return
value of 'read_char' leaked from C to lisp. Instead of returning -1, the
aforementioned lisp functions now transparently continue reading
available input (e.g., from the keyboard) when reaching the end of a
keyboard macro.

* src/keyboard.c (read_char, read_key_sequence): Move handling
of the end of a keyboard macro from 'read_char' to its caller
'read_key_sequence', which is the only caller that can
meaningfully deal with this case.
* src/macros.c (Fexecute_kbd_macro): Document how the end of keyboard
macro is processed.
* etc/NEWS: Announce this change.
2024-03-10 10:40:13 -04:00
Tim Ruffing
d6f326452e * src/keyboard.c (requeued_events_pending_p): New function
* src/keyboard.c, src/keyboard.h (requeued_events_pending_p): Add
function 'requeued_events_pending_p' (whose name was made available in
the previous commit). As opposed to the previous function with the same
name, the new function covers both command and other events.
* src/keyboard.c (Finput_pending_p): Use the new function.
2024-03-10 10:40:11 -04:00
Tim Ruffing
385a02cffd * src/keyboard.c (requeued_events_pending_p): Improve name and fix comment
* src/keyboard.c, src/keyboard.h (requeued_events_pending_p): Rename to
'requeued_command_events_pending_p' to clarify that the function covers
only command events. Fix wrong comment that claimed that the function
was unused.
* src/process.c (wait_reading_process_output): Update caller to use the
new name.
2024-03-10 10:40:07 -04:00
Tim Ruffing
fbc5fb2561 Extract check for end of macro to function
* src/macros.h (at_end_of_macro_p):
* src/macros.c (at_end_of_macro_p):
New function.
* src/keyboard.c (read_char): Use the new function.
2024-03-10 10:40:01 -04:00
F. Jason Park
f3da3d1c68 Fix faulty decoded-time adjustment in erc-stamp
* lisp/erc/erc-stamp.el (erc-stamp--lr-date-on-pre-modify): Remove
disruptive assertion for now.
(erc-stamp--time-as-day): Attempt to fix date being rewound by a whole
day when daylight saving time is in effect.  Do this by forcing the
`dst' slot of the `decoded-time' object to -1 and the `zone' to nil.
2024-03-10 06:11:29 -07:00
F. Moukayed
166c8a9894 Redefine erc-spoiler-face to indicate revealed text
* lisp/erc/erc-goodies.el (erc-spoiler-face): Redefine role and redo
definition to inherit from `erc-control-default-face'.
(erc-controls-propertize): Include `cursor-face' in the applied hover
properties for spoiler text, and ensure they aren't clobbered by other
built-in modules, like `button'.
(Bug#69597)

Copyright-paperwork-exempt: yes
2024-03-10 06:11:29 -07:00
F. Jason Park
e2620fd734 Make important text props more resilient in ERC
* lisp/erc/erc-button.el (erc-button-remove-old-buttons): Restore
original `mouse-face' values in areas marked as important after
clobbering.
* lisp/erc/erc.el (erc--reserve-important-text-props): New function.
(erc--restore-important-text-props): New function.
* test/lisp/erc/erc-tests.el (erc--restore-important-text-props): New
test.
(Bug#69597)
2024-03-10 06:11:29 -07:00