1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00
Commit Graph

169057 Commits

Author SHA1 Message Date
Mattias Engdegård
6e4432673c Small clean-up of byte-compile-docstring-style-warn
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-style-warn):
Make the code slightly cheaper.  It's still dominated by the
huge cost of `byte-compile--wide-docstring-p`, though.
2023-09-29 17:59:50 +02:00
Mattias Engdegård
5959a28cce Include all in byte-compile-warnings defcustom type
* lisp/emacs-lisp/bytecomp.el (byte-compile-warnings):
Let "All" mean `all`, not `t`.
2023-09-29 17:59:50 +02:00
Mattias Engdegård
a89c86888c Detect developer builds in git worktrees as well
* configure.ac (gcc-warnings): Don't require .git to be a directory.
If you wondered why you didn't get any warnings, this may have been
the reason.
2023-09-29 17:59:50 +02:00
Harald Jörg
f13c4f1562 ; cperl-mode-tests.el: Avoid using skip-when
* test/lisp/progmodes/cperl-mode-tests.el: Add a hint to the
commentary that the tests are intended to run on older Emacsen.
(cperl-test-bug-10483): Replace skip-when by skip-unless followed
by a negation.
(cperl-test-bug-37127): Replace skip-when by skip-unless followed
by a negation.
2023-09-29 16:46:23 +02:00
Alan Mackenzie
688c893b18 CC Mode: Fix bug in whitespace scanning functions
c-forward-sws and c-backward-sws were scanning over spaces and
linefeeds marked with the string-fence syntax-table text
property.  Fix this by (i) removing the WS text properties
c-in-sws and c-is-sws from characters when setting the
string-fence on them; (ii) checking the syntax of "space"
characters when scanning over them.

* lisp/progmodes/cc-defs.el (c-skip-ws-chars-forward)
c-skip-ws-chars-backward, c-put-string-fence): New macros.

* lisp/progmodes/cc-awk.el
(c-awk-set-string-regexp-syntax-table-properties): Use
c-put-string-fence.

* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1):
Correct the determination of macro-start.
(c-forward-sws, c-backward-sws): Replace skip-chars-forward by
c-skip-ws-chars-forward and skip-chars-backward by
c-skip-ws-chars-backward.
(c-unmark-<>-around-region, c-after-change-unmark-ml-strings)
(c-propertize-ml-string-opener): Use c-put-string-fence.

* lisp/progmodes/cc-mode.el (c-put-syn-tab): Use
c-put-string-fence when appropriate.
2023-09-29 12:07:32 +00:00
Stefan Kangas
309554edb4 ; Mention 64-bit first in FAQ on large files
* doc/misc/efaq.texi (Problems with very large files): Mention
64-bit machines before 32-bit ones, as they are more common.
2023-09-28 21:44:10 +02:00
Eshel Yaron
8a635ac849 ; Substitute quotes in obsoletion notice in 'C-h f'
* lisp/help-fns.el (help-fns--obsolete): Substitute quotes in string
arguments to 'obsolete' declarations.

