1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-21 12:03:55 -08:00
Commit graph

172027 commits

Author SHA1 Message Date
Andreas Schwab
672ca232db textsec: handle email address without domain part
* lisp/international/textsec.el
(textsec-email-address-suspicious-p): Handle missing domain part.
(textsec-email-address-header-suspicious-p): Likewise.
2024-05-04 21:08:43 +02:00
Stefan Monnier
ea752667cd (ruler-mode-ruler): Minor optimization
* lisp/ruler-mode.el (ruler-mode-ruler): Don't compute
`line-number-display-width` redundantly.  Use `add-text-properties`.
Remove redundant `local-map` property.
2024-05-04 12:06:16 -04:00
Mattias Engdegård
fd859fbea2 Allow letrec binding without init expression
For example, (letrec (... (x) ...) ...) is now allowed.

* lisp/subr.el (letrec): Allow omitted init expression.
* test/lisp/subr-tests.el (subr--tests-letrec): Add test case.
2024-05-04 14:39:24 +02:00
Eli Zaretskii
1e4cb12a81 Merge from origin/emacs-29
b392169e54 ; * doc/lispref/commands.texi (Event Mod): Add motivation...
e272fd3da9 ; Update description of 'mail-mode'
2024-05-04 08:10:54 -04:00
Eli Zaretskii
fdfadd6f46 ; Fix last change
* lisp/progmodes/python.el
(python-shell-compilation-regexp-alist): Add :version.
(Bug#70653)
2024-05-04 14:51:05 +03:00
shynur
bfb31a06ac Locate error source of ExceptionGroup in Python shell
The Python shell recognizes the line containing a file path and
a line number when an exception is raised up to the top-level,
in order to locate the source of error.  It's supposed to
recognize the built-in ExceptionGroup as well.  (Bug#70653)
* lisp/progmodes/python.el (python-shell-compilation-regexp-alist):
Take the single leading vertical line into account.
* etc/NEWS: Announce this change.
2024-05-04 14:48:38 +03:00
Eli Zaretskii
fa0f65aa34 Fix implementation of the --terminal command-line switch
It sounds like this has been broken ever since multi-tty was
added to Emacs.
* src/keyboard.c (dev_tty): New global variable.
* src/keyboard.h: Declare 'dev_tty'.
* src/emacs.c (main): Initialize 'dev_tty'.
* src/term.c (Fcontrolling_tty_p, Fresume_tty, init_tty):
* src/process.c (dissociate_controlling_tty):
* src/keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use 'dev_tty' instead of 'DEV_TTY'.  (Bug#70519)
2024-05-04 13:12:21 +03:00
Mattias Engdegård
1121f17d7c Only issue lexical cookie warning for elisp files
* src/lread.c (string_suffix_p): New.
(warn_missing_cookie): Suppress warning for files not ending in ".el",
except ".emacs".
* etc/NEWS: Update accordingly, and mention how the warning can be
suppressed.
2024-05-04 10:35:24 +02:00
Po Lu
41dd78cd36 Simplify handling of command-line arguments on Android
* java/org/gnu/emacs/EmacsActivity.java
(EXTRA_STARTUP_ARGUMENTS): New constant.
(onCreate): Read a string array, not a string extra from the
intent with this key.

* java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity)
<fileToOpen>: Delete field.
(onCreate): Provide file name as a command line argument when
starting the Emacs service.

* java/org/gnu/emacs/EmacsPreferencesActivity.java (startEmacsQ)
(startEmacsDebugInit): In like manner, replace ad-hoc
command-line argument extra with a proper array.

* java/org/gnu/emacs/EmacsService.java (EmacsService): Rename
extraStartupArgument to extraStartupArguments, and change its
type to a string array.
(onCreate): Adjust to match.

* java/org/gnu/emacs/EmacsThread.java (EmacsThread)
<extraStartupArguments>: Ditto.
<fileToOpen>: Delete field.
(run): Adjust correspondingly.
2024-05-04 16:13:24 +08:00
Po Lu
ecfbd0ff99 Delete redundant backquotes in android-win.el
* lisp/term/android-win.el (android-encode-jni)
(android-decode-jni): Replace redundant backquotes with ordinary
quotes.
2024-05-04 16:13:24 +08:00
Eli Zaretskii
01b626ccbc ; * etc/NEWS: Fix last change. 2024-05-04 09:57:05 +03:00
Eli Zaretskii
c74c65f5e1 ; * etc/NEWS: Fix a recently-added entry. 2024-05-04 09:34:18 +03:00
Po Lu
139931fefb Simplify management of Android handle IDs
* java/org/gnu/emacs/EmacsCursor.java (EmacsCursor):

* java/org/gnu/emacs/EmacsGC.java (EmacsGC):

* java/org/gnu/emacs/EmacsHandleObject.java (EmacsHandleObject):
Remove HANDLE argument to constructor.

* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap):

* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow):

