emacs.git
19 months agotextsec: handle email address without domain part
Andreas Schwab [Fri, 28 Jul 2023 09:53:03 +0000 (11:53 +0200)]
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.

19 months ago(ruler-mode-ruler): Minor optimization
Stefan Monnier [Sat, 4 May 2024 16:06:16 +0000 (12:06 -0400)]
(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.

19 months agoAllow `letrec` binding without init expression
Mattias Engdegård [Sat, 4 May 2024 12:09:23 +0000 (14:09 +0200)]
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.

19 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 4 May 2024 12:10:54 +0000 (08:10 -0400)]
Merge from origin/emacs-29

b392169e541 ; * doc/lispref/commands.texi (Event Mod): Add motivation...
e272fd3da92 ; Update description of 'mail-mode'

19 months ago; Fix last change
Eli Zaretskii [Sat, 4 May 2024 11:51:05 +0000 (14:51 +0300)]
; Fix last change

* lisp/progmodes/python.el
(python-shell-compilation-regexp-alist): Add :version.
(Bug#70653)

19 months agoLocate error source of ExceptionGroup in Python shell
shynur [Fri, 3 May 2024 11:40:23 +0000 (19:40 +0800)]
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.

19 months agoFix implementation of the --terminal command-line switch
Eli Zaretskii [Sat, 4 May 2024 10:12:21 +0000 (13:12 +0300)]
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)

19 months agoOnly issue lexical cookie warning for elisp files
Mattias Engdegård [Sat, 4 May 2024 08:08:19 +0000 (10:08 +0200)]
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.

19 months agoSimplify handling of command-line arguments on Android
Po Lu [Sat, 4 May 2024 08:06:00 +0000 (16:06 +0800)]
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.

19 months agoDelete redundant backquotes in android-win.el
Po Lu [Sat, 4 May 2024 06:54:12 +0000 (14:54 +0800)]
Delete redundant backquotes in android-win.el

* lisp/term/android-win.el (android-encode-jni)
(android-decode-jni): Replace redundant backquotes with ordinary
quotes.

19 months ago; * etc/NEWS: Fix last change.
Eli Zaretskii [Sat, 4 May 2024 06:57:05 +0000 (09:57 +0300)]
; * etc/NEWS: Fix last change.

19 months ago; * etc/NEWS: Fix a recently-added entry.
Eli Zaretskii [Sat, 4 May 2024 06:34:18 +0000 (09:34 +0300)]
; * etc/NEWS: Fix a recently-added entry.

19 months agoSimplify management of Android handle IDs
Po Lu [Sat, 4 May 2024 03:36:09 +0000 (11:36 +0800)]
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.

19 months ago; * src/lread.c (warn_missing_cookie): Fix typo.
Po Lu [Sat, 4 May 2024 03:12:16 +0000 (11:12 +0800)]
; * src/lread.c (warn_missing_cookie): Fix typo.

19 months ago* src/lread.c (warn_missing_cookie): Exempt the user init file.
Po Lu [Sat, 4 May 2024 03:11:36 +0000 (11:11 +0800)]
* src/lread.c (warn_missing_cookie): Exempt the user init file.

19 months ago* lisp/progmodes/eglot.el (eglot--track-changes-signal): More typo
Stefan Monnier [Fri, 3 May 2024 20:51:57 +0000 (16:51 -0400)]
* lisp/progmodes/eglot.el (eglot--track-changes-signal): More typo

19 months ago* lisp/emacs-lisp/track-changes.el (track-changes-inconsistent-state-p): Typo
Stefan Monnier [Fri, 3 May 2024 20:39:10 +0000 (16:39 -0400)]
* lisp/emacs-lisp/track-changes.el (track-changes-inconsistent-state-p): Typo

19 months agoQuery Eglot version via package.el
Philip Kaludercic [Thu, 7 Mar 2024 09:21:45 +0000 (10:21 +0100)]
Query Eglot version via package.el

* lisp/progmodes/eglot.el (eglot--version): Remove constant.
(eglot--connect): Use 'package-get-version'.

