1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-19 20:30:29 -08:00
Commit graph

92730 commits

Author SHA1 Message Date
Stefan Kangas
802a54ad62 Error when trying to make nil or t obsolete
* lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable):
Signal error if the symbol to make obsolete is nil or t.  (Bug#62248)
(byte-run--constant-obsolete-warning): New function.
* test/lisp/emacs-lisp/byte-run-tests.el: New file.
2023-09-08 01:01:16 +02:00
Stefan Kangas
331dee7e4a Add note regarding seq on GNU ELPA
* lisp/emacs-lisp/seq.el: Add note regarding seq on GNU ELPA.

Co-authored-by: Stefan Monnier <monnier@iro.umontreal.ca>
2023-09-07 23:57:20 +02:00
Lämppi Lütti
55c2180d2c Fix detection of vtable start and end
* lisp/emacs-lisp/vtable.el (vtable-beginning-of-table)
(vtable-end-of-table): Fix detection of vtable limits.  (Bug#58712)

Copyright-paperwork-exempt: yes
2023-09-07 22:23:24 +02:00
Jim Porter
2af092741e Fix remote path setting in Eshell
This ensures that we supply Tramp with the local PATH so that it can
do its job of starting the local "ssh", or whatever the method uses
(bug#65551).

* lisp/eshell/esh-proc.el (eshell-gather-process-output): Add special
handling for remote processes.

* test/lisp/eshell/esh-proc-tests.el
(esh-var-test/remote/remote-path): New test.
2023-09-07 10:23:48 -07:00
Mattias Engdegård
e95d8562c0 Translate backslash-saturated regexp to rx
* lisp/minibuffer.el (minibuffer--regexp-propertize):
The original regexp had 83 backslashes in 147 characters which may be
some kind of record.  This transformation cuts it down to 6, and the
generated regexp string is about 14 % shorter.
2023-09-07 18:20:16 +02:00
Eli Zaretskii
4613575d97 ; * lisp/completion.el (dynamic-completion-mode): Fix last change. 2023-09-07 18:52:35 +03:00
Stefan Kangas
d32f00a35b Improve docstring of message-sendmail-envelope-from
* lisp/gnus/message.el (message-sendmail-envelope-from): Doc fix.
2023-09-07 11:58:10 +02:00
Jens Schmidt
77b6e9bb17 Improve documentation of EPG
* lisp/epg.el (epg-context-set-passphrase-callback): Update
GnuPG-version-dependent information in docstring and refer to
Info node `(epa)' for details.
(epg-start-edit-key): Replace description of arguments by a
reference to `epg-edit-key'.
(epg-edit-key): More precisely describe callback operation and
arguments and provide an example of how to edit a key.  (Bug#65603)
2023-09-07 12:24:34 +03:00
john muhl
a412d3c46c Fix java-ts-mode tests (bug#65738)
* admin/notes/tree-sitter/build-module/batch.sh (languages):
Add Java.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Pass a list
to 'treesit-thing-settings'.
2023-09-07 12:06:36 +03:00
Eli Zaretskii
2e5511c5aa ; Fix documentation of last change
* lisp/minibuffer.el (minibuffer-regexp-prompts):
* doc/lispref/minibuf.texi (Minibuffer Misc): Fix docs (bug#50766).
2023-09-07 11:56:16 +03:00
martin rudalics
2992b99aab New minor mode 'minibuffer-regexp-mode'
This mode is for editing regexps in minibuffer, it highlights
parens via `show-paren-mode' and `blink-matching-paren' in a
user-friendly way, avoids reporting false paren mismatches,
and makes sexp navigation more intuitive.
* lisp/minibuffer.el (minibuffer-regexp-mode)
(minibuffer--regexp-primed, minibuffer--regexp-prompt-regexp):
New variables.
(minibuffer--regexp-propertize, minibuffer--regexp-primed)
(minibuffer--regexp-before-change)
(minibuffer--regexp-after-change)
(minibuffer--regexp-post-self-insert, minibuffer--regexp-setup)
(minibuffer--regexp-exit, minibuffer-regexp-mode): New functions.
(minibuffer-regexp-prompts): New option.

* doc/lispref/minibuf.texi (Minibuffer Misc): Document the new
mode and its option.

* etc/NEWS: Announce the new mode.

Bug#50766
2023-09-07 11:40:48 +03:00
Eli Zaretskii
28cb3a4413 ; Fix recent changes in treesit documentation
* lisp/treesit.el (treesit-local-parsers-at)
(treesit-local-parsers-in):
* doc/lispref/parsing.texi (Multiple Languages):
 (Using Parser): Fix wording of recently added docs.
2023-09-07 11:09:56 +03:00
Eli Zaretskii
d3382f9471 ; * lisp/completion.el (dynamic-completion-mode): Doc fix. 2023-09-07 09:52:23 +03:00
Yuan Fu
14819131ff Fix c-ts-mode BSD style indentation
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles):
Add else_clause.

(cherry picked from commit d392a5d3c1)
2023-09-07 08:07:25 +03:00
Mauro Aranda
2a8f458719 Fix perl-mode indentation after a hanging paren
* lisp/progmodes/perl-mode.el (perl-hanging-paren-p): Allow
comments.  (Bug#34245)
* test/lisp/progmodes/perl-mode-tests.el (perl-test-bug-34245): New
test.
2023-09-07 00:13:53 +02:00
Dmitry Gutov
dd2053e8cd * lisp/progmodes/project.el: Bump version to 0.10.0. 2023-09-06 23:54:30 +03:00
Dmitry Gutov
62229fb2d1 (project-try-vc): When found non-VC project root, still search for the backend
* lisp/progmodes/project.el (project-try-vc): When finding a
non-VC project root, still try to search for the containing
responsible VC backend, if any (bug#65704).
2023-09-06 23:30:42 +03:00
Eshel Yaron
bc56da92d8 ; Fix error in 'tex-recenter-output-buffer'
* lisp/textmodes/tex-mode.el (tex-recenter-output-buffer): Check
that 'display-buffer' returned a window, rather than nil, before
selecting it.  (Bug#65762)
2023-09-06 19:37:38 +03:00
Stefan Kangas
dd818ed821 Remove compat code from flyspell
* lisp/textmodes/flyspell.el: Delete redundant autoloads.
2023-09-06 18:36:29 +02:00
David Ponce
d17c5adc05 Fix regexp for recognizing PBM images
* lisp/image.el (image-type-header-regexps): Don't use [:space:],
as its meaning depends on the current buffer's syntax tables.
(Bug#65496)
2023-09-06 18:58:48 +03:00
Joseph Turner
7427efa033 Fix typo (Bug#65764)
* lisp/subr.el (backward-word-strictly): Fix typo.
2023-09-06 14:26:10 +02:00
Eli Zaretskii
59c6624408 ; * lisp/ido.el (ido-completion-buffer): Fix :type (bug#65756). 2023-09-06 13:49:32 +03:00
Mattias Engdegård
d3e650d337 ; * lisp/leim/quail/indian.el: correct argument order 2023-09-06 10:36:51 +02:00
Mattias Engdegård
9e413584ad indian.el: fix sorting predicate
* lisp/leim/quail/indian.el
(quail-tamil-itrans-compute-syllable-table): Add missing comparison.
Patch from Visuwesh; bug found by an experimental tool.
2023-09-06 10:14:36 +02:00
Theodor Thornhill
4ac83ee105 Use *p in interactive form in transpose-chars
* lisp/simple.el (transpose-chars): Use '*p' instead of '*P' like the
other transpose-* functions.  (Bug#60157)
2023-09-06 09:07:31 +02:00
Yuan Fu
d1f916b046
Support local parser in treesit-node-at/on
* lisp/treesit.el (treesit-node-at)
(treesit-node-on): Support local parser.
2023-09-05 21:03:38 -07:00
Yuan Fu
d392a5d3c1
Fix c-ts-mode BSD style indentation
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Add else_clause.
2023-09-05 21:03:38 -07:00
Yuan Fu
d05494a9ff
Support tree-sitter local parsers
* doc/lispref/parsing.texi (Multiple Languages): Update manual.
* lisp/treesit.el (treesit-range-settings): Add LOCAL-P to range
setting.
(treesit-range-rules): Support :local keyword.
(treesit-local-parsers-at)
(treesit-local-parsers-in)
(treesit--update-ranges-local): New functions.
(treesit-update-ranges)
(treesit-font-lock-fontify-region)
(treesit--indent-1): Support local parsers and prioritize it over
global parsers.
2023-09-05 21:03:38 -07:00
Yuan Fu
686d4ddb87
Use tagged parser in c-ts-mode
Now that we have tags for parsers, use that instead of the
load-name-override hack.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--emacs-c-range-query): Change parser to C.
(c-ts-mode--emacs-set-ranges): Use the tagged parser.
(c-ts-mode): Create the tagged parser.
2023-09-05 21:03:37 -07:00
Yuan Fu
722daf6fff
Add tag to tree-sitter parsers
* doc/lispref/parsing.texi (Using Parser): Update manual.
* lisp/treesit.el (treesit-buffer-root-node)
* src/treesit.c (make_treesit_parser)
* src/treesit.c (Ftreesit_parser_create): Add TAG parameter.
(treesit_resolve_node): Create a parser with nil tag.
* src/treesit.h (Lisp_TS_Parser): Add TAG field.
2023-09-05 21:03:37 -07:00
Po Lu
aa872f2540 Properly run emacsclient under Android if DISPLAY is set
* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): Make
dimensions final, since they are never changed after the
constructor.

* lib-src/emacsclient.c (decode_options): If --display is not
provided, always set display to `android' even if DISPLAY is
provided.

* lisp/net/browse-url.el (browse-url): Cease setting DISPLAY
under Android.

* src/callproc.c (getenv_internal, make_environment_block):
Don't afford DISPLAY special treatment under Android.
2023-09-06 10:31:26 +08:00
Spencer Baugh
03ac16ece4 Correctly handle common prefixes in substring completion
Substring completion would previously not complete the longest common
substring if that substring was a prefix of all the completion
alternatives.  Now it does.  An explanation of this bug

Substring completion is implemented by passing the `prefix' symbol as
part of the pattern passed to completion-pcm--merge-completions.  This
symbol is supposed to cause completion-pcm--merge-completions to
"grow" a completion of a common substring only from the "right" of the
symbol (a common suffix), not from the "left" of the symbol (a common
prefix).  Yes, this is the opposite of what the name `prefix' would
imply.

When processing a symbolic element of the pattern,
completion-pcm--merge-completions first finds the common prefix of all
the completions in that part of the pattern (using try-completion).
Then for `prefix' and other elements which want to complete a common
suffix, the common prefix is removed from each element and then the
common suffix is calculated with completion--common-suffix.

If the common prefix covers the entirety of all the alternatives
(i.e. when "unique" is true in the code), it's also a common suffix.
In that case, the common suffix calculation (if it runs) is basically
a no-op which will produce an empty string, since we removed the
common prefix before running it.

Before this change, `prefix' elements would unconditionally discard
the common prefix, which produced the wrong result in the case that
common prefix == common suffix.  For example:

  (completion-pcm--merge-completions '("ab" "ab") '(prefix "b"))
  -> ("b")

Now we detect this situation and include the common prefix in this
case for `prefix' elements.  Then we get:

  (completion-pcm--merge-completions '("ab" "ab") '(prefix "b"))
  -> ("b" "a")

which is correct.

* lisp/minibuffer.el (completion-pcm--merge-completions): Don't ignore
a common suffix in a `prefix' pattern element when it's also a common
prefix.
* test/lisp/minibuffer-tests.el (completion-substring-test-5): Add a
test.
2023-09-05 17:16:57 -04:00
Stefan Kangas
c586d984f2 Make dns-mode fontify quoted values correctly
* lisp/textmodes/dns-mode.el (dns-mode-syntax-table): Fontify
quoted values correctly.  (Bug#62214)
Suggested by Trent W. Buck <trentbuck@gmail.com>.
2023-09-05 23:08:52 +02:00
Daniel Martín
cd6dcfad10 Improve completion of treesit-check-indent command
* lisp/treesit.el (treesit--read-major-mode): Helper function to
provide completion for most major modes.
(treesit-check-indent): Use the new interactive spec and improve the
docstring.  (Bug#60001)
2023-09-05 22:40:38 +02:00
João Távora
07454c47a6 Flymake: speed up mode-line display with simple cache
When scrolling heavily (perhaps holding down C-n), the function
'flymake-mode-line-counter' showed very prominently in the memory and
CPU profiles.

Using a cache here was trivial, if not particularly pretty.  The
function all but disappears from the profiles afterwards.

* lisp/progmodes/flymake.el (flymake--mode-line-counter-cache):
New variable.
(flymake--publish-diagnostics): Flush cache aggressively.
(flymake-mode-line-error-counter): Adjust.
(flymake--mode-line-counter-1): New helper from earlier
flymake--mode-line-counter.
(flymake--mode-line-counter): Use cache.
2023-09-05 18:27:42 +01:00
Stefan Monnier
2e7af2fc53 * lisp/emacs-lisp/cl-lib.el (cl-old-struct-compat-mode): Mark as obsolete
* lisp/emacs-lisp/cl-preloaded.el: Emit a message before enabling
`cl-old-struct-compat-mode`.

See bug#63282.
2023-09-05 12:56:24 -04:00
Stefan Monnier
98f7665677 * lisp/emacs-lisp/pp.el (pp-28): Fix typo
Reported by Mattias Engdegård <mattias.engdegard@gmail.com>.
2023-09-05 12:29:44 -04:00
Stefan Monnier
98ae14b147 Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs 2023-09-05 11:55:14 -04:00
Stefan Monnier
8ef1933a04 * lisp/emacs-lisp/edebug.el (edebug-list-form): Don't gate so eagerly
The `edebug-gate` is fairly heavy handed, so don't activate it
just because we seem to have found what looks like a valid form.
2023-09-05 11:54:55 -04:00
Stefan Kangas
a55ca8073b Display directory when dired-omit-mode is first enabled
* lisp/dired-x.el (dired-omit-expunge): Display the directory name
when 'dired-omit-mode' is first enabled.  (Bug#64705)
2023-09-05 17:51:27 +02:00
Jim Porter
f08684ab39 Inherit 'sieve-mode' faces from 'font-lock'
These Sieve faces were already a close mapping onto the Font Lock
ones, so this should usually look the same to users with the default
theme.  However, this makes it easier to theme these faces (just
define the usual 'font-lock-*-face' colors you want) and also fixes a
few edge cases (bug#62370).

* lisp/net/sieve-mode.el (sieve-control-commands)
(sieve-action-commands, sieve-test-commands, sieve-tagged-arguments):
Inherit from 'font-lock' faces.
2023-09-04 21:37:56 -07:00
Stefan Monnier
483c6f191f Merge remote-tracking branch 'refs/remotes/origin/master' 2023-09-04 17:14:14 -04:00
Stefan Monnier
defa5a9571 * lisp/emacs-lisp/cl-macs.el (cl-flet): Remove &name for (SYM EXP) case
The new/current Edebug spec gives the name `SYM@cl-flet@NN` to the
expression building that function rather than to the body of that
function as would be expected, leading to misleading code coverage.

This basically reverts 999de2a5ea, cc0f546825, and 18c85306ac :-(
2023-09-04 17:13:45 -04:00
Protesilaos Stavrou
367c3f25a1 Add 'appt-notification' face (Bug#61661)
* lisp/calendar/appt.el (appt-notification): Declare the new face.
(appt-check): Implement the new face.
* etc/NEWS: Announce the new face.
2023-09-04 22:50:15 +02:00
Stefan Monnier
9e05453a8c Merge remote-tracking branch 'refs/remotes/origin/master' 2023-09-04 16:42:15 -04:00
Stefan Monnier
913ae070e6 * lisp/tab-bar.el (cl--set-substring): Remove left-over autoload
And remove left-over `require` of `seq` while at it.
2023-09-04 16:41:40 -04:00
Stefan Monnier
d5e7d9e257 Move setf substring to cl-lib since it relies on it (bug#60102)
* lisp/emacs-lisp/cl-lib.el (substring): Move gv-expander here...
* lisp/emacs-lisp/gv.el (substring): ...from here.
2023-09-04 16:39:55 -04:00
João Távora
dc171d5efa Eglot: reorganize Elisp API section, export new functions
bug#65418

Co-authored-by: Filippo Argiolas <filippo.argiolas@gmail.com>

* lisp/progmodes/eglot.el (Obsolete aliases): New section, move
all obsolete aliases here.
(eglot-uri-to-path)
(eglot-path-to-uri)
(eglot-range-region)
(eglot-server-capable)
(eglot-server-capable-or-lose): New functions and backward compability
aliases.
2023-09-04 21:35:41 +01:00
Stefan Kangas
82cc1f4fda Revert use of seq-count in shr-count
* lisp/net/shr.el (shr-count): Prefer handwritten code to using
'seq-count', as it's more performant.
Problem reported by Mattias Engdegård <mattiase@acm.org>.
2023-09-04 21:28:33 +02:00
Stefan Kangas
2cefcb2f79 ; * lisp/net/shr.el (shr-count): Fix typo. 2023-09-04 18:27:54 +02:00