* java/org/gnu/emacs/EmacsInputConnection.java
(EmacsInputConnection) <windowHandle>: Change type to long.

* java/org/gnu/emacs/EmacsNative.java (EmacsNative)
(sendConfigureNotify, sendKeyPress, sendKeyRelease, sendFocusIn)
(sendFocusOut, sendWindowAction, sendEnterNotify)
(sendLeaveNotify, sendMotionNotify, sendButtonPress)
(sendButtonRelease, sendTouchDown, sendTouchUp, sendTouchMove)
(sendWheel, sendIconified, sendDeiconified, sendContextMenu)
(sendExpose, sendDndDrag, sendDndUri, sendDndText)
(beginBatchEdit, commitCompletion, endBatchEdit, commitText)
(deleteSurroundingText, finishComposingText, replaceText)
(getSelectedText, getTextAfterCursor, getTextBeforeCursor)
(setComposingText, setComposingRegion, setSelection)
(performEditorAction, performContextMenuAction, getExtractedText)
(requestSelectionUpdate, requestCursorUpdates, clearInputFlags)
(getSurroundingText, takeSnapshot, getSelection): Accept handles
as longs, rather than shorts.  All callers changed.

* java/org/gnu/emacs/EmacsService.java (queryTree): Return
handles as longs rather than shorts.
(viewGetSelection): Take long WINDOW, not short.

* src/android.c (struct android_emacs_handle): New structure.
(handle_class): New variable.
(android_init_emacs_service, android_init_emacs_pixmap)
(android_init_emacs_gc_class, android_init_emacs_cursor): Adjust
to match signature changes in constructors.
(android_init_emacs_handle): New function.
(initEmacs): Initialize the handle class, its fields and metods.
(sendConfigureNotify, sendKeyPress, sendKeyRelease, sendFocusIn)
(sendFocusOut, sendWindowAction, sendEnterNotify)
(sendLeaveNotify, sendMotionNotify, sendButtonPress)
(sendButtonRelease, sendTouchDown, sendTouchUp, sendTouchMove)
(sendWheel, sendIconified, sendDeiconified, sendContextMenu)
(sendExpose, sendDndDrag, sendDndUri, sendDndText): Update for
changes to handle type.
(android_alloc_id, android_resolve_handle)
(android_resolve_handle2): Remove functions; replace the second
with a macro that accepts one fewer argument.  All callers
changed.
(android_destroy_handle): Cease indexing the handle list for the
handle object.
(android_globalize_reference): New function.
(android_create_window, android_create_gc, android_create_pixmap)
(android_create_font_cursor): Call android_globalize_reference
to convert global references into handles.
(android_free_cursor, android_destroy_window): Cease verifying
the handle type.
(android_copy_area): Check destination object type rather than
handle entry.
(android_query_tree): Adjust for changes to return types.
(likely): Define __builtin_expect variant unconditionally.

* src/android.h (android_resolve_handle): New macro.

* src/androidgui.h (android_handle): Define to intptr_t.

* src/androidterm.c (deleteSurroundingText, finishComposingText)
(performEditorAction, performContextMenuAction, getExtractedText)
(getSelectedText, requestSelectionUpdate, requestCursorUpdates)
(clearInputFlags, getSurroundingText)
(android_get_surrounding_text_internal): Accept handles as
longs, not jshorts.
2024-05-04 11:36:09 +08:00
Po Lu
7a7dd87842 ; * src/lread.c (warn_missing_cookie): Fix typo. 2024-05-04 11:12:16 +08:00
Po Lu
a5acc89712 * src/lread.c (warn_missing_cookie): Exempt the user init file. 2024-05-04 11:11:36 +08:00
Stefan Monnier
d0e391957b * lisp/progmodes/eglot.el (eglot--track-changes-signal): More typo 2024-05-03 16:51:57 -04:00
Stefan Monnier
c9b0e2bd8e * lisp/emacs-lisp/track-changes.el (track-changes-inconsistent-state-p): Typo 2024-05-03 16:39:29 -04:00
Philip Kaludercic
3d4918c2f1 Query Eglot version via package.el
* lisp/progmodes/eglot.el (eglot--version): Remove constant.
(eglot--connect): Use 'package-get-version'.
2024-05-03 20:14:20 +02:00
Mattias Engdegård
81bad84a61 Warn when loading .el files without lexical-binding declaration
This corresponds to the byte-compiler warning for the same issue,
here emitted for files that aren't compiled but loaded from source.
It should make the planned change to enable lexical binding by default
in Emacs 31 go smoother.