* lisp/emacs-lisp/advice.el (defadvice): Markup symbols in 'obsolete'
declaration.  (Bug#66240)
2023-09-28 21:44:09 +02:00
Stefan Kangas
cf4778a136 Simplify alist lookups in align-region
* lisp/align.el (align-region): Simplify alist lookup caching.
2023-09-28 21:44:09 +02:00
Juri Linkov
9cf1fc49e8 * lisp/tab-line.el: Move Touch screen support section to the better place. 2023-09-28 20:13:22 +03:00
Stefan Monnier
7c26501175 regex.c (mutually_exclusive_aux) <wordbound>: Remove optimization
Another case that was too optimistic.  Better use \> or \< rather
than \b if you want your regexp to be handled efficiently.

* src/regex-emacs.c (mutually_exclusive_aux) <wordbound>: Cancel optimization.
* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
New test.
2023-09-28 12:37:44 -04:00
Juri Linkov
0c15c7d946 ; * etc/NEWS: Demote outline 'describe-bindings-outline-rules' under Help.
* lisp/menu-bar.el (kill-this-buffer): Fix typo in comments.
2023-09-28 09:53:55 +03:00
Juri Linkov
3b831fe0f4 Unquote #'project-uniquify-dirname-transform in uniquify-dirname-transform.
* lisp/uniquify.el (uniquify-dirname-transform): Use , on #'.
2023-09-28 09:48:51 +03:00
Yuan Fu
5ad8db88df
; * admin/notes/tree-sitter/performance (Experiments): Update. 2023-09-27 23:42:32 -07:00
Yuan Fu
e881a172d4
; * lisp/treesit.el (treesit--read-major-mode): Use string-suffix-p. 2023-09-27 21:52:59 -07:00
Sam Steingold
83e0442139 There are no file modes on windows and dos
* lisp/ls-lisp.el (ls-lisp-verbosity): Add `modes` on GNU & Unix
  (ls-lisp-format): When `modes` is not in `ls-lisp-verbosity',
   keep just the 1st character of `drwxrwxrwx`.
2023-09-27 22:33:47 -04:00
Po Lu
7b43d70c73 Update Android port
* doc/emacs/android.texi (Android Windowing): Document
`android-keyboard-bell-duration'.

* java/org/gnu/emacs/EmacsService.java (ringBell): New argument
DURATION.

* src/android.c (android_init_emacs_service): Adjust
correspondingly.
(android_bell): Provide the duration of the vibration.

* src/androidfns.c (syms_of_androidfns)
<android_keyboard_bell_duration>: New variable.
2023-09-28 08:46:35 +08:00
Stefan Monnier
dc2199de3e * lisp/calendar/todo-mode.el: Let-bind inhibit-read-only
rather than `buffer-read-only`.  Applied throughout the file.
(todo-date-pattern, todo-edit-item--header, todo-convert-legacy-date-time)
(todo-read-date): Remove redundant "" arg to `mapconcat`.
2023-09-27 18:52:00 -04:00
Juri Linkov
d813f71ffe * lisp/vc/diff-mode.el (diff-apply-buffer): New command (bug#66113).
(diff-mode-map): Bind 'diff-apply-buffer' to 'C-c C-m a'.
2023-09-27 20:39:33 +03:00
Juri Linkov
2d25f071b6 New commands to show replacements as diffs (bug#65854)
* lisp/dired-aux.el (dired-do-replace-regexp-as-diff): New command.

* lisp/misearch.el (multi-file-diff-unsaved): New user option.
(multi-file-replace-as-diff): New function.
(multi-file-replace-regexp-as-diff): New command.
(replace-regexp-as-diff): New command.
(multi-file-diff-no-select): New function.
2023-09-27 20:39:32 +03:00
Stefan Monnier
bc52fdd1d1 * src/regex-emacs.c (analyze_first): Fix incorrect optimization
The optimization was incorrect in a particular corner case.
In this fix I just disable it conservatively for more cases because
it's not obvious how to fix it while preserving the "good" cases.

We may find a better fix by using an approach like the one
in `mutually_exhaustive_aux`, but for now this is good enough,
especially since \{..\} repetitions are not used very frequently.

* test/src/regex-resources/PTESTS: New test.
2023-09-27 13:29:50 -04:00
Mattias Engdegård
9a67540e51 ; * test/src/regex-emacs-tests.el: suppress relint complaints 2023-09-27 12:45:43 +02:00
Alan Mackenzie
6956382033 Revert "Don't use ellipses while cl-printing strings."
This reverts commit 761f8901ff.
2023-09-27 09:54:33 +00:00
Yuan Fu
a3a840c80a
Don't call font-lock-mode in treesit-major-mode-setup (bug#66223)
* lisp/treesit.el (treesit-major-mode-setup): Remove.
2023-09-27 00:21:40 -07:00
Wilhelm H Kirschbaum
1f850d8d7b
Fix treesit-langauge-at-point for elixir-ts-mode.
The treesit-language-at-point function is only suppose to query the
host language.

* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--indent-rules): Add missing rules.
(elixir-ts--treesit-language-at-point): Update function to only query
the host language.
* test/lisp/progmodes/elixir-ts-mode-resources/indent.erts: Add test
for inline docs.
2023-09-26 23:23:54 -07:00
Yuan Fu
07ede5e92a
; * lisp/treesit.el (treesit-language-at-point-function): Fix doc. 2023-09-26 23:23:53 -07:00
Yuan Fu
6490af559f
Extract feature list of java-ts-mode to a variable
* lisp/progmodes/java-ts-mode.el:
(java-ts-mode--feature-list): New variable.
(java-ts-mode): Extract out.
2023-09-26 23:23:53 -07:00
Jim Porter
eef32d13da Use 'unwind-protect' in more places in Eshell
This lets us simplify the logic for how we reset
'eshell-current-command' and 'eshell-last-async-procs', as well as
improving correctness of Eshell command forms in a few esoteric
scenarios.  Additionally, this helps set the stage for better support
of background commands in Eshell (bug#66164).

* lisp/eshell/esh-cmd.el (eshell-cmd-initialize): Remove addition to
'eshell-post-command-hook'; this is handled in 'eshell-resume-command'
and 'eshell-resume-eval' now.
(eshell-resume-command): Handle resetting the prompt as needed.
(eshell-resume-eval): Use 'unwind-protect' to ensure that we set
'eshell-last-async-procs' and 'eshell-current-comment' at the right
times.
(eshell-parse-command, eshell-trap-errors, eshell-manipulate): Use
'unwind-protect'.
(eshell-do-eval): Allow 'eshell-defer' to pass through
'unwind-protect' forms without actually calling the unwinding forms
(yet).

* lisp/eshell/esh-proc.el (eshell-kill-process-function)
(eshell-reset-after-proc): Make obsolete.  The behavior is now handled
in 'eshell-resume-command'.
(eshell-gather-process-output, eshell-sentinel)
(eshell-interrupt-process, eshell-kill-process, eshell-quit-process)
(eshell-stop-process, eshell-continue-process): Run 'eshell-kill-hook'
directly.

* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/throw): New test.
2023-09-26 12:29:52 -07:00
Stefan Monnier
e88be844bf regex.c (mutually_exclusive_p): Fix initial value of loop_beg
* src/regex-emacs.c (mutually_exclusive_p): Don't pretend that pattern
position 0 has been checked already.

* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
Add a corresponding regression test plus some other related tests
I had around.
2023-09-26 11:43:51 -04:00
Mattias Engdegård
215bfb24dd ; checkdoc.el: remove unnecessary regexp groups
* lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-next-string):
Remove remains from when the regexp was not written in rx.
2023-09-26 13:33:54 +02:00
Mattias Engdegård
d082f46c8c vc-annotate.el: make a new face if it didn't exist
* lisp/vc/vc-annotate.el (vc-annotate-lines): Check whether a symbol
is a face, not just its existence.  Previously we would sometimes end
up using non-faces resulting in complaints from the display system.
2023-09-26 13:27:55 +02:00
Basil L. Contovounesios
8d7e498366 Fix ediff-toggle-multiframe cond clauses
* lisp/vc/ediff-util.el (ediff-toggle-multiframe): Remove duplicate
cond clause.  Fix parentheses so that trailing 'message' is
contained in fallback clause.  Fix indentation.
2023-09-26 10:13:31 +02:00
Basil L. Contovounesios
ff2a02afa6 Address defcustom :type warnings
* lisp/calendar/diary-lib.el (diary-display-function):
* lisp/calendar/icalendar.el (icalendar-export-alarms):
* lisp/emacs-lisp/elint.el (elint-ignored-warnings):
* lisp/mail/sendmail.el (send-mail-function):
* lisp/net/gnutls.el (gnutls-verify-error):
* lisp/gnus/mm-decode.el (mm-text-html-renderer):
* lisp/gnus/message.el (message-send-mail-function): Fix misplaced
defcustom :tags (bug#66196).
(message-tool-bar): Remove duplicate, overwritten, and nonexistent
defcustom :type gmm-tool-bar-list-item.
* lisp/progmodes/idlwave.el (idlwave-begin-line-comment): Strip
excessive defcustom :type quoting.
* lisp/progmodes/ps-mode.el (ps-mode-paper-size): Consolidate paper
sizes with same dimensions into a single defcustom menu entry.
* lisp/textmodes/glyphless-mode.el (glyphless-mode-types): Remove
duplicate defcustom :type choice.
2023-09-26 09:29:39 +02:00
Po Lu
6a402bd3a7 Update Android port
* src/androidterm.c (android_draw_fringe_bitmap): Sync with
xterm.c.
2023-09-26 09:36:38 +08:00
Po Lu
719f8a51be Update Android port
* src/androidterm.c (android_clip_to_row)
(android_draw_fringe_bitmap, android_draw_hollow_cursor)
(android_draw_bar_cursor): Sync with xterm.c.

* src/xterm.c (x_draw_fringe_bitmap): Delete unused variables.
2023-09-26 09:35:51 +08:00
Po Lu
50281b4007 Properly clip overlaid fringe bitmaps
* src/xterm.c (x_draw_fringe_bitmap): Save clip rectangle from
x_clip_to_row, and draw only the intersection between it and the
fringe bitmap, for if the bitmap is overlaid, the clip mask will
override the clip rectangle.
(x_clip_to_row): New argument *RECT_RETURN.  All callers
changed.
2023-09-26 09:30:04 +08:00
Basil L. Contovounesios
50e913c956 Fix a couple of doc-view user options
* lisp/doc-view.el (doc-view-pdf->png-converter-function): Fix
placement and formatting of function-item :doc strings.
(doc-view-odf->pdf-converter-program): Ditto.  Tweak initialization
logic to ensure initial value is non-nil and matches :type.  Mention
preferred executable soffice first.
(doc-view-mode-p): Assume doc-view-odf->pdf-converter-program is
always non-nil.
2023-09-25 21:39:01 +02:00
Mattias Engdegård
091b8de586 Use heuristic to speed up allocation of small vectors (bug#65491)
Instead of scanning vector_free_lists from the appropriate size until
we find a nonempty bucket, start at the last bucket where we last put
something in.  This may favour splitting larger vectors than necessary
but in general saves a lot of time in the allocation of small vectors.

Original patch by Ihor Radchenko.

* src/alloc.c (last_inserted_vector_free_idx): New variable.
(setup_on_free_list): Set it.
(allocate_vector_from_block): Use it.
(sweep_vectors): Reset it.
2023-09-25 17:33:21 +02:00
Mattias Engdegård
aa28527500 Remove useless half of vector_free_lists array (bug#65491)
The latter half of vector_free_lists was never used in any meaningful
way but it did require traversal during allocation and GC.  Reduce it
to sizes we actually allocate, with a bucket for bigger ones.

* src/alloc.c (VECTOR_MAX_FREE_LIST_INDEX): Rename to...
(VECTOR_FREE_LIST_ARRAY_SIZE): ... this and adjust its value.
(vector_free_lists): Use new, smaller size.
(setup_on_free_list, allocate_vector_from_block):
Adapt to new vector_free_lists size.
(pseudovector_nbytes): New function extracted from...
(vectorlike_nbytes): ...here.
2023-09-25 16:49:29 +02:00
Mattias Engdegård
98a1e480c6 ; flymake-proc.el: move variable declarations
* lisp/progmodes/flymake-proc.el (flymake-proc--temp-source-file-name)
(flymake-proc--temp-master-file-name): Move to before first use.
2023-09-25 15:16:31 +02:00
Mattias Engdegård
f616edb4cc macroexp-parse-body: correct parsing of empty body (bug#66136)
* lisp/emacs-lisp/macroexp.el (macroexp-parse-body):
Return an empty body even when there are declarations present.
Previously, the last declaration was considered part of the body,
which is only correct if the input consists of a single string.

Reported by Jens Schmidt.
2023-09-25 15:04:17 +02:00
Stefan Monnier
6c99e4e384 * lisp/faces.el (read-face-name): Expose all lambdas to the compiler 2023-09-25 08:02:29 -04:00
Stefan Kangas
9f91a1c3eb Make insert-directory-program a defcustom; use "gls" on *BSD
* lisp/files.el (insert-directory-program): Change into defcustom.
Default to "gls" on *BSD and macOS.  (Bug#64791)
2023-09-25 11:36:14 +02:00
Po Lu
df5a9a78b5 Update Android port
* doc/lispref/os.texi (Desktop Notifications): Revise
documentation for android-notifications-notify to reflect
changes.

* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Convert notification importance to a legacy priority between
Android 7.1 and 4.1.

* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): Remove
immutable bitmap constructor, as the underlying Android API
functions are erroneously implemented.

* src/android.c (android_init_emacs_pixmap): Cease searching for
deleted constructor.
(android_create_pixmap_from_bitmap_data): Create a pixmap, then
fill it with the contents of the bitmap, in lieu of employing
the aforementioned constructor.

* src/androidselect.c (Fandroid_notifications_notify): Revise
doc string.
2023-09-25 13:01:44 +08:00
Stefan Kangas
947409d408 Move bind-key.el from lisp/use-package directory
* lisp/use-package/bind-key.el: Move file from here...
* lisp/bind-key.el: ...to here.  (Bug#62751)
2023-09-24 22:21:42 +02:00
Po Lu
38cd3cb433 Update Android port
* java/org/gnu/emacs/EmacsSdk11Clipboard.java
(getClipboardData): Correct typo in comment.

* src/androidvfs.c (android_authority_open)
(android_saf_delete_document): Circumvent JNI dynamic method
dispatch.
2023-09-24 18:19:54 +08:00
João Távora
81c6569e65 Flymake: unbreak tests
Flymake's normal behaviour implies catching the errors of misbehaving
backends.  This behavior is tested by Flymake's automated tests, built
on top of ERT, which means that debug-on-error is always t in the
bodies of said tests (I don't know the rationale for this, but it's
been like this for some time)

Flymake used to shun usage of 'condition-case-unless-debug' because of
this.  But since that macro is pretty useful, I started using it
again, and as a consequence, tests started breaking.

The solution is to:

1. stop requiring the deprecated legacy backend 'flymake-proc' (which
by design, always errors, except in rare circumstances).

2. deliberately set debug-on-error to nil around the "dummy backends""
test.

* lisp/progmodes/flymake.el (flymake-proc): Don't require it by
default.

* test/lisp/progmodes/flymake-tests.el:
(dummy-backends): Make robust to ert's debug-on-error setting.
2023-09-24 09:07:27 +01:00
Stefan Kangas
9b933a6033 ; Fix typos 2023-09-24 09:04:43 +02:00
Stefan Kangas
1cdc5cdc56 ; Normalize sort-fields-syntax-table definition
* lisp/sort.el (sort-fields-syntax-table): Normalize definition.
2023-09-24 08:09:24 +02:00
Stefan Kangas
12fe4741b6 ; Delete redundant requires from cperl-mode.el
* lisp/progmodes/cperl-mode.el: Delete redundant requires.
2023-09-24 02:53:24 +02:00
Eric Abrahamsen
450ca9951a Use delete-region in Gnus message yanking
See Bug#66106

* lisp/gnus/gnus-msg.el (gnus-summary-reply): Not erase-buffer. The
intention was to narrow the buffer to the headers, and then delete
just those headers. But erase-buffer doesn't respect narrowing, so
use (delete-region (point-min) (point-max)) instead.
2023-09-23 15:33:53 -07:00