1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-12 14:30:42 -08:00
Commit graph

168650 commits

Author SHA1 Message Date
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
Stefan Monnier
211ee13fb5 * doc/lispref/functions.texi (Advising Named Functions): Clarify " no advice" 2023-09-05 08:57:27 -04:00
Po Lu
cf9353e219 Minor adjustments to Android port stubs
* src/androidfns.c (Fx_display_backing_store): Return
`when-mapped' in place of `always', since the former better
reflects Android port behavior.
(syms_of_androidfns) <always>: Delete defsym.
<when-mapped>: New defsym.

* src/term.c (Fsuspend_tty, Fresume_tty): Properly signal errors
on Android rather than quietly disregarding calls.
2023-09-05 14:39:34 +08:00
Stefan Kangas
bbcfe70991 ; Delete some commented out code in data.c (Bug#64595)
* src/data.c (set_internal): Delete commented out code.
2023-09-05 08:13:24 +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
Po Lu
eb9cfa8852 Avoid virtual function dispatch overhead
* src/androidvfs.c (android_saf_move_document): Circumvent JNI
dynamic function dispatch on call to final method.
2023-09-05 10:43:07 +08: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
59c35bf16f Eglot: add new chapter about Elisp extensions to Eglot manual
bug#65418

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

* doc/misc/eglot.texi (Extending Eglot): New chapter.
2023-09-04 21:35:41 +01: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
Stefan Kangas
0edf237b3d Use seq-count in three functions
* lisp/net/shr.el (shr-count):
* lisp/progmodes/idlwave.el (idlwave-count-memq): Use seq-count.
(idlwave-count-eq): Use seq-count.  Make obsolete, as it is unused.
2023-09-04 18:25:18 +02:00
Stefan Kangas
7975c811d3 Use new ERT skip-when macro in tests
* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file):
* test/lisp/emacs-lisp/benchmark-tests.el (benchmark-tests):
* test/lisp/emacs-lisp/find-func-tests.el
(find-func-tests--library-completion):
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/kill-pipeline):
* test/lisp/filenotify-tests.el (file-notify-test11-symlinks):
* test/lisp/ibuffer-tests.el (ibuffer-0autoload):
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-part1):
* test/lisp/net/network-stream-tests.el (echo-server-nowait)
(connect-to-tls-ipv4-nowait, connect-to-tls-ipv6-nowait)
(open-network-stream-tls-wait, open-network-stream-tls-nowait)
(open-network-stream-tls, open-network-stream-tls-nocert)
(open-gnutls-stream-new-api-nowait)
(open-gnutls-stream-old-api-nowait):
* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-10483)
(cperl-test-hyperactive-electric-else):
* test/lisp/progmodes/elisp-mode-tests.el
(eval-last-sexp-print-format-sym-echo)
(eval-last-sexp-print-format-small-int-echo)
(eval-last-sexp-print-format-large-int-echo)
(eval-defun-prints-edebug-when-instrumented):
* test/lisp/progmodes/python-tests.el (python-ffap-module-path-1):
* test/lisp/shadowfile-tests.el (shadow-test00-clusters)
(shadow-test01-sites, shadow-test02-files)
(shadow-test03-expand-cluster-in-file-name)
(shadow-test04-contract-file-name, shadow-test05-file-match)
(shadow-test06-literal-groups, shadow-test07-regexp-groups)
(shadow-test08-shadow-todo, shadow-test09-shadow-copy-files):
* test/lisp/simple-tests.el
(eval-expression-print-format-sym-echo)
(eval-expression-print-format-small-int-echo)
(eval-expression-print-format-large-int-echo):
* test/lisp/term-tests.el (term-simple-lines)
(term-carriage-return, term-line-wrap, term-colors)
(term-colors-bold-is-bright, term-cursor-movement)
(term-scrolling-region, term-set-directory)
(term-line-wrapping-then-motion, term-to-margin):
* test/lisp/thread-tests.el
(thread-tests-list-threads-error-when-not-configured):
* test/lisp/vc/vc-tests.el (backend):
* test/manual/scroll-tests.el (scroll-tests-scroll-margin-0)
(scroll-tests-scroll-margin-negative)
(scroll-tests-scroll-margin-max)
(scroll-tests-scroll-margin-over-max)
(scroll-tests-scroll-margin-whole-window):
* test/misc/test-custom-libs.el (test-custom-libs):
* test/src/emacs-module-tests.el (module/async-pipe):
* test/src/fileio-tests.el (fileio-tests--odd-symlink-chars):
* test/src/filelock-tests.el (filelock-tests-lock-spoiled)
(filelock-tests-file-locked-p-spoiled)
(filelock-tests-unlock-spoiled)
(filelock-tests-kill-buffer-spoiled)
(filelock-tests-detect-external-change):
* test/src/image-tests.el
(image-tests-image-size/error-on-nongraphical-display)
(image-tests-image-mask-p/error-on-nongraphical-display)
(image-tests-image-metadata/error-on-nongraphical-display):
* test/src/process-tests.el (make-process/mix-stderr)
(process-tests/fd-setsize-no-crash/make-network-process)
(process-tests/fd-setsize-no-crash/make-serial-process):
Use ERT `skip-when` macro in tests.
2023-09-04 18:25:18 +02:00
Stefan Kangas
62f7760e61 Add skip-when macro to ert-deftest
This can help avoid some awkward test skip conditions.

For example, this triple negation:
    (skip-unless (not noninteractive))

Can be written as the simpler:
    (skip-when noninteractive)