19 months agoWarn when loading .el files without lexical-binding declaration
Mattias Engdegård [Fri, 3 May 2024 15:58:44 +0000 (17:58 +0200)]
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.

19 months agotrack-changes.el: Add a workaround for bug#70541
Stefan Monnier [Fri, 3 May 2024 17:23:00 +0000 (13:23 -0400)]
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.

19 months agomhtml-mode: Use `run-mode-hook' to run `prog-mode-hook' (bug#70671)
Ihor Radchenko [Fri, 3 May 2024 07:46:22 +0000 (10:46 +0300)]
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.

19 months ago* doc/lispref/keymaps.texi (Creating Keymaps): Add :repeat :hints (bug#70576).
Juri Linkov [Fri, 3 May 2024 06:22:39 +0000 (09:22 +0300)]
* doc/lispref/keymaps.texi (Creating Keymaps): Add :repeat :hints (bug#70576).

19 months agoFix bug#70711
Elias G. Perez [Thu, 2 May 2024 16:33:43 +0000 (10:33 -0600)]
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.

19 months agoOnly run 'eshell-first-time-mode-hook' once per Emacs session
Lin Sun [Sat, 27 Apr 2024 06:55:49 +0000 (06:55 +0000)]
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).

19 months agoPrevent reporting of crashes when Emacs is restarted on Android
Po Lu [Fri, 3 May 2024 02:43:31 +0000 (10:43 +0800)]
Prevent reporting of crashes when Emacs is restarted on Android

* src/emacs.c (Fkill_emacs): Ignore SIGBUS and SIGSGEV
immediately before calling exit.

19 months ago; Set explicit hook depth for erc-once-with-server-event
F. Jason Park [Thu, 25 Apr 2024 12:09:50 +0000 (05:09 -0700)]
; 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.

19 months agoEliminate string data mutation in ruler-mode
Mattias Engdegård [Thu, 2 May 2024 19:49:40 +0000 (21:49 +0200)]
Eliminate string data mutation in ruler-mode

* lisp/ruler-mode.el (ruler-mode-ruler):
Mutate a vector instead of a string.

19 months ago* lisp/tab-bar.el: Support mouse clicks bound in keymap properties.
Juri Linkov [Thu, 2 May 2024 17:55:03 +0000 (20:55 +0300)]
* 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.

19 months agoMake the buffer displayed by tab-bar-select-restore-windows internal
Juri Linkov [Thu, 2 May 2024 17:44:04 +0000 (20:44 +0300)]
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.

19 months ago; Fix last change
Eli Zaretskii [Thu, 2 May 2024 16:30:40 +0000 (19:30 +0300)]
; Fix last change

* etc/NEWS: Fix wording of a recently-added item.

* doc/lispref/functions.texi (Declare Form): Fix markup.

19 months agoMerge branch 'lisp-func-type-decls' into 'master'
Andrea Corallo [Thu, 2 May 2024 15:06:07 +0000 (17:06 +0200)]
Merge branch 'lisp-func-type-decls' into 'master'

19 months agoetc/NEWS (Function type declaration): Mark it +++.
Andrea Corallo [Thu, 2 May 2024 14:42:45 +0000 (16:42 +0200)]
etc/NEWS (Function type declaration): Mark it +++.

19 months ago* doc/lispref/functions.texi (Declare Form): Improve again declare type.
Andrea Corallo [Thu, 2 May 2024 14:38:14 +0000 (16:38 +0200)]
* doc/lispref/functions.texi (Declare Form): Improve again declare type.

19 months ago* doc/lispref/functions.texi (Declare Form): Better warn about UB.
Andrea Corallo [Thu, 2 May 2024 10:15:30 +0000 (12:15 +0200)]
* doc/lispref/functions.texi (Declare Form): Better warn about UB.

19 months agoAdd lexical cookie to new init files
Mattias Engdegård [Thu, 2 May 2024 11:34:22 +0000 (13:34 +0200)]
Add lexical cookie to new init files

* lisp/cus-edit.el (custom-save-all):
Add lexical cookie if the file is empty.

19 months ago; Fix last change
Eli Zaretskii [Thu, 2 May 2024 10:04:15 +0000 (13:04 +0300)]
; 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)

