Commit graph

8981 commits

Author SHA1 Message Date
Mattias Engdegård
9d0f5909af Correct suppression of suspicious eq type warning
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings):
* lisp/emacs-lisp/bytecomp.el (bytecomp--warn-dodgy-eq-arg):
Suppress warning using (suspicious FUNCTION), where FUNCTION is
not always `eq`.
2022-12-30 21:03:34 +01:00
Mattias Engdegård
29d23b7fa0 Consistent empty-body warning messages for let and let*
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings):
Make warning messages for let and let* consistent with other
empty-body warnings.
2022-12-29 17:00:01 +01:00
Mattias Engdegård
7c63b632e4 Add empty-body warning for when, unless etc
Warn about code like (when SOME-CONDITION) because these may indicate
bugs.  Warnings currently apply to `when`, `unless`, `ignore-error`,
`with-suppressed-warnings` and (as before) `let` and `let*`.

* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings):
Update doc string.
* lisp/emacs-lisp/bytecomp.el: (byte-compile-warning-types)
(byte-compile-warnings): Add empty-body.
(byte-compile-initial-macro-environment):
Add empty-body warning for with-suppressed-warnings.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
Use the empty-body category for let and let*.
* lisp/subr.el (when, unless, ignore-error): Add empty-body warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test cases.
2022-12-29 13:01:47 +01:00
Mattias Engdegård
2de25accaf Warn about `condition-case' with quoted condition names
* lisp/emacs-lisp/bytecomp.el (byte-compile-condition-case):
Add warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-warn-quoted-condition): Add test case.
2022-12-29 12:24:47 +01:00
Stefan Kangas
dce6791e99 Merge from origin/emacs-29
db96b1282f * lisp/help.el: Use 'C-h C-q' to toggle 'help-quick' wind...
489865c21e ; Improve markup of long key sequences
d42c2668cf ; * etc/NEWS: Fix wording of a recently edited entry.
7a0eaee198 * lisp/isearch.el: Small fixes.
b69bffeec0 * lisp/vc/diff-mode.el (diff-minor-mode-prefix): Replace ...
9263847ab7 ; * etc/NEWS: Move the paragraph with 'C-u RET' closer to...
62fb2dc37d * doc/emacs/display.texi (Text Scale): Improve section ab...
70480d3b6b * lisp/repeat.el (repeat-echo-function): Suggest 'add-fun...
fd48201ffe * lisp/tab-line.el (tab-line-cache-key-default): More cac...
b164660260 * etc/package-keyring.gpg: Update with new key
c0be51389e ; Yet another declare-function to avoid treesit-related w...
8676bec51d ; * lisp/treesit.el (treesit--simple-imenu-1): Doc fix; w...
2ddc480f44 Warn of absent networks module in ERC
19d00fab9a Avoid "already compiled" warning in erc-compat
2d8f7b66bc ; Fix one more treesit byte-compilation warning.
2d0a921486 ; Avoid treesit-related byte-compiler warnings
8503b370be (python--treesit-settings): Remove duplicate matcher
b464e6c490 Make last change of w32 GUI dialogs conditional and rever...
eedc9d79ae Fix tree-sitter typos
248c13dcfe Update tree-sitter major modes to use the new Imenu facility
b39dc7ab27 Add tree-sitter helper functions for Imenu
ba1ddea9da Fix treesit--things-around (bug#60355)
7512b9025a ; * lisp/treesit.el (treesit-traverse-parent): Remove alias.
5326b04198 Improve treesit-node-top-level and treesit-parent-until
637f5b164f ; Add "src" to the heuristic sub-directory heuristic
8ab6df0c9f ; * lisp/epa-ks.el (epa-ks-do-key-to-fetch): Fix 'when' u...
2b55a48d3e * src/w32menu.c (simple_dialog_show): Use MB_YESNOCANCEL ...
8b8b791567 ; Improve documentation of TAB/SPC indentation
624e382211 ; Improve doc strings of some new faces
41f12e1019 ; * lisp/elide-head.el (elide-head): Doc fix to silence c...
e3b4cd0ac1 ; * lisp/htmlfontify.el (hfy-text-p): Fix whitespace.
1b4dc4691c Fix htmlfontify.el command injection vulnerability.
1fe4b98b4d Improve support for Scheme R6RS and R7RS libraries (bug#5...
2347f37f67 ; * test/src/treesit-tests.el: remove dead store (bytecom...
a6d961ae2f Add a new tree-sitter query predicate 'pred'
835a80dcc4 ; Fix tree-sitter defun tests
a14821d615 Improve gnutls-min-prime-bits docstring
b14bbd108e Improve handling of tab-bar height.
669160d47b ; * nt/INSTALL.W64: More fixes and updates.
26b2ec7cb8 Simplify last change (bug#60311)
082fc6e308 Fix 'json-available-p' on MS-Windows
6c86faec29 loaddefs-gen: Group results by absolute file name
d90d7d15f2 ; Fix vindexes in parsing.texi
eb26872837 Fix imenu for c-ts-mode (bug#60296)
8f68b6497e Clean up python-ts-mode font-lock features
28f26b11a1 Add comment indent and filling to other tree-sitter major...
c6b0282645 ; Remove unused function in c-ts-mode
6e52a9fcad ; * doc/lispref/modes.texi (Parser-based Font Lock): Mino...
2bcd1e9a99 ; * doc/lispref/parsing.texi (Retrieving Nodes): Add notice.
7c7950fe00 Add maintainer stub for tree-sitter files
cf32776622 ; * doc/lispref/parsing.texi (Using Parser): Remove delet...

# Conflicts:
#	etc/NEWS
#	lisp/progmodes/c-ts-mode.el
#	lisp/progmodes/typescript-ts-mode.el
#	lisp/treesit.el
2022-12-28 21:40:59 +01:00
Philip Kaludercic
637f5b164f ; Add "src" to the heuristic sub-directory heuristic
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check for "src"
directories, next to "lisp".
2022-12-27 21:23:38 +01:00
Kyle Meyer
6c86faec29 loaddefs-gen: Group results by absolute file name
loaddefs-generate produced an incomplete output file if 1) it
was called with a relative file name and 2) that same file was
specified via a generated-autoload-file cookie in a subset of
the input files.  In that case, autoload entries were lost
because loaddefs-generate writes the same output file twice:
once for the relative name specified by the caller and once
for the absolute name that loaddefs-generate--parse-file
returns for the generated-autoload-file value.
This has been fixed.  (Bug#60318)

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Expand file
names when grouping loaddef files.
2022-12-26 14:55:08 +02:00
Stefan Kangas
419ca81809 Merge from origin/emacs-29
6c00d126e7 Remove remaining mentions of 'eval-current-buffer'
1073e96170 ; * doc/lispref/text.texi (Database): Fix a typo.  (Bug#6...
b1e68a33d8 Update to Org 9.6-61-g63e073f
dad73e4de1 ; Review and fix NEWS and related documentation
72786ae237 ; Restore ARGS argument in c-ts-mode--fontify-declarator
940ab2423c ; Always consider :lisp-dir when locating main file of VC...
9ab98cd42a Add heuristic to locate lisp code in source packages
dda011c78d ; * doc/lispref/parsing.texi (Tree-sitter major modes): F...
d62b634d8f ; * src/process.c (Fprocess_running_child_p): Doc fix.
f6c5b3d635 ; * doc/lispref/parsing.texi: Add a reminder.
e6c49c0454 ; Fix byte-copmiler warning in c-ts-mode--fontify-declarator
4234033a47 ; * lisp/treesit.el: Add some comments.
79584a206b Further generalize treesit-defun functions
a819ca5a93 Generalize treesit-defun functions to "things"
e8b34109ee Reorder optional arguments to 'package-vc-install'
b38e56d8a9 Handle missing dependencies for source packages
7bc7b6b4dd ; Partial revert of f3e7820b
2cec78254e ; * nt/INSTALL.W64: Fix wording.
ecee3bd420 ; Fix recent changes in treesit documentation

# Conflicts:
#	etc/NEWS
2022-12-26 06:30:21 +01:00
Gregory Heytings
6c00d126e7 Remove remaining mentions of 'eval-current-buffer'
* lisp/emacs-lisp/edebug.el (edebug-all-defs):
* doc/lispref/eval.texi (Eval):
* doc/lispref/edebug.texi (Instrumenting, Edebug Options):
Remove remaining mentions of 'eval-current-buffer', obsoleted in
Emacs 22 and removed in Emacs 26.
2022-12-26 02:26:47 +01:00
Eli Zaretskii
dad73e4de1 ; Review and fix NEWS and related documentation
* etc/NEWS: Fix wording, punctuation, and markup.

* lisp/emacs-lisp/subr-x.el (string-glyph-split): Doc fix.

* doc/lispref/display.texi (Displaying Messages): Document
'set-message-functions'.
2022-12-25 14:54:33 +02:00
Philip Kaludercic
940ab2423c ; Always consider :lisp-dir when locating main file of VC packages
* lisp/emacs-lisp/package-vc.el (package-vc--main-file): Check the
:lisp-dir entry in the "extras" of a package description to find the
directory with a main file.
2022-12-25 11:21:01 +01:00
Philip Kaludercic
9ab98cd42a Add heuristic to locate lisp code in source packages
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check if a
"lisp" directory exists and use that instead of PKG-DIR.

(Bug#60155)
2022-12-25 11:21:01 +01:00
Philip Kaludercic
e8b34109ee Reorder optional arguments to 'package-vc-install'
* lisp/emacs-lisp/package-vc.el (package-vc-install-selected-packages):
Update 'package-vc-install' invocation.
(package-vc-install): Reorder and update documentation.
2022-12-25 09:53:07 +01:00
Philip Kaludercic
b38e56d8a9 Handle missing dependencies for source packages
* lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies): Add
new function.
(package-vc--unpack-1): Call 'package-vc-install-dependencies' instead
of 'package-compute-transaction' and 'package-download-transaction'.

It is unreasonable to abort the installation, since we cannot expect
all dependencies to be available in the regular archives.  Instead we
note which packages couldn't be found, and warn the user that these
will be missing.
2022-12-25 09:36:01 +01:00
Philip Kaludercic
7bc7b6b4dd ; Partial revert of f3e7820b
* lisp/emacs-lisp/package.el (package-install-from-archive): Check if
a package is a directory package, not a VC package
2022-12-25 09:36:01 +01:00
Stefan Kangas
48db8b68a8 Merge from origin/emacs-29
c36fe3df17 Fix c-ts-mode imenu defun name (bug#60296)
a24e350170 Fix treesit--children-covering-range-recurse (bug#60301)
fbb4eb919b Support treesit-defun-name in tree-sitter major modes
6253184afc ; * lisp/treesit.el (treesit-defun-at-point): Guard again...
f8e219ebfa Add treesit-defun-name and friends
35c2ca2ca6 Make treesit-node-at/on guess language at point
7f7def2ae6 ; Add treesit-no-parser error
b6a2e1ddf6 * nt/INSTALL.W64: update instructions for setting up W64 ...
265b91d891 Revert "; Bump minimum supported Windows version for MinG...
75155e4586 ; Bump minimum supported Windows version for MinGW64 to W...
677f6c79eb ; Update minimum requirements of MinGW-w64
7723af5e4a ; * lisp/progmodes/c-ts-mode.el: quote literal string in ...
38866510c7 ; * src/xdisp.c (redisplay_internal): Reinstate the FRAME...
a825aa0b13 Fix definition of CNS 11643-15 charset
a42b20dd95 ; * lisp/progmodes/c-ts-mode.el: Add outline section head...
e4e3634539 Improve c-ts-mode block comment indent (bug#60270)
e30621caa2 ; Add treesit_recursion_limit
6a43af5880 Fix block comment indent and filling for c-ts-mode (bug#5...
e492c21e81 Fix treesit_cursor_helper (bug#60267)
4437dbedf7 Fix restart-emacs alarms (Bug#60220)
121a9ff9f6 Fix alternate stack test in configure
84888080ee Add more functions to "string" shortdoc
c90f97d4e5 Make the Contour terminal an alias of xterm-256color
c3fac9465f ; Fix punctuation in last change.
756bb422a4 Correct wrong info in (info)Go to node
a8c3424d28 Fix typo in TUTORIAL.fr (bug#60261)
24cd2f0daf Add some diff-fixup-modifs tests
d32091199a Fix quoted argument in emacsclient-mail.desktop Exec key
286c48137f ert-x: Move window selection logic to its own macro
823c49cea8 ; ert-x: Simplify `ert-with-test-buffer-selected'
38c6abe4d0 ; ert-x: Add test for buffer read-only state
0e39ad6fa5 Fix crash after X error
2022-12-25 06:30:21 +01:00
Mattias Engdegård
8bb8cc5b49 Fix condition-case body for-effect miscompilation
(condition-case x A (:success B)) should not compile A for-effect even
if the entire form is in for-effect context.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't optimise the condition-case body form for effect (potentially
discarding its value) if there is a success handler and a variable.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
2022-12-24 11:54:47 +01:00
Xi Lu
84888080ee Add more functions to "string" shortdoc
* lisp/emacs-lisp/shortdoc.el: Add 'string-or-null-p',
'char-or-string-p', 'char-uppercase-p'.  (Bug#60279)
2022-12-24 09:55:22 +02:00
Richard Hansen
286c48137f ert-x: Move window selection logic to its own macro
* lisp/emacs-lisp/ert-x.el (ert-with-buffer-selected): New macro to
temporarily display a buffer in a selected window and evaluate a body.
(ert-with-test-buffer-selected): Use the new macro.
* test/lisp/whitespace-tests.el
(ert-test-with-buffer-selected/current)
(ert-test-with-buffer-selected/selected)
(ert-test-with-buffer-selected/nil-buffer)
(ert-test-with-buffer-selected/modification-hooks)
(ert-test-with-buffer-selected/read-only)
(ert-test-with-buffer-selected/return-value): Add tests.
(Bug#60189)
2022-12-24 09:14:23 +02:00
Richard Hansen
823c49cea8 ; ert-x: Simplify `ert-with-test-buffer-selected'
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected):
Simplify using 'ert-with-test-buffer'.  (Bug#60189)
2022-12-24 09:12:12 +02:00
Stefan Kangas
08bb91c7df Merge from origin/emacs-29
e59216d3be * Invoke spawed Emacs processes with '-Q' when native com...
777b383dd0 Fix Eshell electric slash when used from the root directo...
c088cdad9e Fix the --without-all build with tree-sitter
ec9fbad908 Fix write-region to null device on MS-Windows
f35da11199 message: Do not default to eudc-capf-complete yet
98c16a8c88 ; * lisp/tab-bar.el: Remaining renaming of "fixed-width" ...
d76d7a3beb whitespace: Avoid mutating original buffer's markers in c...
2022-12-22 06:30:09 +01:00
Andrea Corallo
e59216d3be * Invoke spawed Emacs processes with '-Q' when native compiling (bug#60208)
* lisp/emacs-lisp/comp.el (comp-final): Invoke spawned Emacs with '-Q'.
(comp-run-async-workers): Likewise.
2022-12-21 23:29:33 +01:00
Stefan Kangas
8d6fb6498a ; Revert UK->US spelling fix in rx.el
* lisp/emacs-lisp/rx.el (rx--normalise-or-arg): Revert to British
spelling of internal symbol.
2022-12-20 12:00:38 +01:00
Stefan Kangas
b4941419c5 ; Fix typos in some function names
* lisp/cedet/semantic/decorate/include.el
(semantic-decoration-unparsed-include-reference-reset): Rename
from 'semantic-decoration-unparsed-include-refrence-reset'.
* lisp/emacs-lisp/rx.el (rx--normalize-or-arg): Rename from
'rx--normalise-or-arg'.
* lisp/frame.el (frame--current-background-mode): Rename from
'frame--current-backround-mode'.
* lisp/url/url-future.el (url-future-canceled-p): Rename from
'url-future-cancelled-p'.  Update all uses.  Make old names into
obsolete function aliases.
2022-12-20 06:15:55 +01:00
Mattias Engdegård
33af537198 Elide broken but unnecessary if optimisations
* lisp/emacs-lisp/byte-opt.el (byte-optimize-if):
Remove explicit clauses purposing to simplify

    (if X nil t) -> (not X)
    (if X t nil) -> (not (not X))

but never did so because of a coding mistake (eq instead of equal),
found by a recently added warning.  They weren't actually needed
thanks to the optimiser's fixpoint iteration: we eventually get the
same results through

    (if X nil t) -> (if (not X) t nil) -> (if (not X) t) -> (not X)
    (if X t nil) -> (if X t) -> (not (not X))
2022-12-19 13:19:09 +01:00
Mattias Engdegård
91d6b73421 alist-get testfn argument evaluation correction
* lisp/emacs-lisp/gv.el (alist-get):
Evaluate TESTFN exactly once (previously up to 3 times).
Reduce the macro-expansion to include a call to either assoc or assq,
not both; this reduces the generated code size in some cases.
2022-12-19 13:19:09 +01:00
Stefan Kangas
6c540e38f4 Merge from origin/emacs-29
12e26cc0c1 ; * admin/git-bisect-start: Add mistakenly ommitted commi...
9a751e0a38 ruby-mode: Support endless singleton method definitions too
ce7b7e5af3 Remove comment-start-skip preset in tree-sitter indentati...
c1e015ae32 Fix recent change in tramp-smb.el
cf1b771864 ; * etc/NEWS: Fix typos.
50d18bb6ea Make tramp-archive autoloads robust for older Emacs versions
3941cc29df ; Improve documentation of 'setopt'
6f88de109c ruby-mode: Support endless methods (bug#54702)
91dd893e34 ; * lisp/progmodes/sql.el (sql-product-interactive): Doc ...
138d9dc4cb * lisp/cus-edit.el (setopt--set): Warn instead of rasing ...
d1e0542f33 Allow customising windmove user options with an empty prefix
c2375e7791 Improve and extend admin/git-bisect-start
7cc2313eb0 Make 'rmail-summary-by-thread' faster
88e59b16cb ; Improve documentation of installing tree-sitter and gra...
897f33bf31 Fix the MS-DOS build
660e941235 Avoid crashes in PGTK build due to signal in 'note_mouse_...
0fc5fb2d05 Fix MS-Windows build broken by recent treesit.c changes
5b2e6d04ce Fix wrong capture in typescript-ts-mode (bug#60167)
cb8ccdd267 Add rust-ts-mode (Bug#60136)
9fcf764dd7 Indentation fixes for jsx/tsx (bug#60169)
69f2c71135 Fix treesit-query-validate problem with view-mode
1fc7535546 Use cursor API in treesit-node-parent
5f0286c0af Switch to use cursor API in treesit.c
a275e436df Add treesit_assume_true and treesit_cursor_helper
a54c7a8df0 Remove file-exists-in-trash-p
3e02029642 Update to Org 9.6-49-g47d129
4a8ff671b0 Don’t assume make-directory handler returns nil
44c83b239d Fix copy-directory bug when dest dir exists
bef1edc9ca make-directory now returns t if dir already exists
8a9579ca29 Use make-directory handlers uniformly
627e7e0243 Improve documentation of 'file-exists-p'
c9015ef55f Fix resizing of mini-windows by 'set-minibuffer-message'
5a245bc786 Prevent Abort dialogs from async-compiling jobs on Windows
4d1e4a4893 Fix 'window-max-chars-per-line' when there are no fringes
d65beb820c ; Revert "; * lisp/subr.el (internal--with-narrowing): Si...
1c0b90e5f7 ruby-mode: Recognize instance or global var as first arg ...
3356c0cb16 Fix end-of-defun in ruby-mode

# Conflicts:
#	etc/NEWS
2022-12-19 04:42:19 +01:00
Stefan Kangas
d468cf91b9 Merge from origin/emacs-29
de2239a584 Revert "alist-get testfn argument evaluation correction"
856d889f3a Revert "Elide broken but unnecessary `if` optimisations"
8e42e20ed7 Revert "Use equal and member instead of eq and memq"
2022-12-19 04:42:18 +01:00
Mattias Engdegård
730a39e881 Warn about lambda expressions in comparisons
Lambda expressions are not comparable; warn about calls such as
(eq x (lambda ...)) etc.

* lisp/emacs-lisp/bytecomp.el (bytecomp--dodgy-eq-arg): Rename to...
(bytecomp--dodgy-eq-arg-p): ...this.  Use pcase.  Add lambda checks.
(bytecomp--value-type-description, bytecomp--arg-type-description)
(bytecomp--check-eq-args, bytecomp--check-memq-args): Add function
checks.  Update calls.  Make compiler-macro arguments optional to
avoid crashes in malformed code.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp--with-warning-test): Simplify argument.  Run each
compilation with a fresh (empty) warning cache.  Add ert-info for
easier debugging.
(bytecomp-warn-dodgy-args-eq, bytecomp-warn-dodgy-args-memq):
Add lambda tests.
2022-12-18 14:55:02 +01:00
Mattias Engdegård
68fb06f47f Fix compiler macro expansion bug
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
When a compiler-macro handler is re-invoked (after macro-expanding
arguments), actually use the result instead of pointlessly dropping it
on the floor.
2022-12-18 14:48:54 +01:00
Eli Zaretskii
5a245bc786 Prevent Abort dialogs from async-compiling jobs on Windows
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Disable Abort
dialog popping in the sub-processes that perform async
compilation, by passing w32-disable-abort-dialog=t on their
command line.
2022-12-17 20:35:11 +02:00
Philip Kaludercic
3b226f769e * lisp/emacs-lisp/package.el (package-report-bug): Autoload it. 2022-12-17 12:18:55 +01:00
Mattias Engdegård
6283b92334 Elide broken but unnecessary if optimisations
* lisp/emacs-lisp/byte-opt.el (byte-optimize-if):
Remove explicit clauses purposing to simplify

    (if X nil t) -> (not X)
    (if X t nil) -> (not (not X))

but never did so because of a coding mistake (eq instead of equal),
found by a recently added warning.  They weren't actually needed
thanks to the optimiser's fixpoint iteration: we eventually get the
same results through

    (if X nil t) -> (if (not X) t nil) -> (if (not X) t) -> (not X)
    (if X t nil) -> (if X t) -> (not (not X))
2022-12-16 19:18:34 +01:00
Mattias Engdegård
30d2b72c41 alist-get testfn argument evaluation correction
* lisp/emacs-lisp/gv.el (alist-get):
Evaluate TESTFN exactly once (previously up to 3 times).
Reduce the macro-expansion to include a call to either assoc or assq,
not both; this reduces the generated code size in some cases.
2022-12-16 19:18:34 +01:00
Eli Zaretskii
de2239a584 Revert "alist-get testfn argument evaluation correction"
This reverts commit 17d65c99cd.

Please don't install unnecessary improvements on the release
branch.
2022-12-16 19:29:30 +02:00
Eli Zaretskii
856d889f3a Revert "Elide broken but unnecessary if optimisations"
This reverts commit 13aa376e93.

Please don't install anything on the release branch that is
not a clear bugfix for a known bug.
2022-12-16 19:27:33 +02:00
Mattias Engdegård
b29be11a6f Closures are always non-nil
* lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp):
Treat closures as true in boolean context.
2022-12-16 17:18:44 +01:00
Mattias Engdegård
13aa376e93 Elide broken but unnecessary if optimisations
* lisp/emacs-lisp/byte-opt.el (byte-optimize-if):
Remove explicit clauses purposing to simplify

    (if X nil t) -> (not X)
    (if X t nil) -> (not (not X))

but never did so because of a coding mistake (eq instead of equal),
found by a recently added warning.  They weren't actually needed
thanks to the optimiser's fixpoint iteration: we eventually get the
same results through

    (if X nil t) -> (if (not X) t nil) -> (if (not X) t) -> (not X)
    (if X t nil) -> (if X t) -> (not (not X))
2022-12-16 17:17:23 +01:00
Mattias Engdegård
17d65c99cd alist-get testfn argument evaluation correction
* lisp/emacs-lisp/gv.el (alist-get):
Evaluate TESTFN exactly once (previously up to 3 times).
Reduce the macro-expansion to include a call to either assoc or assq,
not both; this reduces the generated code size in some cases.
2022-12-16 17:17:23 +01:00
Stefan Kangas
0d60579b6b Merge from origin/emacs-29
99aa00e6e3 Revert 21b387c39b with last-minute hasty changes (bug#60...
386d6e74d8 Replace an erroneous eq with an equal in cc-defs.el
eb06947063 * lisp/tab-bar.el ([tab-bar]): Use 'make-sparse-keymap' i...
26243f7b65 compile.el: Fix regression with nb of errors in modeline
6e2923d80f Make tab-bar-tab-group-format-function backwards-compatib...
b211a63455 Make tab-bar-tab-group-format-function also handle curren...
367022f316 Ensure package directories for source packages from check...
3a633bdd6d ; * etc/NEWS: Fix recent changes.
6aa5d16c64 * test/README (SELECTOR): Add eglot-tests.el to remote fi...
bb27be36dd Fix bug#60060 in Tramp
d4c2aa4f91 ; * lisp/net/tramp-crypt.el: Fix comment.
8404253d17 * .gitignore: Ignore GDB history files.
12684c3a19 Mention 'tree-sitter' in user manual and NEWS
49d7e0cec6 ; * etc/NEWS: Rearrange entries for tree-sitter supported...
0ad2112a2f ; Announce 'toml-ts-mode' in NEWS.

# Conflicts:
#	etc/NEWS
2022-12-15 21:13:16 +01:00
Stefan Kangas
eacdac3c6e Merge from origin/emacs-29
a15cd55044 ; Don't quote nil in comments
da39200c4b ; Checkdoc fixes in dired-aux.el
fd403a5c5a Fix ruby-add-log-current-method after nested class defini...
2ca06aed7b Add indent rules to js/typescript/tsx-ts-mode (bug#60074)
a54d5f500c Improve fontification in csharp-ts-mode (bug#59897)
3db2f560bb Revert "Add expression for generic_name in csharp-ts-mode"
1985762fbd Introduce support for TOML config-format
622838b957 Fix handling of % when searching in .tex or .dtx files
3b226b6024 Treat C++ classes as defuns in C Tree-sitter mode (bug#60...
480f41c7de Add < and > to the syntax table in c++-ts-mode (bug#60049)
fbf0d3b796 Improve fontifications in Typescript mode
f93a5180a6 Update the documentation of overlays (bug#59996)
d51b66ed54 ; Improve description of scoping and let-bindings
752f9dde63 ; Fix a typo in window.el
102a3e3b44 Don't send erc-sasl-user as USER command argument
f0c9088878 Set erc-network to a "given" ID instead of failing
09c0c6b2ba Limit casemapping to appropriate ranges in ERC
44b04c0ac1 Actually accept non-symbols as IDs in erc-open
75f26646d4 ; Be nicer when updating browse-url var in erc-compat
0155fc67be Respect a nil erc-session-password when reconnecting
9ac80e8a6e Add dedicated auth-source section in ERC manual
2d96a18cd0 ; * lisp/emacs-lisp/shortdoc.el: fix mistakes in previous...
1d3cbba7df ; * lisp/progmodes/cmake-ts-mode.el (auto-mode-alist): $ ...
0cc199f1a6 Better shortdoc examples
931d97bf56 Shortdoc: read and evaluate strings after :eval
be165f7533 Fix Tramp tests in eglot-tests, prefix tests uniquely
8c30cb90ba * lisp/vc/vc-git.el (vc-git-checkin): Use make-nearby-tem...
3efe4df1d2 Delete temp files after icalendar tests

# Conflicts:
#	etc/NEWS
2022-12-15 21:13:14 +01:00
Philip Kaludercic
367022f316 Ensure package directories for source packages from checkouts
* lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
Set the :dir entry, since `package-vc--unpack-1' assumes the field is
set, as is the case when invoking `package-vc--unpack'.
2022-12-15 18:31:13 +01:00
Stefan Kangas
a15cd55044 ; Don't quote nil in comments 2022-12-15 02:35:00 +01:00
Mattias Engdegård
537f78b537 Warn about unmatchable constant args to eq, memq etc
Add a byte-compiler warning about attempts to compare literal values
with undefined identity relation to other values.  For example:

  (eq x 2.0)
  (memq x '("a" (b) [c]))

Such incomparable values include all literal conses, strings, vectors,
records and (except for eql and memql) floats and bignums.
The warning currently applies to eq, eql, memq, memql, assq, rassq,
remq and delq.

* lisp/emacs-lisp/bytecomp.el (bytecomp--dodgy-eq-arg)
(bytecomp--value-type-description, bytecomp--arg-type-description)
(bytecomp--warn-dodgy-eq-arg, bytecomp--check-eq-args)
(bytecomp--check-memq-args): New.
(eq, eql, memq, memql, assq, rassq, remq, delq):
Set compiler-macro property.
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings):
Amend doc string.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp--with-warning-test): Fix text-quoting-style and expand
re-warning so that it doesn't need to be a literal.
(bytecomp-warn-dodgy-args-eq, bytecomp-warn-dodgy-args-memq):
New tests.
2022-12-14 19:30:16 +01:00
Mattias Engdegård
2d96a18cd0 ; * lisp/emacs-lisp/shortdoc.el: fix mistakes in previous commit 2022-12-14 14:06:46 +01:00
Mattias Engdegård
0cc199f1a6 Better shortdoc examples
* lisp/emacs-lisp/shortdoc.el
(symbol, comparison): New.
(string, list, number): Remove or change examples that do not have
well-defined results, such as `eq` on strings or floats.
Edit other examples for better illustrating each respective operation.
2022-12-14 12:20:46 +01:00
Mattias Engdegård
931d97bf56 Shortdoc: read and evaluate strings after :eval
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function):
If the parameter of :eval is a string then read, evaluate and print
the result.  This was always the intention and is documented behaviour.
2022-12-14 12:16:28 +01:00
Stefan Kangas
8036739c1b Merge from origin/emacs-29
cd5856e403 Fix bug when calling `rgrep` non-interactively
ba4bdd6a25 Adapt Tramp specific tests in eglot-tests.el
1d5c35c8e4 * lisp/textmodes/texinfo.el (texinfo-flymake): Improve do...
a99d0e7e6c Support a function in the BUFFER-LIST arg of list-buffers...
def51dd645 ; Fix typos
4980ed7a6d Don't allow lazy highlight from recursive minibuffers
4ef8b9f544 Improve resetting face attributes when looking for suitab...
c4b8bc90a8 ; Fix typos in doc strings
c45eb13845 ; * lisp/bs.el (bs-attributes-list): Doc fix
d6adaf487d Add lexical-binding to example package header
03ad1a92a2 Add improved tree-sitter navigation
a5272e2a7c ; * test/src/treesit-tests.el: Add outline headers.
489bcacc7c Add cross-reference to flush-lines
0f9e6532b1 Use font-lock-number-face for numeric values in csharp-mode
4bccb7b211 Make treesit-query-validate create a read-only buffer
c0fe6c72ce Improve dockerfile-ts-mode imenu generation (Bug#59979)
631908f701 Add "->" to python--treesit-operators (bug#59968)
5d4274d9b6 ; * admin/notes/tree-sitter/build-module/build.sh: Add -f...
d264b75669 Align C++ access specifiers to their enclosing class/stru...
ca67d988d8 Add cmake-ts-mode
8ec923775d Tweak various ts-mode's indent and fontification (bug#59931)
647b6a8099 Add expression for generic_name in csharp-ts-mode (bug#59...
5b178efd85 ; Adjust eglot test to recent autopep8/pycodestyle
58b8ed8b55 ; Avoid compilation warning on MS-Windows
40c23c11e8 * lisp/outline.el: Fix the value 'insert' of outline-mino...
527eb11de2 * lisp/minibuffer.el (completions-group-separator): Rever...
42d740fb2c ; Skip two eglot tests when typescript is missing
19ef86f775 ; Remove outdated text describing overlays
081bf58300 Skip Eglot rust-analyzer tests if 'cargo' isn't available

# Conflicts:
#	lisp/progmodes/typescript-ts-mode.el
#	lisp/treesit.el
2022-12-14 00:06:29 +01:00
Stefan Kangas
def51dd645 ; Fix typos 2022-12-13 18:44:41 +01:00
Stefan Kangas
fcd0b377e0 Merge from origin/emacs-29
06ef030f93 use-package.texi: New section "Manual installation"
f4ce6fa7d3 Revert "Revert "Improve last change to xfaces.c" (05ece1e...
b8d2ec920f Revert "Improve last change to xfaces.c" (05ece1eb8b)
24c8c28ae6 Do not pare arguments unnecessarily.
9c0d7bb73b Add automated tests for Eglot
d3669cfe15 Eglot: allow skipping compile-time warnings about LSP int...
04b7e01885 ; project.el: Bump version.
f2876014ad Add customizale faces for tree-sitter explorer
3e349ee119 Fix error message when installing non-existent package
733cdeabfb Don't use diff-mode buffer as a patch when it's visiting ...
87475f4af2 Fix pcase rx patterns using rx-let bindings (bug#59814)
4893a15631 Fix use-package-defaults defcustom type (bug#59941)
074b7e6f4d ; * lisp/use-package/bind-key.el: Remove ineffective back...
864ed9dfa1 ; * lisp/progmodes/dockerfile-ts-mode.el: use \' instead ...
9f7e5584a4 * lisp/language/indian.el: Improve Brahmi composition rul...
78ad33bb05 ; Minor cleanup of last change in xfaces.c.
2024ade271 ; Improve docs of relaxing face-font attribute match (bug...
2022-12-12 09:05:53 +01:00