* lisp/emacs-lisp/ert.el (ert-deftest): Add new 'skip-when' macro.
(ert--skip-when): New internal function.
* doc/misc/ert.texi (Tests and Their Environment): Document above
new macro.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-skip-when): New test.
2023-09-04 18:25:18 +02:00
Alan Mackenzie
f9b43107ce * etc/NEWS (static-if): Clarify the entry. 2023-09-04 13:06:44 +00:00
Alan Mackenzie
afcb6d0bc7 Correct the handling of symbols with position in equal
* src/fns.c (internal_equal): Only regard symbols with position
as their symbols when symbols-with-pos-enabled is non-nil.

* doc/lispref/symbols.texi (Symbols with Position): Expand the
description of symbols with position, in particular the way
they work with eq and equal.

* doc/lispref/objects.texi (Equality Predicates): Describe how
eq and equal handle symbols with position.

* test/src/fns-tests.el (fns-tests-equal-symbols-with-position):
New tests for symbols with position.
2023-09-04 12:51:24 +00:00
Gene Goykhman
55a0f0e047 Announce user option tramp-completion-multi-hop-methods
* doc/misc/tramp.texi (Ad-hoc multi-hops):
Add tramp-completion-multi-hop-methods.

* etc/NEWS: New user option tramp-completion-multi-hop-methods.
2023-09-04 11:43:18 +02:00
Po Lu
f8d82b4281 Merge remote-tracking branch 'savannah/master' into master-android-1 2023-09-04 09:42:42 +08:00
Po Lu
4bbad20d70 Correct deadlock in Android port
* java/org/gnu/emacs/EmacsService.java (updateCursorAnchorInfo):
Delete extraneous whitespace.
(updateExtractedText): Encase synchronous IM manager operation
in deadlock prevention mechanism.
2023-09-04 09:42:10 +08:00
João Távora
06b76b11e3 Revert "Eglot: reorganize Elisp API section, export new functions"
This reverts commit 726499305b.

One of the co-authors doesn't yet have a FSF copyright assignment.
2023-09-04 02:09:17 +01:00
João Távora
f7dd1adac4 Revert "Eglot: add new chapter about Elisp extensions to Eglot manual"
This reverts commit 2a66334bad.

One of the co-authors doesn't yet have a FSF copyright assignment.
2023-09-04 02:08:58 +01:00
João Távora
2a66334bad Eglot: add new chapter about Elisp extensions to Eglot manual
bug#65418

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

* doc/misc/eglot.texi (Extending Eglot): New chapter.
2023-09-04 02:01:26 +01:00
João Távora
726499305b 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 01:39:21 +01:00
Jonas Bernoulli
8255b9c1f1
; Fix previous commit touching lisp/international/emoji.el 2023-09-03 18:06:52 +02:00
Jonas Bernoulli
502e7c9a9b
Make emoji commands compatible with repeat and repeat-complex-command
* lisp/international/emoji.el (emoji-search): Read user input
inside 'interactive'.
* (emoji-insert-glyph): Determine glyph inside 'interactive',
using 'emoji--recent' when not invoked from one of its transient
prefixes but using 'recent' or 'recent-complex-command'.
2023-09-03 17:52:13 +02:00
Philipp Stephani
c799ad42f7 Fix Edebug specification for 'cl-define-compiler-macro'.
* lisp/emacs-lisp/cl-macs.el (cl-define-compiler-macro): Give the
instrumented name a suffix to make it unique.  Otherwise it will clash
with the name of the main function.
2023-09-03 16:56:18 +02:00
Stefan Kangas
6e1ee57c8e checkdoc: Don't warn for () in cl-defmacro args
Seen with, for example:

    (cl-defmacro foo (bar () &body baz) ...)

* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Improve support for `cl-defmacro' by ignoring "nil" in parameter list.
2023-09-03 15:39:16 +02:00
Alan Mackenzie
328f96ea9e New documentation for static-if.
* doc/lispref/control.texi (Conditional Compilation): New
section documenting static-if.
2023-09-03 13:08:36 +00:00
Alan Mackenzie
97652d0e7a New conditional compilation macro static-if.
* etc/NEWS: Record the new macro.

* lisp/subr.el (static-if): New macro.
2023-09-03 12:54:47 +00:00
Po Lu
6278e15f62 Update Android port
* java/org/gnu/emacs/EmacsService.java (browseUrl): Confer
rights to write the URI indefinitely.
2023-09-03 20:21:14 +08:00
Mauro Aranda
7eed479eab Fix defcustoms in filesets.el (Bug#65708)
* lisp/filesets.el (filesets-browse-dir-function)
(filesets-open-file-function filesets-save-buffer-function)
(filesets-commands filesets-external-viewers): Don't override default
value for the function widget with an invalid default value.
Remove redundant ":" in tag.
Fix default values for choice and list widgets.
2023-09-03 12:54:58 +02:00
Jim Blandy
2ed99b6aa9 Fix indentation in `syntax-ppss'
* lisp/emacs-lisp/syntax.el: Fix indentation in
`syntax-ppss'.  (Bug#58665)
2023-09-03 12:42:49 +02:00
Stefan Kangas
d871518724 * lisp/vc/vc-git.el (vc-git-annotate-switches): Add useful tip. 2023-09-03 12:28:13 +02:00
Stefan Kangas
15dc22124c Replace completion--some with seq-some
This is safe, as 'seq' is preloaded before 'minibuffer'.
* lisp/loadup.el ("minibuffer"): Document 'seq' dependency.
* lisp/minibuffer.el (completion--some): Remove.  Replace all uses
with 'seq-some'.
2023-09-03 12:28:13 +02:00