19 months agoNew function 'python-shell-send-block' for python-mode
Lin Sun [Sat, 27 Apr 2024 06:54:27 +0000 (06:54 +0000)]
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)

19 months agoImprove performance of `file-truename' (bug#70036)
Ihor Radchenko [Tue, 30 Apr 2024 11:27:04 +0000 (14:27 +0300)]
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

19 months agoAdd ExceptionGroup as a Python keyword
kobarity [Tue, 30 Apr 2024 05:10:57 +0000 (14:10 +0900)]
Add ExceptionGroup as a Python keyword

* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration)
(python--treesit-exceptions): Add ExceptionGroup.  (Bug#70653)

19 months agoFix display of stipples on NS with respect to cursor highlight
Po Lu [Thu, 2 May 2024 08:56:26 +0000 (16:56 +0800)]
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>.

19 months ago; * doc/lispref/commands.texi (Event Mod): Add motivation (bug#70596).
Eli Zaretskii [Thu, 2 May 2024 09:20:09 +0000 (12:20 +0300)]
; * doc/lispref/commands.texi (Event Mod): Add motivation (bug#70596).

19 months ago; Fix python test case for testing completion with ipython
Lin Sun [Thu, 25 Apr 2024 06:54:27 +0000 (06:54 +0000)]
; 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)

19 months agoEglot: Add 'command-modes' property to all suitable commands
Augusto Stoffel [Sun, 21 Apr 2024 09:21:58 +0000 (11:21 +0200)]
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)

19 months ago* lisp/emacs-lisp/warnings.el: Fix 'warning-display-at-bottom'.
Juri Linkov [Thu, 2 May 2024 06:53:06 +0000 (09:53 +0300)]
* 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).

19 months ago; Improve commentary in intervals.h
Eli Zaretskii [Thu, 2 May 2024 06:50:37 +0000 (09:50 +0300)]
; Improve commentary in intervals.h

* src/intervals.h (INTERVAL_GENERALLY_WRITABLE_P)
(INTERVAL_EXPRESSLY_WRITABLE_P): Clarify commentary.

19 months agoSupport hints in the :repeat keyword of defvar-keymap for repeat-mode
Juri Linkov [Thu, 2 May 2024 06:46:48 +0000 (09:46 +0300)]
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).

19 months ago* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): Add 'text' (bug#67036).
Juri Linkov [Thu, 2 May 2024 06:28:53 +0000 (09:28 +0300)]
* 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.

19 months agoTighten regexp for rust-ts-mode keyword workaround
Yuan Fu [Thu, 2 May 2024 04:50:21 +0000 (21:50 -0700)]
Tighten regexp for rust-ts-mode keyword workaround

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
Add bos and eos.

19 months agoFix fontification for else in macro body in rust-ts-mode
Yuan Fu [Thu, 2 May 2024 04:21:00 +0000 (21:21 -0700)]
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.

19 months agoAdd font-locking for typed parameters in python-ts-mode (bug#70665)
Noah Peart [Tue, 30 Apr 2024 09:55:18 +0000 (02:55 -0700)]
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.

19 months agoPort visible bell to Android
Po Lu [Thu, 2 May 2024 03:31:37 +0000 (11:31 +0800)]
Port visible bell to Android

* java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Ignore
GC_INVERT.

* java/org/gnu/emacs/EmacsFillRectangle.java
(EmacsFillRectangle) <invertFilter>: New variable.
(perform): If the transfer mode is invert, copy the source
to itself with invertFilter as the color filter.

* java/org/gnu/emacs/EmacsGC.java (EmacsGC) <xorAlu, srcInAlu>:
Delete now-redundant ALUs.
(markDirty): Cease updating the paint's transfermode.

* java/org/gnu/emacs/EmacsSafThread.java (openDocument1): Fix
typo in documentation.

* src/android.c (android_blit_xor): Delete unused function.
(android_copy_area): Remove calls to unused blit functions.

* src/androidgui.h (enum android_gc_function): Rename XOR to
INVERT.

* src/androidterm.c (android_flash): Replace with GXinvert.

19 months agoSwitch to GXinvert in XTflash
Po Lu [Thu, 2 May 2024 02:23:09 +0000 (10:23 +0800)]
Switch to GXinvert in XTflash

* src/xterm.c (XTflash): Move to inverting the regions of the
display being flashed.  Suggested by Manuel Giraud
<manuel@ledu-giraud.fr>.

19 months ago; * doc/emacs/android.texi (Android Startup): Correct wording.
Po Lu [Thu, 2 May 2024 01:54:16 +0000 (09:54 +0800)]
; * doc/emacs/android.texi (Android Startup): Correct wording.

19 months ago; Update commentary in intervals.h
Po Lu [Thu, 2 May 2024 01:51:31 +0000 (09:51 +0800)]
; Update commentary in intervals.h

* src/intervals.h (INTERVAL_GENERALLY_WRITABLE_P)
(INTERVAL_EXPRESSLY_WRITABLE_P): Mention significance of RO.

19 months ago* etc/NEWS (Function type declaration): Add entry.
Andrea Corallo [Wed, 1 May 2024 20:49:01 +0000 (22:49 +0200)]
* etc/NEWS (Function type declaration): Add entry.

19 months ago(disassemble): Fix case of `(byte-code ...)` argument
Andrea Corallo [Wed, 1 May 2024 18:14:01 +0000 (14:14 -0400)]
(disassemble): Fix case of `(byte-code ...)` argument

* lisp/emacs-lisp/disass.el (disassemble): Handle (byte-code ...) here..
(disassemble-internal): ...instead of here.
(disassemble-1): Adjust text to reflect the existence of other
compiled functions.

19 months ago* doc/lispref/functions.texi (Declare Form): Improve declare type.
Andrea Corallo [Wed, 1 May 2024 18:03:02 +0000 (20:03 +0200)]
* doc/lispref/functions.texi (Declare Form): Improve declare type.

19 months agoAdd Compat as an Eglot dependency
Philip Kaludercic [Sat, 9 Mar 2024 07:11:03 +0000 (08:11 +0100)]
Add Compat as an Eglot dependency

* lisp/progmodes/eglot.el (eglot--format-markup): Remove fboundp
check for 'text-property-search-forward'.
(eglot-alternatives): Use Compat's 'executable-find'
(eglot--executable-find): Remove function.

Additionally this should make 'package-get-version' available
for releases of Emacs previous to 27.1.  (bug#62198)

19 months agoFix minor typos in haikuterm.c
Po Lu [Wed, 1 May 2024 13:34:50 +0000 (21:34 +0800)]
Fix minor typos in haikuterm.c

* src/haikuterm.c (haiku_fill_underline)
(haiku_draw_text_decoration): Don't pass view to unused frame
parameter.

19 months agoImplement dots and dashes on Nextstep
Po Lu [Wed, 1 May 2024 14:02:15 +0000 (22:02 +0800)]
Implement dots and dashes on Nextstep

* src/Makefile.in (NON_OBJC_CFLAGS): Add -Wstrict-flex-arrays.

* src/nsterm.m (ns_draw_dash, ns_fill_underline): New functions.
(ns_draw_text_decoration): Port dash and dot display from X.

19 months ago; Silence obsoletion warning in mwheel-tests.
Basil L. Contovounesios [Wed, 1 May 2024 11:08:30 +0000 (13:08 +0200)]
; Silence obsoletion warning in mwheel-tests.

19 months ago; Update pvec_type hash for CHECK_STRUCTS
Basil L. Contovounesios [Wed, 1 May 2024 11:07:17 +0000 (13:07 +0200)]
; Update pvec_type hash for CHECK_STRUCTS

This follows commit 2fa839c1886 of 2024-04-28
"(COMPILED): Rename to CLOSURE".

19 months agoAssume match before calling help-xref-button
Basil L. Contovounesios [Tue, 30 Apr 2024 06:31:58 +0000 (08:31 +0200)]
Assume match before calling help-xref-button

help-xref-button fails if not preceded by a valid match, so a
preceding unconditional search should not be allowed to fail
silently.

* lisp/emacs-lisp/ert.el (ert-describe-test):
* lisp/help-fns.el (help-fns--compiler-macro)
(help-fns-function-description-header, describe-variable)
(help-fns--customize-variable, describe-face)
(help-fns--face-attributes, describe-keymap): Let unconditional
re-search-backward before help-xref-button fail early, as that would
indicate a logic bug, and the backtrace would more accurately point
to the actual source of the mistake.

19 months agoDisable on-screen keyboard outside fields in Custom buffers
Po Lu [Wed, 1 May 2024 07:57:29 +0000 (15:57 +0800)]
Disable on-screen keyboard outside fields in Custom buffers

* lisp/cus-edit.el (Custom-display-on-screen-keyboard-p): New
function.
(Custom-mode): Install it as the touch-screen-keyboard-function.

* lisp/touch-screen.el (touch-screen-keyboard-function): New
variable.
(touch-screen-handle-point-up): Don't special-case the splash
screen with respect to touch-screen-display-keyboard in keeping
with user feedback.

19 months ago; * src/androidselect.c (extract_fd_offsets): Fix typos.
Po Lu [Wed, 1 May 2024 04:03:26 +0000 (12:03 +0800)]
; * src/androidselect.c (extract_fd_offsets): Fix typos.

19 months agoFix compatibility issues with Android clipboards
Po Lu [Wed, 1 May 2024 03:45:53 +0000 (11:45 +0800)]
Fix compatibility issues with Android clipboards

* java/org/gnu/emacs/EmacsClipboard.java (getClipboardData):
Return an AssetFileDescriptor.

* java/org/gnu/emacs/EmacsContextMenu.java (onMenuItemClick):
Typo corrections in commentary.

* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Raise
minimum version on which to read file descriptors from
ParcelFileDescriptor objects to Honeycomb.

* java/org/gnu/emacs/EmacsSdk11Clipboard.java
(getClipboardData): Return the asset file descriptor.

* java/org/gnu/emacs/EmacsSdk8Clipboard.java (getClipboardData):
Adjust return type to match.

* src/android.h (struct android_parcel_file_descriptor_class):
Move from androidselect.c.

* src/androidselect.c (fd_class): Export function.
(android_init_emacs_clipboard): Adjust signature of
getClipboardData.
(android_init_asset_file_descriptor, close_asset_fd)
(extract_fd_offsets): New functions.
(Fandroid_get_clipboard_data): Extract file descriptor and
offset from the AssetFileDescriptor here, rather than in
getClipboardData.
(init_androidselect): Call android_init_asset_file_descriptor.

* src/androidvfs.c (android_init_fd_class): Export and enable
calling this function more than once.

19 months ago; Fix widget button press cancellation
Po Lu [Wed, 1 May 2024 00:56:23 +0000 (08:56 +0800)]
; Fix widget button press cancellation

* lisp/wid-edit.el (widget-button--check-and-call-button): Throw
nil if a mouse-button-derived press is canceled.  Reported by
David Ponce <da_vid@orange.fr>.

19 months agoFix first appearance records for some misdated functions
Mattias Engdegård [Tue, 30 Apr 2024 16:01:52 +0000 (18:01 +0200)]
Fix first appearance records for some misdated functions

* etc/NEWS.unknown: Add approximate version records for
defsubst, mark, nreverse, let*, rassq, >=,
transpose-sexps, buffer-modified-p, current-column, downcase,
previous-line, catch, throw, and count-lines,
which all were given much more recent introduction versions
by describe-function.

19 months ago* lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Simplify.
Mattias Engdegård [Tue, 30 Apr 2024 13:20:34 +0000 (15:20 +0200)]
* lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Simplify.

19 months ago* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Simplify.
Mattias Engdegård [Tue, 30 Apr 2024 12:51:07 +0000 (14:51 +0200)]
* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Simplify.

Remove the add-lambda argument.  All callers adapted.

19 months ago; Update description of 'mail-mode'
Eli Zaretskii [Tue, 30 Apr 2024 13:04:26 +0000 (16:04 +0300)]
; Update description of 'mail-mode'

* doc/emacs/sending.texi (Mail Methods): More accurate description
of mail-mode's deficiencies.

19 months agoFix deletion of text holding `inhibit-read-only' properties
Po Lu [Tue, 30 Apr 2024 10:26:39 +0000 (18:26 +0800)]
Fix deletion of text holding `inhibit-read-only' properties

* src/intervals.h (INTERVAL_VISIBLE_P): Split into ...
(INTERVAL_GENERALLY_WRITABLE_P, INTERVAL_EXPRESSLY_WRITABLE_P):
... two new macros.

* src/textprop.c (verify_interval_modification): If the buffer
is read only, verify not that there is only a single exempting
interval spanning the area of a multiple-character operation,
but that every intervening interval in such an operation exempts
it from write restrictions, either by providing a read-only
property that appears in Vinhibit_read_only, or by providing an
inhibit-read-only property.

* test/src/textprop-tests.el (textprop-interval-immutability):
New test.

19 months agoWork around bad GCC diagnostic in select_window
Paul Eggert [Tue, 30 Apr 2024 08:20:13 +0000 (01:20 -0700)]
Work around bad GCC diagnostic in select_window

* src/textconv.c (select_window): Add an eassume to work
around GCC bug 114893.

19 months agoPacify GCC 14 -Wanalyzer-out-of-bounds in hbfont.c
Paul Eggert [Tue, 30 Apr 2024 08:20:13 +0000 (01:20 -0700)]
Pacify GCC 14 -Wanalyzer-out-of-bounds in hbfont.c

* src/hbfont.c (hbfont_shape): Add an eassume.

19 months agoPacify GCC 14 -Wstring-operflow in ftfont.c
Paul Eggert [Tue, 30 Apr 2024 08:20:13 +0000 (01:20 -0700)]
Pacify GCC 14 -Wstring-operflow in ftfont.c

* src/ftfont.c (ftfont_drive_otf): Do not crash if
spec->features[i] is nonnull but is empty.
Use gfeatures local to pacify GCC 14.

19 months agoPacify GCC 14 -Wnull-dereference in intervals.c
Paul Eggert [Tue, 30 Apr 2024 08:20:12 +0000 (01:20 -0700)]
Pacify GCC 14 -Wnull-dereference in intervals.c

* src/intervals.c (set_intervals_multibyte_1):
Add an eassume to pacify GCC.  Deparenthesisze.

19 months agoPacify GCC 14 -Wnull-dereference in tim_sort
Paul Eggert [Tue, 30 Apr 2024 08:20:12 +0000 (01:20 -0700)]
Pacify GCC 14 -Wnull-dereference in tim_sort

* src/lisp.h (tim_sort): Require array arg to be nonnull.
* src/sort.c (reverse_slice): Omit no-longer-needed eassert.
(tim_sort): Avoid undefined behavior when length == 0,
since reverse_slice would then compute &seq[-1].

19 months agoPacify GCC 14 -Wclobbered in eval.c
Paul Eggert [Tue, 30 Apr 2024 08:20:12 +0000 (01:20 -0700)]
Pacify GCC 14 -Wclobbered in eval.c

* src/eval.c: Ignore -Wclobbered.

19 months agoPacify GCC 14 -Wnull-dereference
Paul Eggert [Tue, 30 Apr 2024 08:20:12 +0000 (01:20 -0700)]
Pacify GCC 14 -Wnull-dereference

* src/xterm.c (x_dpyinfo): New function, which acts like
x_display_info_for_display except it always returns nonnull.
This simplifies callers and pacifies GCC 14.  All callers changed.

19 months agoPacify GCC 14 -Walloc-size
Paul Eggert [Tue, 30 Apr 2024 08:20:12 +0000 (01:20 -0700)]
Pacify GCC 14 -Walloc-size

* src/xfns.c (xic_string_conversion_callback): Allocate size 1, not 0.

19 months agoetags: work around GCC bug 114882
Paul Eggert [Tue, 30 Apr 2024 08:20:12 +0000 (01:20 -0700)]
etags: work around GCC bug 114882

* lib-src/etags.c: Ignore -Wanalyzer-use-of-uninitialized-value.
This applies to the whole source file, not just to areas where GCC
has bugs, as it was too tricky to ignore more selectively.

19 months agoetags: fix #line parsing (\\", long lines)
Paul Eggert [Tue, 30 Apr 2024 08:20:12 +0000 (01:20 -0700)]
etags: fix #line parsing (\\", long lines)

* lib-src/etags.c (readline): Don’t mishandle lines like
‘#line 1 "a//"’, which has an escaped backslash before ‘"’.
Don’t mishandle lines so long that sscanf overflows %n.

19 months agoSimplify etags.c by omitting a macro
Paul Eggert [Tue, 30 Apr 2024 08:20:12 +0000 (01:20 -0700)]
Simplify etags.c by omitting a macro

* lib-src/etags.c (xnew): Remove.  All uses removed.
xnew was confusing, as sometimes it was used with n=1,
sometimes with Type=char, and it’s easier just to use xmalloc
or xnmalloc.

19 months ago; etc/NEWS.unknown: Quote command invocation.
Michael Albinus [Tue, 30 Apr 2024 07:28:07 +0000 (09:28 +0200)]
; etc/NEWS.unknown: Quote command invocation.

19 months agoImprove treesitter tests on EMBA
Michael Albinus [Tue, 30 Apr 2024 07:25:53 +0000 (09:25 +0200)]
Improve treesitter tests on EMBA

* test/infra/Makefile.in (subdir_template):
* test/infra/gitlab-ci.yml (.tree-sitter-template): Check also
textmodes subdirectory for treesitter files.

* test/infra/test-jobs.yml: Regenerate.

19 months ago* test/README (EMACS_EXTRAOPT): Add environment variable.
Michael Albinus [Tue, 30 Apr 2024 07:25:07 +0000 (09:25 +0200)]
* test/README (EMACS_EXTRAOPT): Add environment variable.

19 months ago* lisp/emacs-lisp/regexp-opt.el (regexp-opt): Fix type declaration.
Andrea Corallo [Tue, 30 Apr 2024 07:19:31 +0000 (09:19 +0200)]
* lisp/emacs-lisp/regexp-opt.el (regexp-opt): Fix type declaration.

19 months agoMinor adjustments to eww text field change handlers
Po Lu [Tue, 30 Apr 2024 05:21:59 +0000 (13:21 +0800)]
Minor adjustments to eww text field change handlers

* lisp/net/eww.el (eww-check-text-conversion): Fix doc string.
(eww-mode): Specify face, eww-form and field as nonsticky
properties by default.
(eww-tag-textarea, eww-form-text): Render properties
front-sticky.
(eww-process-text-input): Use field functions to compute field
bounds.

19 months agoUse the nthcdr byte-op for drop, and raise open-code limit
Mattias Engdegård [Mon, 29 Apr 2024 18:24:07 +0000 (20:24 +0200)]
Use the nthcdr byte-op for drop, and raise open-code limit

* lisp/emacs-lisp/byte-opt.el (byte-optimize-nthcdr):
Open-code for any integral N<5.  Always use the byte-op otherwise.

19 months agoAdd (semi-redundant) fix to nnatom backend declaration
Eric Abrahamsen [Mon, 29 Apr 2024 20:13:38 +0000 (13:13 -0700)]
Add (semi-redundant) fix to nnatom backend declaration

* lisp/gnus/gnus.el (gnus-valid-select-methods): We need a value for
post/mail/none in order to conform to the option type.
* lisp/gnus/nnatom.el: This call to gnus-declare-backend does the exact
same thing as above, and needs to be adjusted accordingly.

19 months agoRename property 'declared-type' to 'function-type'
Andrea Corallo [Mon, 29 Apr 2024 18:31:05 +0000 (20:31 +0200)]
Rename property 'declared-type' to 'function-type'

* lisp/emacs-lisp/byte-run.el (byte-run--set-function-type): Rename.
(defun-declarations-alist): Update.
* lisp/emacs-lisp/comp.el (comp--get-function-cstr): Likewise.

19 months ago(disassemble-internal): Handle new function values
Stefan Monnier [Mon, 29 Apr 2024 17:47:15 +0000 (13:47 -0400)]
(disassemble-internal): Handle new function values

* lisp/emacs-lisp/disass.el (disassemble-internal): Fix the
`interpreted-function` case.

19 months agooclosure-tests.el: Adjust to new `interpreted-function` type
Stefan Monnier [Mon, 29 Apr 2024 17:34:23 +0000 (13:34 -0400)]
oclosure-tests.el: Adjust to new `interpreted-function` type

* test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test-gen): Adjust to
new `interpreted-function` type.
(oclosure-test): Tweak accordingly.

19 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Mon, 29 Apr 2024 17:36:36 +0000 (20:36 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

19 months ago* Document function type declarations
Andrea Corallo [Mon, 29 Apr 2024 16:08:57 +0000 (18:08 +0200)]
* Document function type declarations

* doc/lispref/functions.texi (Declare Form): Document function type
declaration.

19 months agoMove lisp function arg type declarations to the functions itself
Andrea Corallo [Wed, 10 Apr 2024 20:07:16 +0000 (22:07 +0200)]
Move  lisp function arg type declarations to the functions itself

* lisp/emacs-lisp/comp-common.el (comp-primitive-type-specifiers):
Remove type declaration of lisp functions.
* lisp/window.el (get-lru-window, get-largest-window)
(one-window-p): Declare type.
* lisp/subr.el (ignore, error, zerop, fixnump, bignump, lsh)
(last, eventp, mouse-movement-p, log10, memory-limit)
(interactive-p): Likewise.
* lisp/simple.el (count-lines, mark, lax-plist-get): Likewise.
* lisp/files.el (parse-colon-path): Likewise.
* lisp/env.el (getenv): Likewise.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt): Likewise.
* lisp/emacs-lisp/lisp.el (buffer-end): Likewise.
* lisp/emacs-lisp/comp.el (comp-hint-fixnum, comp-hint-cons): Likewise.
* lisp/custom.el (custom-variable-p): Likewise.

19 months agoMake use of Lisp function declarations
Andrea Corallo [Fri, 23 Feb 2024 14:56:47 +0000 (15:56 +0100)]
Make use of Lisp function declarations

* lisp/emacs-lisp/comp.el (comp-primitive-func-cstr-h): Rename.
(comp--get-function-cstr): Define new function.
(comp--add-call-cstr, comp--fwprop-call): Update.
* lisp/emacs-lisp/comp-common.el (comp-function-type-spec): Update.
* lisp/help-fns.el (help-fns--signature): Mention when a type is
declared.
* lisp/emacs-lisp/comp.el (comp-primitive-func-cstr-h): Rename.

19 months ago(byte-compile): Fix interaction with old `advice.el`
Stefan Monnier [Mon, 29 Apr 2024 17:14:31 +0000 (13:14 -0400)]
(byte-compile): Fix interaction with old `advice.el`

* lisp/emacs-lisp/bytecomp.el (byte-compile): Handle symbols whose
function "value" is a bare lambda expression (bug#70368).

19 months ago* Add function type declarations for Lisp functions
Andrea Corallo [Fri, 23 Feb 2024 09:17:27 +0000 (10:17 +0100)]
* Add function type declarations for Lisp functions

* lisp/emacs-lisp/byte-run.el (byte-run--set-declared-type): Add alias.
(defun-declarations-alist): Use it for 'type' declaration.

19 months ago; Fix documentation of recent commits.
Eli Zaretskii [Mon, 29 Apr 2024 12:32:12 +0000 (15:32 +0300)]
; Fix documentation of recent commits.

* lisp/touch-screen.el (touch-screen-handle-point-up): Fix
comments.

* lisp/net/eww.el (eww-check-text-conversion, eww-select-file)
(eww-toggle-checkbox, eww-submit): Doc fixes.

* doc/emacs/input.texi (On-Screen Keyboards): Fix punctuation and
wording.