* src/lread.c (lexical_cookie_t): New type.
(lisp_file_lexically_bound_p): Renamed to...
(lisp_file_lexical_cookie): ...this, with the return value retyped.
* src/lread.c (warn_missing_cookie): New.
(Fload): Warn when loading source file and cookie missing.
(Feval_buffer): Add LOADING arg; warn when set and cookie missing.
* lisp/international/mule.el (load-with-code-conversion):
* lisp/startup.el (command-line--load-script):
Call eval-buffer with LOADING arg set.
* etc/NEWS: Announce.
2024-05-03 19:27:26 +02:00
Stefan Monnier
b6d4e81a48 track-changes.el: Add a workaround for bug#70541
* lisp/emacs-lisp/track-changes.el (track-changes-inconsistent-state-p):
 New function.
* lisp/progmodes/eglot.el (eglot--track-changes-signal): Use it.
2024-05-03 13:23:00 -04:00
Ihor Radchenko
15c77f2fce mhtml-mode: Use run-mode-hook' to run prog-mode-hook' (bug#70671)
* lisp/textmodes/mhtml-mode.el (mhtml-mode): When running hooks
simulating inheritance from `prog-mode', use `run-mode-hooks' that
honors `delay-mode-hooks' macro.  Note that `delay-mode-hooks' is bound
to non-nil when major mode body is evaluated, so there is no chance that
any major mode-related hooks are executed twice.
2024-05-03 11:02:54 -04:00
Juri Linkov
4078d0fd3e * doc/lispref/keymaps.texi (Creating Keymaps): Add :repeat :hints (bug#70576). 2024-05-03 09:22:39 +03:00
Elias G. Perez
dc77164104 Fix bug#70711
* lisp/progmodes/flymake.el (flymake--indicator-overlay-spec):
Check if `flymake-fringe-indicator-position' or
`flymake-margin-indicator-position' are non-nil for allow no
indicators.
2024-05-03 09:16:39 +03:00
Lin Sun
a2ccda71c1 Only run 'eshell-first-time-mode-hook' once per Emacs session
* lisp/eshell/esh-mode.el (eshell-mode): Set 'eshell-first-time-p' to
nil (bug#70610).
2024-05-02 20:13:20 -07:00
Po Lu
6171a9a628 Prevent reporting of crashes when Emacs is restarted on Android
* src/emacs.c (Fkill_emacs): Ignore SIGBUS and SIGSGEV
immediately before calling exit.
2024-05-03 10:46:35 +08:00
F. Jason Park
068e44ed75 ; Set explicit hook depth for erc-once-with-server-event
* lisp/erc/erc.el (erc-once-with-server-event): Set hook depth to -95.
* test/lisp/erc/erc-scenarios-base-association-nick.el: Improve
comment.
* test/lisp/erc/resources/erc-d/erc-d-tests.el
(erc-d--render-entries): Remove do-nothing assertion since its purpose
was unclear and likely dubious, as was incidentally highlighted by the
addition of a function not present on older Emacsen, which this test
still needs to run on.
2024-05-02 19:21:48 -07:00
Mattias Engdegård
a156c98df0 Eliminate string data mutation in ruler-mode
* lisp/ruler-mode.el (ruler-mode-ruler):
Mutate a vector instead of a string.
2024-05-02 21:56:40 +02:00
Juri Linkov
14cd4fce4b * lisp/tab-bar.el: Support mouse clicks bound in keymap properties.
(tab-bar--event-to-item): Handle mouse bindings for commands
bound in keymap properties of global-mode-string (bug#70086).
(tab-bar-mouse-down-1, tab-bar-mouse-1, tab-bar-touchscreen-begin):
Add the symbol 'global' to the list of handled items.
2024-05-02 20:55:03 +03:00
Juri Linkov
a914667a00 Make the buffer displayed by tab-bar-select-restore-windows internal
* lisp/tab-bar.el (tab-bar-select-restore-windows): Make the buffer
" *Old buffer %s*" internal with the leading space in its name.
2024-05-02 20:44:04 +03:00
Eli Zaretskii
12e3ffcc97 ; Fix last change
* etc/NEWS: Fix wording of a recently-added item.

* doc/lispref/functions.texi (Declare Form): Fix markup.
2024-05-02 19:30:40 +03:00
Andrea Corallo
da8b06bd61 Merge branch 'lisp-func-type-decls' into 'master' 2024-05-02 17:06:07 +02:00
Andrea Corallo
64d3100cb5 etc/NEWS (Function type declaration): Mark it +++. 2024-05-02 16:58:59 +02:00
Andrea Corallo
02690d95f9 * doc/lispref/functions.texi (Declare Form): Improve again declare type. 2024-05-02 16:58:59 +02:00
Andrea Corallo
390b606ffc * doc/lispref/functions.texi (Declare Form): Better warn about UB. 2024-05-02 16:39:57 +02:00
Mattias Engdegård
2f5c9b3116 Add lexical cookie to new init files
* lisp/cus-edit.el (custom-save-all):
Add lexical cookie if the file is empty.
2024-05-02 13:34:22 +02:00
Eli Zaretskii
59c18389bd ; Fix last change
* lisp/progmodes/python.el (python-shell-send-block): Doc fix.

* test/lisp/progmodes/python-tests.el
(python-test--shell-send-block): Avoid byte-compiler warnings.
(Bug#70609)
2024-05-02 13:04:15 +03:00
Lin Sun
b2e92c746e New function 'python-shell-send-block' for python-mode
* lisp/progmodes/python.el (python-shell-send-block): New
function.
* test/lisp/progmodes/python-tests.el
(python-test--shell-send-block): Test case for the new
function.
* etc/NEWS: Document 'python-shell-send-block'.
(Bug#70609)
2024-05-02 12:56:31 +03:00
Ihor Radchenko
bf00762745 Improve performance of `file-truename' (bug#70036)
* lisp/files.el (file-truename): Avoid repetitive calls to
`file-name-nondirectory'.  These calls contribute
significantly to CPU time.  See the benchmarks in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70036#47
2024-05-02 12:39:39 +03:00
kobarity
d15efe965d Add ExceptionGroup as a Python keyword
* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration)
(python--treesit-exceptions): Add ExceptionGroup.  (Bug#70653)
2024-05-02 12:34:16 +03:00
Po Lu
ef6ffbdc79 Fix display of stipples on NS with respect to cursor highlight
* src/nsfont.m (nsfont_draw): Delete redundant code.

* src/nsterm.m (ns_maybe_dumpglyphs_background): Conform logic
to X version by always displaying the background if s->stipple_p
should be set.
(ns_draw_stretch_glyph_string): Set stipple background as
appropriate.
(ns_set_glyph_string_gc): New function.
(ns_draw_glyph_string): Call it, as on X.  Reported by Arash
Esbati <arash@gnu.org>.
2024-05-02 17:27:30 +08:00
Eli Zaretskii
b392169e54 ; * doc/lispref/commands.texi (Event Mod): Add motivation (bug#70596). 2024-05-02 12:20:09 +03:00
Lin Sun
0e0fe20040 ; Fix python test case for testing completion with ipython
* test/lisp/progmodes/python-tests.el
(python-shell-completion-at-point-ipython): Fix value of
'python-test-shell-interpreter'.  (Bug#70578)
2024-05-02 12:04:52 +03:00
Augusto Stoffel
b98a6af8ca Eglot: Add 'command-modes' property to all suitable commands
Those are the commands that call 'eglot--current-server-or-lose'.
* lisp/progmodes/eglot.el (eglot--managed-mode),
(eglot-list-connections-mode): Make non-interactive.  (Bug#70554)
2024-05-02 11:50:57 +03:00
Juri Linkov
592873a52d * lisp/emacs-lisp/warnings.el: Fix 'warning-display-at-bottom'.
(display-warning): Move point to the beginning of the last line
instead of its end for 'warning-display-at-bottom' (bug#69983).
2024-05-02 09:54:22 +03:00
Eli Zaretskii
7d15d17353 ; Improve commentary in intervals.h
* src/intervals.h (INTERVAL_GENERALLY_WRITABLE_P)
(INTERVAL_EXPRESSLY_WRITABLE_P): Clarify commentary.
2024-05-02 09:50:37 +03:00
Juri Linkov
0023891e84 Support hints in the :repeat keyword of defvar-keymap for repeat-mode
* lisp/keymap.el (defvar-keymap): Add :hints to the :repeat keyword.
Put the property 'repeat-hint' on the command symbol.

* lisp/repeat.el (repeat-echo-message-string): Show hint strings
defined with the property 'repeat-hint' on the command symbol (bug#70576).
2024-05-02 09:46:48 +03:00
Juri Linkov
a1613505e2 * lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): Add 'text' (bug#67036).
Add 'text' lambda to 'treesit-thing-settings' that should fall back
to the default functions for sentence/sexp navigation.
2024-05-02 09:28:53 +03:00
Yuan Fu
bf026b8e55
Tighten regexp for rust-ts-mode keyword workaround
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
Add bos and eos.
2024-05-01 21:50:21 -07:00
Yuan Fu
07c47ea002
Fix fontification for else in macro body in rust-ts-mode
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
Add a rule for else in macro body.  Also added the same rule for "in"
and "move" keyword, as they seems to have the same problem.
2024-05-01 21:26:30 -07:00
Noah Peart
0f92d433d2
Add font-locking for typed parameters in python-ts-mode (bug#70665)
* lisp/progmodes/python.el (python--treesit-settings): Add
tree-sitter font-locking rule for typed parameters.
* test/lisp/progmodes/python-tests.el
(python-ts-mode-types-face-1): Test for
font-lock-variable-name-face in typed parameter.
2024-05-01 21:26:29 -07:00