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

174144 commits

Author SHA1 Message Date
Stefan Kangas
fcb4d89aaa Prefer memcpy to strcpy in image.c
* src/image.c (lookup_image, xpm_cache_color)
(imagemagick_create_cache): Prefer 'memcpy' to 'strcpy'.
2024-07-16 04:12:35 +02:00
Stefan Kangas
72ba45e274 Restrict loop variable scope in xpm_str_to_color_key
* src/image.c (xpm_str_to_color_key): Restrict scope of
loop variable.
2024-07-16 04:12:34 +02:00
Spencer Baugh
6b2f51633e Add project argument to project-kill-buffers
Previously, project-kill-buffers always called (project-current t).  A
Lisp program could change what project project-kill-buffers operated
on by binding project-current-directory-override.  However, in some
edge cases (for example, if the project was deleted between looking it
up and calling project-kill-buffers) this might fail to detect a
project, and so (project-current t) would prompt the user.

To avoid this, accept the project to kill buffers for as an argument.

* lisp/progmodes/project.el (project-kill-buffers): Take project as an
optional argument (bug#72019).
2024-07-16 04:59:11 +03:00
Po Lu
46f2c94949 Merge from savannah/emacs-30
5ec73eca57 Update to Org 9.7.7-2-gf308d3
33ba72f52f Fix decoding 'display' properties with SVG images in Enri...
174a0b7642 * configure.ac (D8): Fix typo.
c56e837a10 ; * src/android.c (setEmacsParams): Delete unused variable.
2024-07-15 21:12:01 +08:00
Michael Albinus
eae1104f97 Extend treesitter tests on emba
* test/infra/Dockerfile.emba (emacs-tree-sitter): Install c-ashrp
grammar.

* test/infra/Makefile.in (TREE-SITTER-FILES): Add csharp-mode-tests.el.
(tree-sitter-files): Rename from tree-sitter-files-template.
Generate .tree-sitter-files.

* test/infra/gitlab-ci.yml (test-tree-sitter): Extend .tree-sitter-files.

* test/infra/test-jobs.yml: Regenerate.
2024-07-15 09:35:54 +02:00
Eli Zaretskii
1fea9adf52 Improve support for Tifinagh
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Add support for Tifinagh.
2024-07-14 21:20:42 +03:00
Kyle Meyer
5ec73eca57 Update to Org 9.7.7-2-gf308d3 2024-07-14 12:30:50 -04:00
Mattias Engdegård
a44376432d Further time decoding tidying
* src/timefns.c (enum timeform): Reorder.
(decode_time_components, decode_lisp_time): Simplify and clean up.
2024-07-14 13:01:57 +02:00
Eli Zaretskii
159f3f59b1 Minor improvement in 'rmail-redecode-body'
* lisp/mail/rmail.el (rmail-redecode-body): Signal user-error if
'rmail-enable-mime' is non-nil; doc fix.
2024-07-14 11:41:30 +03:00
Eli Zaretskii
33ba72f52f Fix decoding 'display' properties with SVG images in Enriched mode
* lisp/textmodes/enriched.el (enriched-next-annotation): Reject
matches of 'enriched-annotation-regexp' inside strings.  Reported
by Christopher Howard <christopher@librehacker.com> in
https://lists.gnu.org/archive/html/help-gnu-emacs/2024-06/msg00178.html.
2024-07-14 09:06:55 +03:00
Pip Cet
174a0b7642 * configure.ac (D8): Fix typo. 2024-07-14 05:47:39 +00:00
Paul Eggert
62fdcfd484 Minor renaming in timefns.c
* src/timefns.c (current_time_in_cform): Rename this static
function from current_time_in_form, since this is about enum cform
not enum timeform.  Use changed.
2024-07-13 22:18:49 -07:00
Po Lu
c56e837a10 ; * src/android.c (setEmacsParams): Delete unused variable. 2024-07-14 12:51:48 +08:00
Po Lu
f9dae55ccc Merge from savannah/emacs-30
b00fc31dd1 Do not set LD_LIBRARY_PATH during Android initialization
04bf3172f0 ; Set Transient's version
e6f78485aa ; Fix typos in 'which-key-mode' (bug#72093)
2024-07-14 12:47:51 +08:00
Po Lu
b00fc31dd1 Do not set LD_LIBRARY_PATH during Android initialization
* doc/emacs/android.texi (Android Environment): Adjust
documentation to match.

* java/org/gnu/emacs/EmacsNoninteractive.java (main1): New
function.  Remove initialization of EmacsNative hither.
(main): Acquire an ApplicationInfo or LoadedApk, as the case may
be on the host system, derive a ClassLoader from the result, and
load and call `main1' from within this class loader.

* src/android-emacs.c (main):

* src/android.c (setEmacsParams): Do not override
LD_LIBRARY_PATH or set EMACS_LD_LIBRARY_PATH.  This enables
Emacs to execute subprocesses in certain "fortified" Android
systems, amongst other things.
2024-07-14 12:46:23 +08:00
Jonas Bernoulli
04bf3172f0
; Set Transient's version 2024-07-13 21:59:20 +02:00
Jim Porter
f38c42d1c7 Treat SVG images like other image types in 'shr-put-image'
For both SVG and no-SVG builds, this works as expected (in the no-SVG
case, it would raise an error which subsequently gets ignored).
However, compared to the previous implementation, this lets users resize
SVG images just like every other image type (bug#71913).

* lisp/net/shr.el (shr-put-image): Don't special-case SVGs.
2024-07-13 10:21:56 -07:00
john muhl
e6f78485aa ; Fix typos in 'which-key-mode' (bug#72093)
* lisp/which-key.el (which-key-preserve-window-configuration):
Correct spelling of "taken".
(which-key--create-pages): Correct spelling of "widths".
(which-key--start-paging-timer): Correct spelling of
"secondary".
2024-07-13 18:50:07 +03:00
Eli Zaretskii
5389b6a856 Fix renaming symlinks on MS-Windows
* src/w32.c (sys_rename_replace): Handle renames of a symlink.
This makes 'wdired-tests' succeed on MS-Windows.
2024-07-13 15:53:35 +03:00
Eli Zaretskii
44ae4868d3 Merge from origin/emacs-30
a6c78ccf5f ; * src/w32fns.c (Fw32_notification_close): Fix typo (bug...
febafe3788 * test/lisp/wdired-tests.el (wdired-test-bug34915): Fix f...
846b79b6d0 Fix 'wdired-test-unfinished-edit-01'
bc154cba13 ; * src/search.c (Fre_search_forward): Clarify doc string...
53291e3d46 Fontify destructor in c++-ts-mode
d77f8a3475 Fix invalid defcustom type for erc-buffers option
d68a4ea3ec ; Fix 'ibuffer-do-isearch{-regexp}'
8b1a0f8695 Fix infloop in 'shell-resync-dirs'
ce13eee5ab ; * src/image.c (free_image_cache): Add assertion.  (Bug#...
2024-07-13 08:44:49 -04:00
Raffael Stocker
a6c78ccf5f ; * src/w32fns.c (Fw32_notification_close): Fix typo (bug#72091). 2024-07-13 15:19:46 +03:00
Eli Zaretskii
febafe3788 * test/lisp/wdired-tests.el (wdired-test-bug34915): Fix for MS-Windows. 2024-07-13 15:06:43 +03:00
Peter Oliver
846b79b6d0 Fix 'wdired-test-unfinished-edit-01'
* test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01):
Don't modify the random directory name if, by chance, it happens
to contain the substring "foo" anywhere but immediately after the
slash.  (Bug#72073)
2024-07-13 13:36:42 +03:00
Eli Zaretskii
bc154cba13 ; * src/search.c (Fre_search_forward): Clarify doc string (bug#71879). 2024-07-13 13:22:01 +03:00
Eli Zaretskii
3a26a51c69 ; Fix last change
* lisp/progmodes/java-ts-mode.el (java-ts-mode):
* lisp/progmodes/c-ts-mode.el (c-ts-mode, c++-ts-mode): Load the
Doxygen grammar quietly, so that if it isn't available, the user
is not annoyed.  (Bug#71874)
2024-07-13 13:16:42 +03:00
Vincenzo Pupillo
c77a9b934b Fontify doxygen support to 'c-ts-mode', 'c++-ts-mode' and 'java-ts-mode'
Add doxygen support to 'c-ts-mode', 'c++-ts-mode' and
'java-ts-mode' using tree-sitter-doxygen from
github.com/tree-sitter-grammars.
* lisp/progmodes/c-ts-common.el
(c-ts-mode-doxygen-comment-font-lock-settings): Add font locking
rules for doxygen comment.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--feature-list): Add
'document' feature.
(c-ts-mode--doxygen-comment-regex): New regular expression for
doxygen comments.
(c-ts-mode, c++-ts-mode): Add support for doxygen parser.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Add support for
doxygen parser.  (Bug#71874)
2024-07-13 13:07:18 +03:00
Vincenzo Pupillo
53291e3d46 Fontify destructor in c++-ts-mode
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Add a rule for destructors.  (Bug#71872)
2024-07-13 13:01:44 +03:00
Mattias Engdegård
b23ab37175 Simplify timestamp decoding
* src/timefns.c (current_time_in_form, time_spec_invalid): New.
(enum timeform): Remove TIMEFORM_INVALID.
(decode_time_components): Move handling of TIMEFORM_INVALID,
TIMEFORM_TICKS_HZ and TIMEFORM_NIL...
(decode_lisp_time): ...here, avoiding the detour.
2024-07-13 11:33:44 +02:00
F. Jason Park
d77f8a3475 Fix invalid defcustom type for erc-buffers option
* lisp/erc/erc.el (erc-ensure-target-buffer-on-privmsg): Change
invalid inner `choice' to a `const' for the third-state `status'
variant, which is new in ERC 5.6 and Emacs 30.  Thanks to Mattias
Engdegård for catching this.
2024-07-12 14:51:36 -07:00
Juri Linkov
900f135b68 * lisp/gnus/mm-uu.el (mm-uu-type-alist): Fix end-regexp of git-format-patch.
Replace git-format-patch end-regexp "^-- " with "^$".
The regexp "^-- " was intended to mark the end
of the git-formatted patch.  However, git-format-patch
can produce patches without a signature.  Also often
patches are just copy-pasted from the output of 'C-x v d'.
Therefore, now an empty line marks the end of the patch
since properly formatted patches don't contain an empty line
and properly configured MUAs don't strip whitespace from patches.
Suggested by Luis Henriques <henrix@camandro.org> and
Kévin Le Gouguec <kevin.legouguec@gmail.com> in bug#72059.
2024-07-12 20:54:53 +03:00
Eshel Yaron
d68a4ea3ec
; Fix 'ibuffer-do-isearch{-regexp}'
* lisp/ibuf-ext.el (ibuffer-do-isearch)
(ibuffer-do-isearch-regexp): Use 'defun' instead of
'define-ibuffer-op'.  (Bug#71927)
2024-07-12 11:05:56 +02:00
Eli Zaretskii
8b1a0f8695 Fix infloop in 'shell-resync-dirs'
* lisp/shell.el (shell-eval-command): Fix detection of newline
after last output line.  (Bug#71896)
(shell-resync-dirs): Make sure the inner loop never infloops.
Suggested by Troy Hinckley <troyhinckley@dabrev.com>.
2024-07-12 09:58:53 +03:00
Eli Zaretskii
ce13eee5ab ; * src/image.c (free_image_cache): Add assertion. (Bug#71929) 2024-07-12 09:39:39 +03:00
Po Lu
e64a34e62b Merge from savannah/emacs-30
b22ab99f0a Render more Android functions safe to execute in a batch ...
2024-07-12 14:32:49 +08:00
Po Lu
b22ab99f0a Render more Android functions safe to execute in a batch session
* src/androidfns.c (Fx_display_mm_width, Fx_display_mm_height)
(Fandroid_display_monitor_attributes_list)
(Fandroid_external_storage_available_p)
(Fandroid_request_storage_access): Verify that a display
connection or service object is available.

* src/androidselect.c (Fandroid_get_clipboard)
(Fandroid_browse_url_internal, Fandroid_get_clipboard_targets)
(Fandroid_get_clipboard_data, Fandroid_notifications_notify):
Moderate tone of error messages.
2024-07-12 14:31:33 +08:00
Po Lu
38fa3e9350 Merge from savannah/emacs-30
a5ef9e2568 Document means of executing Emacs from unrelated Android ...
0de0056fd6 Don't emit a prompt in Eshell when a background command i...
ec1e300a21 Fix reference from buffer-stale-function docstring
2024-07-12 12:15:50 +08:00
Po Lu
a5ef9e2568 Document means of executing Emacs from unrelated Android applications
* doc/emacs/android.texi (Android Environment): Document
significance, effect and purpose of EMACS_CLASS_PATH and
EMACS_LD_LIBRARY_PATH, and the utility of `pm path
org.gnu.emacs'.
2024-07-12 11:59:25 +08:00
Jim Porter
0de0056fd6 Don't emit a prompt in Eshell when a background command is killed
* lisp/eshell/esh-cmd.el (eshell-resume-command): Check for
background-ness before resetting the prompt.

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/background/simple-command): Make the regexp a bit
stricter.
(esh-cmd-test/background/kill): New test.
2024-07-11 16:39:35 -07:00
Andrea Corallo
dc8cde2b6f Add a type-check--optim test
* test/src/comp-tests.el (comp-tests-type-branch-optim-checker): New function.
(comp-tests-type-branch-optim): Add new test.
2024-07-11 16:26:49 +02:00
Andrea Corallo
ffaf1cb235 Some clean-up in comp-tests.el
* test/src/comp-tests.el (comp-tests-cond-rw-checked-function)
(comp-tests-cond-rw-checker-val)
(comp-tests-cond-rw-expected-type)
(comp-tests-cond-rw-checker-type): Remove.
2024-07-11 16:26:49 +02:00
Andrea Corallo
baf74968f9 Fix 'comp--type-check-optim-block' it using 'comp-cstr-type-p'
* lisp/emacs-lisp/comp.el (comp--type-check-optim-block): Better
condition.
2024-07-11 16:26:49 +02:00
Andrea Corallo
0d6f3f134e Generalize 'comp-cstr-symbol-p'
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-symbol-p): Make use of
'comp-cstr-type-p'.
2024-07-11 16:26:49 +02:00
Andrea Corallo
a1775552ce Add 'comp-type-check-optim' pass
* lisp/emacs-lisp/comp.el (comp-passes): Add 'comp--type-check-optim'.
(comp--type-check-optim-block, comp--type-check-optim): New functions.
2024-07-11 16:26:49 +02:00
Andrea Corallo
8538a281f5 Split 'comp--ssa' code
* lisp/emacs-lisp/comp.el (comp--ssa-function): New function.
(comp--ssa): Update.
2024-07-11 16:26:49 +02:00
Paul Eggert
c3e6923b00 Rename timefns static function lisp_time_struct
* src/timefns.c (lisp_time_cform): Rename from lisp_time_struct,
since it no longer returns a struct, and now accepts CFORM.
All uses changed.
2024-07-11 16:01:41 +02:00
Paul Eggert
e30706fd12 Avoid mpz for some common timestamp cases
Performance problem reported by Gerd Möllmann and Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2024-06/msg00530.html
https://lists.gnu.org/r/emacs-devel/2024-06/msg00539.html
* src/timefns.c (CFORM_SECS_ONLY): The exact tv_nsec value is now
ignored if nonnegative (i.e., the only thing that matters is that
it’s nonnegative).
(decode_time_components): Use intmax_t instead of mpz arithmetic
if the tick count fits.  Add another ‘default: eassume (false);’
so that the revised code pacifies --enable-gcc-warnings with GCC
11.4.0 on x86-64.
2024-07-11 16:01:41 +02:00
Paul Eggert
e8b3c4cb58 Decode current time directly to timespec
* src/timefns.c (decode_time_components): If FASTER_TIMEFNS, when
returning the current time and the desired form is struct timespec
or time_t, return it directly rather than converting it to struct
ticks_hz and then to struct timespec.  This can avoid some mpz
calculations and/or bignums.
2024-07-11 16:01:41 +02:00
Paul Eggert
75f53d7c2c In timefns.c avoid by-hand overflow checking
Prefer functions like ckd_add to do overflow checking, instead of
doing it by hand, to simplify and I hope to make things a bit less
error prone.
* src/timefns.c (TIME_T_MIN, TIME_T_MAX): Remove.  All by-hand
overflow checking replaced with calls to ckd_add or ckd_mul.
(s_ns_to_timespec): New static function, that uses ckd_add
instead of by-hand overflow checking.
(ticks_hz_to_timespec): Use it.
(check_tm_member): Use mpz_fits_sint_p and mpz_get_si rather
than mpz_to_intmax and by-hand overflow checking.
2024-07-11 16:01:41 +02:00
Paul Eggert
0c850df888 Optimize smallish mpz to native int conversion
* src/bignum.c (make_integer_mpz, mpz_to_intmax):
If FASTER_BIGNUM, optimize the common case where the value fits in
long int.  In this case we can use mpz_fits_slong_p and mpz_get_si
instead of looping with mpz_getlimbn.
(mpz_to_uintmax): Likewise for unsigned long int and mpz_get_ui.
2024-07-11 16:01:41 +02:00
Paul Eggert
1c8e64a953 New FASTER_BIGNUM macro to test slow-path code
* src/bignum.h (FASTER_BIGNUM): New macro.
(mpz_set_intmax, mpz_set_uintmax): Optimize only if FASTER_BIGNUM.
Also, use ckd_add to test for overflow instead of doing it by hand.
2024-07-11 16:01:41 +02:00