because they are very much an indicator of a mistake (such as
misplaced brackets), and since they are deleted by the optimiser, any
other warnings there are lost and the user wouldn't know that
something is wrong otherwise.
Don't cache warnings between bytecode compilation tests
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--with-fresh-warnings): New macro.
(test-byte-comp-compile-and-load, bytecomp--with-warning-test):
Use it.
Po Lu [Sat, 9 Sep 2023 07:49:47 +0000 (15:49 +0800)]
Update Android port
* src/android-asset.h (android_asset_read_internal): Return an
error indication if an exception arises while reading.
(AAsset_getBuffer): Free BUFFER using the C library free
function.
Jim Porter [Sat, 9 Sep 2023 05:24:06 +0000 (22:24 -0700)]
; Fix last change
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/sigpipe-exits-process): Make sure we have no *new*
processes, instead of making sure we have no processes at all.
For some reason the intervals case failed to push the var to
`loop-for-bindings` before pushing to `loop-for-sets`.
AFAICT this was the only place where we made that mistake.
Stefan Monnier [Fri, 8 Sep 2023 23:18:28 +0000 (19:18 -0400)]
(tempo-user-elements): Make it a proper hook
* lisp/tempo.el (tempo-user-element-functions): Rename from
`tempo-user-elements`.
(tempo-user-elements): Preserve as obsolete alias.
(tempo-is-user-element): Use `run-hook-with-args-until-success`.
Stefan Kangas [Fri, 8 Sep 2023 14:47:33 +0000 (16:47 +0200)]
Mark two flyspell functions as internal
* lisp/textmodes/flyspell.el: Minor doc fix.
(flyspell--mode-on, flyspell--mode-off): Rename from
'flyspell-mode-on' and 'flyspell-mode-off'. The old names are
preserved as obsolete aliases.
Po Lu [Fri, 8 Sep 2023 08:12:12 +0000 (16:12 +0800)]
Properly detect content files in Doc View
* lisp/doc-view.el (doc-view-mode): Detect if file name starts
with /content or /assets, and don't regard it as available to
subprocesses in that case.
Po Lu [Fri, 8 Sep 2023 02:37:18 +0000 (10:37 +0800)]
Permit XLFD names to exceed 255 characters
* doc/lispref/display.texi (Low-Level Font)
<font-xlfd-name>: Document new argument `long-xlfds'.
* etc/NEWS: Mention removal of XLFD length restrictions.
* src/font.c (font_build_object): Dynamically allocate XLFD,
permitting them to surpass 255 characters in length.
(font_parse_xlfd_1): Cease rejecting XLFDs more than 255
characters in length.
(font_dynamic_unparse_xlfd): New function. Like
font_unparse_xlfd, but allocate the XLFD dynamically.
(font_delete_unmatched): Dynamically allocate XLFD if necessary.
(Ffont_xlfd_name): New arg LONG_XLFDs. If t, return a
dynamically allocated XLFD. All callers changed.
* src/font.h: Update prototypes.
* src/fontset.c (Fnew_fontset): Dynamically allocate XLFD when
establishing fontset name.
Yuan Fu [Thu, 7 Sep 2023 23:04:29 +0000 (16:04 -0700)]
Change treesit-local-parsers-in to treesit-local-parsers-on
To improve consistency. We already have treesit-node-at and
treesit-node-on.
* doc/lispref/parsing.texi (Multiple Languages): Update manual.
* lisp/treesit.el (treesit-local-parsers-on): Change to in.
(treesit-font-lock-fontify-region): Change to in.
Stefan Kangas [Wed, 6 Sep 2023 09:21:39 +0000 (11:21 +0200)]
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.
* 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.
* admin/unidata/emoji-zwj.awk: More efficient code generation
Hoist the `eval-when-compile` to encompass the entire list, since
backquote forms aren't automatically evaluated at compile time.
This results in a single constant list in the generated code, and
much less actual code.
Stefan Kangas [Thu, 7 Sep 2023 15:48:14 +0000 (17:48 +0200)]
Update docs for (co-)maintainer changes
* admin/MAINTAINERS: Add information on current maintainers as a
canonical place to find this information.
* doc/emacs/ack.texi (Acknowledgments): Update for recent
Emacs (co-)maintainer changes.
* admin/make-tarball.txt: Add note as a reminder to update the above
before making a new release.
Jens Schmidt [Tue, 29 Aug 2023 20:14:48 +0000 (22:14 +0200)]
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)
john muhl [Mon, 4 Sep 2023 16:36:42 +0000 (11:36 -0500)]
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'.
martin rudalics [Wed, 6 Sep 2023 08:09:49 +0000 (10:09 +0200)]
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.
Po Lu [Thu, 7 Sep 2023 01:35:59 +0000 (09:35 +0800)]
Port Proced to Android
* configure.ac (HAVE_PROCFS): Define if opsys is `android'.
* src/android.c (android_set_task_name): New function.
(android_run_select_thread, android_run_debug_thread): Set the
name of the LWP for debugging purposes.
* src/process.c (create_process): Set F_SETPIPE_SZ on Android in
addition to GNU/Linux.
* src/sysdep.c (procfs_ttyname, system_process_attributes)
[__ANDROID__]: Enable procfs_ttyname on Android systems.
(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).
* lisp/textmodes/tex-mode.el (tex-recenter-output-buffer): Check
that 'display-buffer' returned a window, rather than nil, before
selecting it. (Bug#65762)
* lisp/leim/quail/indian.el
(quail-tamil-itrans-compute-syllable-table): Add missing comparison.
Patch from Visuwesh; bug found by an experimental tool.
Yuan Fu [Wed, 6 Sep 2023 02:57:34 +0000 (19:57 -0700)]
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.
Yuan Fu [Tue, 5 Sep 2023 06:45:21 +0000 (23:45 -0700)]
Allow filter by tag in treesit-parser-list
* doc/lispref/parsing.texi: Update manual.
* src/treesit.c (Ftreesit_parser_create): Disallow using t for tag.
(Ftreesit_parser_list): Add LANGUAGE and TAG parameter.
Yuan Fu [Tue, 5 Sep 2023 03:05:50 +0000 (20:05 -0700)]
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.
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:
* 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.
Daniel Martín [Mon, 12 Dec 2022 10:33:01 +0000 (11:33 +0100)]
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)
João Távora [Tue, 5 Sep 2023 16:20:25 +0000 (17:20 +0100)]
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.