]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agovc-git-checkin: Don't try to apply an empty patch
Sean Whitton [Tue, 20 Dec 2022 22:53:19 +0000 (15:53 -0700)]
vc-git-checkin: Don't try to apply an empty patch

* lisp/vc/vc-git.el (vc-git-checkin): Don't try to apply an empty
patch to the index, because in that case 'git apply' fails.

2 years agovc-git-checkin: Offer to unstage conflicting changes
Sean Whitton [Fri, 16 Dec 2022 18:28:20 +0000 (11:28 -0700)]
vc-git-checkin: Offer to unstage conflicting changes

* lisp/vc/vc-git.el (vc-git-checkin): When committing a patch, if
conflicting changes are already staged, offer to clear them, instead
of just immediately failing with "Index not empty" (bug#60126).

2 years agoEnsure that we are not aset-ing Lisp records in purespace.
Vibhav Pant [Tue, 20 Dec 2022 15:59:54 +0000 (21:29 +0530)]
Ensure that we are not aset-ing Lisp records in purespace.

* src/data.c (Faset): Enforce that Lisp records passed to aset are
impure with CHECK_IMPURE.

2 years ago; Revert UK->US spelling fix in rx.el
Stefan Kangas [Tue, 20 Dec 2022 10:43:30 +0000 (11:43 +0100)]
; Revert UK->US spelling fix in rx.el

* lisp/emacs-lisp/rx.el (rx--normalise-or-arg): Revert to British
spelling of internal symbol.

2 years agoImprove safety of calls to vendor-specific-keysyms
Po Lu [Tue, 20 Dec 2022 07:42:26 +0000 (15:42 +0800)]
Improve safety of calls to vendor-specific-keysyms

* src/xterm.c (x_term_init): Wrap call to
vendor-specific-keysyms inside safe_call.

2 years ago; Fix typos in some function names
Stefan Kangas [Tue, 20 Dec 2022 05:13:23 +0000 (06:13 +0100)]
; 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.

2 years ago; * lisp/vc/vc.el (vc-prepare-patch): Fix typo.
Sean Whitton [Mon, 19 Dec 2022 22:15:48 +0000 (15:15 -0700)]
; * lisp/vc/vc.el (vc-prepare-patch): Fix typo.

2 years agovc-prepare-patch: Number the attached patches
Sean Whitton [Sat, 17 Dec 2022 05:34:52 +0000 (22:34 -0700)]
vc-prepare-patch: Number the attached patches

* lisp/gnus/mml.el (mml-attach-buffer): New FILENAME argument.
* lisp/vc/vc.el (vc--subject-to-file-name): New function.
(vc-prepare-patch): When vc-prepare-patches-separately is nil,
generate file names for the attached patches.
Call vc--subject-to-file-name, and then prepend numbers indicating the
ordering of the patches (bug#60147).

2 years ago; Fix byte-compilation warnings
Eli Zaretskii [Mon, 19 Dec 2022 17:34:36 +0000 (19:34 +0200)]
; Fix byte-compilation warnings

* lisp/cus-edit.el (custom-reset-standard-save-and-update): Fix
byte-compilation warnings about using 'eq'.

2 years agocalled-interactively-p: cut broken comparison
Mattias Engdegård [Mon, 19 Dec 2022 16:42:33 +0000 (17:42 +0100)]
called-interactively-p: cut broken comparison

* lisp/subr.el (called-interactively-p): Remove attempt to detect
`byte-code` frames; it wasn't done right but also does not seem
to be necessary.  Adjust comment that was out of date.

2 years agoAdd support for additional memory checks using AddressSanitizer.
Vibhav Pant [Mon, 19 Dec 2022 12:34:05 +0000 (18:04 +0530)]
Add support for additional memory checks using AddressSanitizer.

When Emacs is compiled with AddressSanitizer support, enable
poisoning/unpoisoning freed/unused Lisp objects and other internal
memory management structures. If enabled, this will mark freed bytes
that have been put on free lists for future use and initially
allocated memory blocks/chunks as "poisoned", triggering an ASan error
if they are accessed improperly. Structures are unpoisoned when they
have been taken off their respective free lists. Additionally, add
optional macros for performing unaligned loads, which when enabled by
defining USE_SANITIZER_UNALIGNED_LOAD will use ASan provided functions
for loading from unaligned addresses, which may help catch bugs that
AddressSanitizer might otherwise miss.

* configure.ac: Check for the existence of address and common
sanitizer API headers.

* src/lisp.h (UNALIGNED_LOAD_SIZE): New macro. If enabled, and the
necessary sanitizer API is available, define it to
__sanitizer_unaligned_load(64|32) depending on the word size of the
architecture.

* src/fns.c [HAVE_FAST_UNALIGNED_ACCESS] (Fstring_lessp): Use
'UNALIGNED_LOAD_SIZE' to perform unaligned loads from the two strings.

* src/alloc.c (ASAN_POISON_ABLOCK, ASAN_UNPOISON_ABLOCK)
(ASAN_POISON_INTERVAL_BLOCK, ASAN_UNPOISON_INTERVAL_BLOCK)
(ASAN_POISON_INTERVAL, ASAN_UNPOISON_INTERVAL)
(ASAN_PREPARE_DEAD_SDATA, ASAN_PREPARE_LIVE_SDATA)
(ASAN_POISON_SBLOCK_DATA, ASAN_POISON_STRING_BLOCK)
(ASAN_UNPOISON_STRING_BLOCK, ASAN_POISON_STRING)
(ASAN_UNPOISON_STRING, ASAN_POISON_FLOAT_BLOCK)
(ASAN_UNPOISON_FLOAT_BLOCK, ASAN_POISON_FLOAT)
(ASAN_UNPOISON_FLOAT, ASAN_POISON_CONS_BLOCK)
(ASAN_POISON_CONS, ASAN_UNPOISON_CONS)
(ASAN_POISON_VECTOR_CONTENTS, ASAN_UNPOISON_VECTOR_CONTENTS)
(ASAN_UNPOISON_VECTOR_BLOCK, ASAN_POISON_SYMBOL_BLOCK)
(ASAN_UNPOISON_SYMBOL_BLOCK, ASAN_POISON_SYMBOL)
(ASAN_UNPOISON_SYMBOL) [ADDRESS_SANITIZER]: New macros. When
address sanitization is enabled, define them to poison/unpoison
objects.

(lisp_align_malloc): Poison newly allocated blocks on `free_ablock',
unpoison ablocks taken from it respectively.
(lisp_align_free): Poison individual ablocks when they are put on the
free list, unpoison them when an entire `ablocks' chunk is being
freed.

(make_interval): Poison interval blocks on initial allocation,
unpoison individual intervals on allocation and removal from
`interval_free_list'.
(sweep_intervals): Unpoison interval blocks before sweeping, poison
dead/unmarked intervals.

(allocate_string): Poison string blocks on initial allocation,
unpoison Lisp_Strings on removal from the free list.
(allocate_string_data): Poison `sblock' data on initial allocation,
unpoison individual `sdata' contents on allocation or removal from the
free list. Call `ASAN_PREPARE_LIVE_SDATA' on the new `sdata' struct.
(sweep_strings): Unpoison string blocks before sweeping them,
poisoning dead strings and their sdata afterwards.
(compact_small_strings): Call `ASAN_PREPARE_LIVE_DATA' on the `sdata'
to where compacted strings to moved to.
(pin_string): Call `ASAN_PREPARE_DEAD_SDATA' on `old_sdata'.

(make_float): Poison float blocks on allocation, unpoisoning
individual Lisp_Floats on allocation or removal from
`float_free_list'.
(sweep_floats): Unpoison float blocks before sweeping, poison
dead/unmarked floats.

(free_cons): Poison `ptr'.
(Fcons): Poison cons blocks on allocation, unpoisoning individual
Lisp_Cons on allocation or removal from `cons_free_list'.
(sweep_conses): Poison dead/unmarked conses.

(setup_free_list): Poison vectors put on `vector_free_lists'.
(allocate_vector_from_block): Unpoison vectors taken from the free
list, poison excess vector bytes when vectors allocated from the free
list are larger than requested.
(sweep_vectors): Unpoison vector blocks before sweeping them.

(Fmake_symbol): Poison symbol blocks on initial allocation,
unpoisoning individual Lisp_Symbols on allocation or removal from
`symbol_free_list'.
(sweep_symbols): Unpoison symbol blocks before sweeping, poisoning
dead/unmarked symbols.

(live_string_holding, live_cons_holding, live_symbol_holding)
(live_float_holding): When compiling with address sanitization and GC
poisoning enabled, return NULL if the passed address is poisoned, or
if the Lisp object it resides in is poisoned, avoiding a
use-after-poison trigger if these functions are called on a pointer
that might be referring to a now dead/swept object.

* etc/DEBUG: Add information about enabling ASan memory poisoning.

2 years agoUse equal and member instead of eq and memq
Mattias Engdegård [Fri, 16 Dec 2022 11:17:33 +0000 (12:17 +0100)]
Use equal and member instead of eq and memq

* lisp/cedet/semantic/complete.el (semantic-displayer-show-request):
* lisp/descr-text.el (describe-char-categories):
* lisp/mh-e/mh-identity.el (mh-select-identity):
* lisp/transient.el (transient--delay-post-command)
(transient--post-command):
* lisp/vc/vc-git.el (vc-git-create-tag):
* test/lisp/emacs-lisp/cl-lib-tests.el
(cl-lib-nth-value-test-multiple-values):
* lisp/emulation/viper-cmd.el (viper-preserve-cursor-color):
Use `equal` instead of `eq` and `member` instead of `memq` where
the comparison is with literals without guaranteed identity.
In some cases this change corrects evident bugs, in others it is
mostly cosmetic.

2 years agoElide broken but unnecessary `if` optimisations
Mattias Engdegård [Fri, 16 Dec 2022 14:56:04 +0000 (15:56 +0100)]
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))

2 years agoalist-get testfn argument evaluation correction
Mattias Engdegård [Fri, 16 Dec 2022 10:08:02 +0000 (11:08 +0100)]
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.

2 years ago; * test/infra/test-jobs.yml: Regenerate for the new use-package subdirectory.
Michael Albinus [Mon, 19 Dec 2022 09:23:50 +0000 (10:23 +0100)]
; * test/infra/test-jobs.yml: Regenerate for the new use-package subdirectory.

2 years agoIgnore some handlers in ange-ftp.el
Michael Albinus [Mon, 19 Dec 2022 09:23:14 +0000 (10:23 +0100)]
Ignore some handlers in ange-ftp.el

* lisp/net/ange-ftp.el: Return nil for `file-acl',
`file-notify-add-watch', `file-notify-rm-watch',
`file-notify-valid-p', `file-system-info',
`list-system-processes', `memory-info', `process-attributes',
`set-file-acl', `set-file-selinux-context'.

2 years agoImprove earlier changes to xterm.c
Po Lu [Mon, 19 Dec 2022 05:40:54 +0000 (13:40 +0800)]
Improve earlier changes to xterm.c

* etc/PROBLEMS: Update for renamed variable.
* src/xterm.c (x_make_frame_visible): Better respect
`x-lax-frame-positioning'.

2 years ago; Fix merge errors in etc/NEWS
Stefan Kangas [Mon, 19 Dec 2022 04:00:38 +0000 (05:00 +0100)]
; Fix merge errors in etc/NEWS

2 years agoMerge from origin/emacs-29
Stefan Kangas [Mon, 19 Dec 2022 03:42:19 +0000 (04:42 +0100)]
Merge from origin/emacs-29

12e26cc0c1b ; * admin/git-bisect-start: Add mistakenly ommitted commi...
9a751e0a38b ruby-mode: Support endless singleton method definitions too
ce7b7e5af3d Remove comment-start-skip preset in tree-sitter indentati...
c1e015ae320 Fix recent change in tramp-smb.el
cf1b771864a ; * etc/NEWS: Fix typos.
50d18bb6ea7 Make tramp-archive autoloads robust for older Emacs versions
3941cc29df3 ; Improve documentation of 'setopt'
6f88de109c8 ruby-mode: Support endless methods (bug#54702)
91dd893e343 ; * lisp/progmodes/sql.el (sql-product-interactive): Doc ...
138d9dc4cb0 * lisp/cus-edit.el (setopt--set): Warn instead of rasing ...
d1e0542f336 Allow customising windmove user options with an empty prefix
c2375e77914 Improve and extend admin/git-bisect-start
7cc2313eb0a Make 'rmail-summary-by-thread' faster
88e59b16cbe ; Improve documentation of installing tree-sitter and gra...
897f33bf316 Fix the MS-DOS build
660e941235d Avoid crashes in PGTK build due to signal in 'note_mouse_...
0fc5fb2d054 Fix MS-Windows build broken by recent treesit.c changes
5b2e6d04ce2 Fix wrong capture in typescript-ts-mode (bug#60167)
cb8ccdd2670 Add rust-ts-mode (Bug#60136)
9fcf764dd73 Indentation fixes for jsx/tsx (bug#60169)
69f2c71135f Fix treesit-query-validate problem with view-mode
1fc7535546c Use cursor API in treesit-node-parent
5f0286c0afa Switch to use cursor API in treesit.c
a275e436df4 Add treesit_assume_true and treesit_cursor_helper
a54c7a8df0c Remove file-exists-in-trash-p
3e02029642c Update to Org 9.6-49-g47d129
4a8ff671b0e Don’t assume make-directory handler returns nil
44c83b239d3 Fix copy-directory bug when dest dir exists
bef1edc9cac make-directory now returns t if dir already exists
8a9579ca29d Use make-directory handlers uniformly
627e7e0243d Improve documentation of 'file-exists-p'
c9015ef55ff Fix resizing of mini-windows by 'set-minibuffer-message'
5a245bc786e Prevent Abort dialogs from async-compiling jobs on Windows
4d1e4a48938 Fix 'window-max-chars-per-line' when there are no fringes
d65beb820cc ; Revert "; * lisp/subr.el (internal--with-narrowing): Si...
1c0b90e5f7d ruby-mode: Recognize instance or global var as first arg ...
3356c0cb163 Fix end-of-defun in ruby-mode

# Conflicts:
# etc/NEWS

2 years ago; Merge from origin/emacs-29
Stefan Kangas [Mon, 19 Dec 2022 03:42:18 +0000 (04:42 +0100)]
; Merge from origin/emacs-29

The following commit was skipped:

d9add661617 ; * lisp/subr.el (internal--with-narrowing): Simplify

2 years agoMerge from origin/emacs-29
Stefan Kangas [Mon, 19 Dec 2022 03:42:18 +0000 (04:42 +0100)]
Merge from origin/emacs-29

67bc96c9d94 Remove treesit-defun-prefer-top-level and friends
4f9bccef556 Add yaml-ts-mode (Bug#60105)
f9cb144d45a Fix indentation in json-ts-mode (bug#60123)
3d348c46e78 ; Handle nil ARG in treesit-beginning/end-of-defun
1a66435dda3 New input method 'cyrillic-chuvash'
b9227c502d7 ; Improve wording of 'format' doc string

2 years ago; Merge from origin/emacs-29
Stefan Kangas [Mon, 19 Dec 2022 03:42:18 +0000 (04:42 +0100)]
; Merge from origin/emacs-29

The following commit was skipped:

65b0040f9fc Backport: ; * lisp/bs.el: Small doc and whitespace fixes

2 years agoMerge from origin/emacs-29
Stefan Kangas [Mon, 19 Dec 2022 03:42:18 +0000 (04:42 +0100)]
Merge from origin/emacs-29

de2239a584a Revert "alist-get testfn argument evaluation correction"
856d889f3a8 Revert "Elide broken but unnecessary `if` optimisations"
8e42e20ed7f Revert "Use equal and member instead of eq and memq"

2 years ago; Merge from origin/emacs-29
Stefan Kangas [Mon, 19 Dec 2022 03:42:18 +0000 (04:42 +0100)]
; Merge from origin/emacs-29

The following commits were skipped:

f4b430140f0 Use equal and member instead of eq and memq
13aa376e935 Elide broken but unnecessary `if` optimisations
17d65c99cd8 alist-get testfn argument evaluation correction

2 years agoMerge from origin/emacs-29
Stefan Kangas [Mon, 19 Dec 2022 03:42:18 +0000 (04:42 +0100)]
Merge from origin/emacs-29

b01d0246d71 * lisp/term/xterm.el (xterm-function-map): Add M-SPC.  (B...
303d6ac1423 Fix moving to trash files that overwrite dangling symlink...
dc78779c0cd Fix SVG scaling (bug#59802)
10415d9651b ; Add useful hint to which-func documentation
c26ab22cf4e ; Improve doc strings of minibuffer-history commands
80f410d281c ; Fix last changes in buffer.c
f04680e067b Fix some naming issues involving query buffers in ERC
173e02f4eb4 ; Fix doc string in ERC's module-activation commands
5a9263a8725 Increment erc-debug-irc-protocol-version to 2
89f54e81576 A better fix for bug#60096
1b9ca1e5e64 ; Fix printing Lisp types in .gdbinit
7575c85efd2 Bump Eglot version to 1.10
a0806bc7ea9 Eglot: fix discrepant eglot-guess-contact/eglot-command-h...
8bf4cdcf79b Avoid recursive process filters in lisp/jsonrpc.el (bug#6...

2 years agobs.el: Use the right buffer context to compute the mode name
Juanma Barranquero [Mon, 19 Dec 2022 01:40:50 +0000 (02:40 +0100)]
bs.el: Use the right buffer context to compute the mode name

* lisp/bs.el (bs--get-mode-name): The function is already called
with the correct buffer as current-buffer; and anyway, START-BUFFER
is usually the wrong one to pass to `format-mode-line'.  This fixes
a bug introduced in 48d33090d0 and c2699583be (back in 2008-01-04).

2 years ago; * admin/git-bisect-start: Add mistakenly ommitted commits to skip
Gregory Heytings [Mon, 19 Dec 2022 01:07:16 +0000 (01:07 +0000)]
; * admin/git-bisect-start: Add mistakenly ommitted commits to skip

2 years agoruby-mode: Support endless singleton method definitions too
Dmitry Gutov [Mon, 19 Dec 2022 00:21:51 +0000 (02:21 +0200)]
ruby-mode: Support endless singleton method definitions too

* lisp/progmodes/ruby-mode.el (ruby-endless-method-head-re):
Update to match not only 'self.' but 'xyz.' as well (bug#54702).

* test/lisp/progmodes/ruby-mode-resources/ruby.rb (Bar#foo=):
Update example.

2 years agoRemove comment-start-skip preset in tree-sitter indentation engine
Yuan Fu [Sun, 18 Dec 2022 22:11:54 +0000 (14:11 -0800)]
Remove comment-start-skip preset in tree-sitter indentation engine

Comment indentation should use a adaptive-fill-based indent, rather
than comment-start-skip.

Also remove manual description of removed variables in treesit.el and
add documentation for n-p-gp upon request.

* doc/lispref/modes.texi (Parser-based Indentation)
* lisp/treesit.el (treesit-simple-indent-presets): Add n-p-gp, remove
treesit-comment-start/end, remove comment-start-skip.

* doc/lispref/parsing.texi (Tree-sitter major modes): Remove
treesit-comment-start/end.

2 years agoImprove rename-file fix (bug#34069)
Paul Eggert [Sun, 18 Dec 2022 20:57:57 +0000 (12:57 -0800)]
Improve rename-file fix (bug#34069)

* src/fileio.c (Frename_file): No need for a special case to
rename a fifo, since we already tried and failed to rename it.
Also improve symlink handling, in that if readlink fails report an
error rather than trying to treat the link as a regular file.

2 years agoDon’t hang when copying FIFOs
Paul Eggert [Sun, 18 Dec 2022 19:45:06 +0000 (11:45 -0800)]
Don’t hang when copying FIFOs

* src/fileio.c (Fcopy_file): Open the input file with O_NONBLOCK.
This prevents a hang if the input file is a FIFO.
If it’s a regular file O_NONBLOCK has no effect;
otherwise the file is soon rejected anyway.

2 years agoFix recent change in tramp-smb.el
Michael Albinus [Sun, 18 Dec 2022 19:17:06 +0000 (20:17 +0100)]
Fix recent change in tramp-smb.el

* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Ignore `make-directory-internal'.
(tramp-smb-handle-make-directory): Move implementation from
`tramp-smb-handle-make-directory-internal' here.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Rearrange `make-directory-internal'.

2 years ago; Fix calls to treesit functions
Eli Zaretskii [Sun, 18 Dec 2022 17:13:10 +0000 (19:13 +0200)]
; Fix calls to treesit functions

* lisp/progmodes/prog-mode.el (treesit-available-p): Declare.
(prog-fill-reindent-defun): Only call treesit.c functions if
treesit-available-p returns non-nil.  Reported by Eduardo Ochs
<eduardoochs@gmail.com>.

2 years ago; * etc/NEWS: Fix typos.
Michael Albinus [Sun, 18 Dec 2022 15:43:05 +0000 (16:43 +0100)]
; * etc/NEWS: Fix typos.

2 years agoMake tramp-archive autoloads robust for older Emacs versions
Michael Albinus [Sun, 18 Dec 2022 15:42:51 +0000 (16:42 +0100)]
Make tramp-archive autoloads robust for older Emacs versions

* lisp/net/tramp-archive.el (tramp-archive-file-name-regexp):
Use `eval-when-compile'.  Set it explicitly for older Emacs versions.

2 years agoSuppress memql warning in test
Mattias Engdegård [Sat, 17 Dec 2022 18:13:13 +0000 (19:13 +0100)]
Suppress memql warning in test

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-adjoin-test):
Suppress warning about `memql` argument inside expansion of
`cl-adjoin`.

2 years agoWarn about lambda expressions in comparisons
Mattias Engdegård [Sat, 17 Dec 2022 13:48:34 +0000 (14:48 +0100)]
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.

2 years agoFix compiler macro expansion bug
Mattias Engdegård [Sat, 17 Dec 2022 17:20:48 +0000 (18:20 +0100)]
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.

2 years ago; lisp/progmodes/verilog-mode.el: Collected updates from verilog-mode upstream.
Wilson Snyder [Sun, 18 Dec 2022 13:35:12 +0000 (08:35 -0500)]
; lisp/progmodes/verilog-mode.el: Collected updates from verilog-mode upstream.

* lisp/progmodes/verilog-mode.el (verilog-align-typedef-regexp):
Fix defcustom type to allow nil.
(verilog-at-constraint-p)
(verilog-cparenexp-indent-level, verilog-typedef-enum-re): Fix
test-custom-opts issues.

Co-authored-by: Mattias Engdegård <mattiase@acm.org>
2 years ago; Improve documentation of 'setopt'
Eli Zaretskii [Sun, 18 Dec 2022 12:26:54 +0000 (14:26 +0200)]
; Improve documentation of 'setopt'

* doc/lispref/variables.texi (Setting Variables): Note about the
differences between 'setopt' and 'customize-set-variable'.

2 years agoruby-mode: Support endless methods (bug#54702)
Dmitry Gutov [Sun, 18 Dec 2022 12:01:47 +0000 (14:01 +0200)]
ruby-mode: Support endless methods (bug#54702)

* lisp/progmodes/ruby-mode.el (ruby-endless-method-head-re):
New constant.
(ruby-smie-grammar): New token.
(ruby-smie--forward-token, ruby-smie--backward-token):
Recognize it.
(ruby-smie-rules): Indentation support.
(ruby-add-log-current-method): Support here too.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-after-endless-method): New test.

* test/lisp/progmodes/ruby-mode-resources/ruby.rb: New examples.

2 years ago; * lisp/progmodes/sql.el (sql-product-interactive): Doc fix (bug#60175)
Eli Zaretskii [Sun, 18 Dec 2022 11:54:43 +0000 (13:54 +0200)]
; * lisp/progmodes/sql.el (sql-product-interactive): Doc fix (bug#60175)

2 years ago* lisp/cus-edit.el (setopt--set): Warn instead of rasing an error
Philip Kaludercic [Sat, 17 Dec 2022 16:29:24 +0000 (17:29 +0100)]
* lisp/cus-edit.el (setopt--set): Warn instead of rasing an error

(Bug#60162)

2 years agoAllow customising windmove user options with an empty prefix
Philip Kaludercic [Sat, 17 Dec 2022 14:54:40 +0000 (15:54 +0100)]
Allow customising windmove user options with an empty prefix

* lisp/windmove.el (windmove--default-keybindings-type): Handle nil
as a prefix value.  (Bug#60161)

2 years agoImprove and extend admin/git-bisect-start
Gregory Heytings [Sun, 18 Dec 2022 10:46:48 +0000 (10:46 +0000)]
Improve and extend admin/git-bisect-start

* admin/git-bisect-start: Use 'git bisect skip' instead of 'git
bisect good' for merges of external trees, which is equivalent but
faster in some cases.  Improve the explanation on external tree
merges.  Add list of commits in the last six years on which
building Emacs fails, and call 'git bisect skip' on them.  Also
document how the script can be called automatically when 'git
bisect start' is called in the Emacs repository.

* admin/notes/repo (Bisecting): Adapt the explanation of the
script accordingly.

2 years agoMake 'rmail-summary-by-thread' faster
Andrea Monaco [Fri, 9 Dec 2022 20:22:22 +0000 (21:22 +0100)]
Make 'rmail-summary-by-thread' faster

* lisp/mail/rmailsum.el (rmail-summary-message-parents-vector)
(rmail-summary-message-descendants-vector): Doc fixes.
(rmail-summary-message-descendants-vector): New variable.
(rmail-summary-fill-message-parents-and-descs-vectors): Renamed
from 'rmail-summary-fill-message-parents-vector' and rewritten.
(rmail-summary-direct-descendants): Function deleted.

2 years ago; Improve documentation of installing tree-sitter and grammars.
Eli Zaretskii [Sun, 18 Dec 2022 10:08:22 +0000 (12:08 +0200)]
; Improve documentation of installing tree-sitter and grammars.

* etc/NEWS: Enhance tree-sitter sections wrt grammar libraries.

2 years agoFix the MS-DOS build
Po Lu [Sun, 18 Dec 2022 10:05:57 +0000 (18:05 +0800)]
Fix the MS-DOS build

* src/lread.c (syms_of_lread): Make the MS-DOS build work again.

2 years agoAvoid crashes in PGTK build due to signal in 'note_mouse_highlight'
Eli Zaretskii [Sun, 18 Dec 2022 08:29:34 +0000 (10:29 +0200)]
Avoid crashes in PGTK build due to signal in 'note_mouse_highlight'

* src/xdisp.c (string_buffer_position): Make sure the TO argument
of 'string_buffer_position_lim' is always inside [BEGV..ZV].
Otherwise 'string_buffer_position_lim' might call
'get-char-property' and friends with invalid position, which will
just signal an error and do nothing useful.  (Bug#60144)

2 years agoRemove Gnulib explicit_bzero module
Paul Eggert [Sun, 18 Dec 2022 08:21:30 +0000 (00:21 -0800)]
Remove Gnulib explicit_bzero module

It’s no longer needed, as it is now merely a thin layer around
C23-style memset_explicit and we might as well just call the
C23 standard function; that’s more forward-looking.
* admin/merge-gnulib (GNULIB_MODULES):
Remove explicit_bzero, and add memset_explicit.
* lib/explicit_bzero.c, m4/explicit_bzero.m4:
Remove these files, which were copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/gnutls.c (gnutls_symmetric_aead):
Use memset_explicit instead of explicit_bzero.

2 years agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sun, 18 Dec 2022 07:11:55 +0000 (23:11 -0800)]
Update from Gnulib by running admin/merge-gnulib

2 years agoPort better to glibc 2.28+ renameat2
Paul Eggert [Sun, 18 Dec 2022 05:40:02 +0000 (21:40 -0800)]
Port better to glibc 2.28+ renameat2

* configure.ac: Check for renameat2.
* src/sysdep.c (renameat_noreplace): Prefer renameat2 (supplied by
glibc 2.28 and later) to doing the syscall by hand.

2 years agoFix MS-Windows build broken by recent treesit.c changes
Eli Zaretskii [Sun, 18 Dec 2022 05:57:34 +0000 (07:57 +0200)]
Fix MS-Windows build broken by recent treesit.c changes

* src/treesit.c (init_treesit_functions, ts_tree_cursor_copy)
(ts_tree_cursor_delete): Add boilerplate for using new tree-sitter
functions.
(ts_node_parent): Delete boilerplate of unused function.

2 years agoFix wrong capture in typescript-ts-mode (bug#60167)
Theodor Thornhill [Sat, 17 Dec 2022 19:07:59 +0000 (20:07 +0100)]
Fix wrong capture in typescript-ts-mode (bug#60167)

An example of the issue could be:

    <Menu.Item>
        {({ active }) => (
          link
            ? <Link to={link}> {text}</Link>
            : <a href="#" onClick={onClick}>{text}</a>
        )}
    </Menu.Item>

Here 'link' as well as a lot of the other constructs inside of the
parenthesized expression will be font-locked with
'font-lock-variable-name-face'.  We only want to capture the
identifier.

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Make the variable capture
only capture the identifier, and not the whole expression.

2 years agoAdd rust-ts-mode (Bug#60136)
Randy Taylor [Fri, 16 Dec 2022 21:05:29 +0000 (16:05 -0500)]
Add rust-ts-mode (Bug#60136)

* etc/NEWS: Mention it.
* lisp/progmodes/eglot.el (eglot-server-programs): Add it.
* lisp/progmodes/rust-ts-mode.el: New major mode with
tree-sitter support.

2 years agoIndentation fixes for jsx/tsx (bug#60169)
Theodor Thornhill [Sat, 17 Dec 2022 22:11:57 +0000 (23:11 +0100)]
Indentation fixes for jsx/tsx (bug#60169)

* lisp/progmodes/js.el (js--treesit-indent-rules): Simplify the rules.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Simplify the rules.

2 years agoFix treesit-query-validate problem with view-mode
Theodor Thornhill [Sat, 17 Dec 2022 19:23:02 +0000 (20:23 +0100)]
Fix treesit-query-validate problem with view-mode

* lisp/treesit.el (treesit-query-validate): Move the (view-mode) into
the correct scope.

2 years agoUse cursor API in treesit-node-parent
Yuan Fu [Sat, 17 Dec 2022 23:14:02 +0000 (15:14 -0800)]
Use cursor API in treesit-node-parent

This is the last part of the change that fixes bug#60054.  The
previous change fixes it for searching functions, this fixes for
treesit-node-parent.

* src/treesit.c (Ftreesit_node_parent): Use the new cursor API.

2 years agoSwitch to use cursor API in treesit.c
Yuan Fu [Sat, 17 Dec 2022 23:01:57 +0000 (15:01 -0800)]
Switch to use cursor API in treesit.c

ts_node_parent has bugs (bug#60054), using cursor API avoids that.
Tree-sitter's author might remove ts_node_parent in the future, so
might as well switch to use cursors now.  We are basically
reimplementing some of the logic of ts_node_prev_sibling and
ts_node_parent in the sibling helper and cursor helper functions.

See also https://github.com/tree-sitter/tree-sitter/issues/1992

* src/treesit.c (treesit_traverse_sibling_helper)
(treesit_traverse_child_helper)
(treesit_traverse_match_predicate): Reimplemented to use the cursor API.
(treesit_search_dfs)
(treesit_search_forward): Use the new cursor helper functions.
(Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree): Use cursors.

* test/src/treesit-tests.el (treesit-search-subtree): New test.
(treesit--ert-search-setup): New macro.
(treesit-search-forward)
(treesit-search-forward-named-only)
(treesit-search-backward)
(treesit-search-backward-named-only)
(treesit-cursor-helper-with-missing-node): New tests.

2 years agoAdd treesit_assume_true and treesit_cursor_helper
Yuan Fu [Sat, 17 Dec 2022 22:59:01 +0000 (14:59 -0800)]
Add treesit_assume_true and treesit_cursor_helper

This is part 1 of the change to change node API to cursor API.  See
the second part for more detail.  (I splitted the change to make the
diff more sane.)

* src/treesit.c (treesit_assume_true)
(treesit_cursor_helper): New functions.

2 years agoRemove file-exists-in-trash-p
Paul Eggert [Sat, 17 Dec 2022 22:41:48 +0000 (14:41 -0800)]
Remove file-exists-in-trash-p

* lisp/files.el (file-exists-in-trash-p): Remove, as this name is
not suitable for users.  All uses replaced by file-attributes,
which is good enough here.

2 years agoUpdate to Org 9.6-49-g47d129
Kyle Meyer [Sat, 17 Dec 2022 22:18:40 +0000 (17:18 -0500)]
Update to Org 9.6-49-g47d129

2 years agoDon’t assume make-directory handler returns nil
Paul Eggert [Sat, 17 Dec 2022 22:09:03 +0000 (14:09 -0800)]
Don’t assume make-directory handler returns nil

* lisp/files.el (make-directory): Ignore what the make-directory
handler returns, as its return value was not documented in Emacs 28.

2 years agoFix copy-directory bug when dest dir exists
Paul Eggert [Sat, 17 Dec 2022 20:15:30 +0000 (12:15 -0800)]
Fix copy-directory bug when dest dir exists

* lisp/files.el (copy-directory): Set ‘follow’ depending on
whether we made the directory, not based on a guess that is
sometimes wrong.  When NEWNAME is a directory name and
COPY-CONTENTS is nil, do not object merely because the adjusted
NEWNAME is already a directory.  (Bug#58919).
* test/lisp/files-tests.el (files-tests-copy-directory):
Test for the bug.

2 years agomake-directory now returns t if dir already exists
Paul Eggert [Sat, 17 Dec 2022 20:15:30 +0000 (12:15 -0800)]
make-directory now returns t if dir already exists

This new feature will help fix a copy-directory bug (Bug#58919).
Its implementation does not rely on make-directory handlers
supporting the new feature, as it no longer uses a make-directory
handler H in any way other than (funcall H DIR), thus using
only the intersection of the old and new behavior for handlers.
This will give us time to fix handlers at our leisure.
* lisp/files.el (files--ensure-directory): New arg MKDIR.
All uses changed.
(files--ensure-directory, make-directory):
Return non-nil if DIR is already a directory.  All uses changed.
* test/lisp/files-tests.el (files-tests-make-directory):
Test new return-value convention.

2 years agoUse make-directory handlers uniformly
Paul Eggert [Sat, 17 Dec 2022 20:15:30 +0000 (12:15 -0800)]
Use make-directory handlers uniformly

Formerly, the code supported both make-directory and
make-directory-internal handlers. This led to confusion and meant than
in a few cases (nnmaildir, ido) remote directories could not be used in
some cases.  Fix this by using only make-directory handlers.

Perhaps there used to be a reason for why there were both
make-directory and make-directory-internal handlers, but whatever that
reason was, it seems to have vanished even before now.

There is no longer any need for make-directory-internal handlers, as
the few remaining callers that use make-directory-internal do so only
when there are no handlers.  However, this change keeps the existing
make-directory-internal handlers for now, in case this code is ever
used in older Emacs versions that still call those handlers.

* lisp/gnus/nnmaildir.el (nnmaildir--mkdir):
* lisp/ido.el (ido-file-internal):
* lisp/net/tramp-smb.el (tramp-smb-handle-make-directory):
Use make-directory, not make-directory-internal.
* lisp/net/tramp-smb.el (tramp-smb-handle-make-directory-internal):
Now obsolete.
* src/fileio.c (Fmake_directory_internal): Do not look for or
use a make-directory-internal handler.
* test/lisp/files-tests.el:
(files-tests-file-name-non-special-make-directory-internal):
Remove, as this test incorrectly assumes that make-directory-internal
must support handlers.

2 years agoImprove documentation of 'file-exists-p'
Eli Zaretskii [Sat, 17 Dec 2022 20:14:40 +0000 (22:14 +0200)]
Improve documentation of 'file-exists-p'

* doc/lispref/files.texi (Testing Accessibility): Document better
how to test for existing dangling symlinks.  (Bug#60146)

2 years ago; lisp/progmodes/verilog-mode.el: Collected updates from verilog-mode upstream.
Wilson Snyder [Sat, 17 Dec 2022 20:00:34 +0000 (15:00 -0500)]
; lisp/progmodes/verilog-mode.el: Collected updates from verilog-mode upstream.

* lisp/progmodes/verilog-mode.el (verilog-beg-block-re-ordered)
(verilog-forward-sexp, verilog-leap-to-head): Support of hideshow
for ifdef/ifndef blocks (#1819).
(verilog-cparenexp-indent-level): Improve multiline indentation
with verilog-indent-lists set to nil.  Indent uvm statements and
system tasks and functions according to the argument position in
the parenthesized expression.
(verilog-extended-complete-re): Fix verilog-beg-of-statement on
local methods.
(verilog-beg-of-statement): Fix indentation of properties inside
ifdef (#1817).
(verilog-declaration-varname-matcher, verilog-fontify-variables):
Add option to enable/disable variable fontification.
(verilog-declaration-varname-matcher): Fix bug in highlighting of
vars on func/task arguments.
(verilog-mark-defun): Fix behavior of verilog-mark-defun (#1805).
(verilog-pretty-declarations): Add support to align
declarations/expressions within the region (#1806).
(verilog-align-typedef-regexp, verilog-align-typedef-words): Add
support for alignment of user defined types (#1803).
(verilog-pretty-declarations): Limit alignment of members of a
struct to consecutive valid declarations.
(verilog-typedef-enum-re): Update minor bug in typedef enum regex.
(verilog-indent-declaration): Fix compiler warning on
verilog-indent-declaration.
(verilog-batch-error-wrapper) (verilog-warn-error,
verilog-warn-fatal) (verilog-warn-fatal-internal): Make
`verilog-warn-fatal' safe for local variables (#1799).  Reported
by Rich-Cloutier.
(verilog-align-comment-distance, verilog-align-comments)
(verilog-align-decl-expr-comments)
(verilog-align-declaration-comments): Support alignment of
parameter/localparam expressions.  Support for expression
alignment in parameter lists.  Support declaration/expression
alignment of 'type' parameters.  Support alignment of inline
comments after `verilog-pretty-expr'.  Alignment of expressions
that do not have blanks before/after operator char Fix on
functions that did not work as expected for this use case.  Use
markers in verilog-pretty-expr to avoid bugs while iterating.
(verilog-pretty-expr): Fix bug in alignment of expressions
(#1797).
(verilog-cparenexp-indent-level): Improve indentation of defun
parameters when indent-lists is nil (#1795).
(verilog-align-assign-expr): Add support to align expressions of
continuous assignments (#1793).
(verilog-pretty-expr): Fix bug in boundaries of
verilog-pretty-expr (#1792) and prevent verilog-pretty-expr from
executing on multiline assignments
(verilog-do-indent): Fix indentation of assignments and enums with
indent-lists nil (#1790).
(verilog-do-indent): Fix alignment of structs and enums
(#1789).
(verilog-backward-sexp, verilog-forward-sexp): Add precedence to
paren expressions for sexp funcs navigation (#1788).
(verilog-declaration-varname-matcher): Fix fontifying of variable
names and overriding of keywords (#1787).
(verilog-do-indent): Fix indentation of paren expr if
verilog-indent-lists is nil (#1785).
(verilog-backward-ws&directives): Fix indentation after double
comment (#1784).
(verilog-beg-of-statement-1): Fix indentation of instances and
declarations right after 'begin' (#1782).
(verilog-declaration-comments-distance): Add variable to adjust
aligned comment distance in declarations
(#1779).
(verilog-indent-ignore-multiline-defines): Add indentation ignore
of multiline defines and custom regexps (#1778).
(verilog-align-declaration-comments): Add support to align
comments in declarations (#1775).
(verilog-pretty-declarations): Fix alignment of user types on
ports declarations.
(verilog-do-indent): Fix indentation of virtual, protected and
static class methods when verilog-indent-lists is nil.
(verilog-get-lineup-indent, verilog-pretty-declarations): Fix
alignment of first port declaration (#1167) (#1771).
(verilog-pretty-declarations): Fix alignment of declaration of
interfaces with modports (#636) (#1770).
(verilog-do-indent): Add `verilog-indent-class-inside-pkg' and fix
indentation of classes inside packages (#286) (#1769).  Reported
by Gonzalo Larumbe.
(verilog-backward-sexp, verilog-forward-sexp)
(verilog-leap-to-class-head, verilog-leap-to-head): Fix
indentation after interface class (#1047) (#1768). Reported by
Gonzalo Larumbe.
(verilog-do-indent): Fix indentation if verilog-indent-lists is
nil (#1703) (#1767). Reported by Gonzalo Larumbe.
(verilog-do-indent): Fix indentation of coverpoints (#1321)
(#1766).
(verilog-backward-sexp, verilog-forward-sexp)
(verilog-leap-to-head): Fix bug in forward-sexp and backward-sexp
for some constructs (#1765) Reported by Gonzalo Larumbe.

2 years agoFix resizing of mini-windows by 'set-minibuffer-message'
Eli Zaretskii [Sat, 17 Dec 2022 18:43:56 +0000 (20:43 +0200)]
Fix resizing of mini-windows by 'set-minibuffer-message'

* src/xdisp.c (redisplay_window): Always resize mini-windows
displaying the active minibuffer.  (Bug#60015)

2 years agoPrevent Abort dialogs from async-compiling jobs on Windows
Eli Zaretskii [Sat, 17 Dec 2022 18:35:11 +0000 (20:35 +0200)]
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.

2 years agoFix 'window-max-chars-per-line' when there are no fringes
Eli Zaretskii [Sat, 17 Dec 2022 12:04:14 +0000 (14:04 +0200)]
Fix 'window-max-chars-per-line' when there are no fringes

* lisp/window.el (window-max-chars-per-line): Fix the way we
account for the fringes by calling 'window-fringes'.  (Bug#59963)

2 years ago; * src/xterm.c (x_send_scroll_bar_event): Remove unused variables.
Eli Zaretskii [Sat, 17 Dec 2022 11:41:57 +0000 (13:41 +0200)]
; * src/xterm.c (x_send_scroll_bar_event): Remove unused variables.

2 years ago; * lisp/subr.el (internal--with-narrowing): Simplify
Philip Kaludercic [Fri, 16 Dec 2022 23:11:46 +0000 (00:11 +0100)]
; * lisp/subr.el (internal--with-narrowing): Simplify

(Bug#60130)

2 years ago* lisp/emacs-lisp/package.el (package-report-bug): Autoload it.
Philip Kaludercic [Tue, 29 Nov 2022 21:38:18 +0000 (22:38 +0100)]
* lisp/emacs-lisp/package.el (package-report-bug): Autoload it.

2 years agoMinor improvements to frame synchronization
Po Lu [Sat, 17 Dec 2022 08:22:59 +0000 (16:22 +0800)]
Minor improvements to frame synchronization

* src/xterm.c (x_sync_wait_for_frame_drawn_event): Update
compositor bypass property if frame synchronization is being
disabled.

2 years ago; Revert "; * lisp/subr.el (internal--with-narrowing): Simplify"
Eli Zaretskii [Sat, 17 Dec 2022 07:49:43 +0000 (09:49 +0200)]
; Revert "; * lisp/subr.el (internal--with-narrowing): Simplify"

This reverts commit d9add661617dfba491465943d402230699a9a4ff.

Please install on the release branch only changes that fix
incorrect behavior.  Cleanups don't belong here.

2 years ago; * lib-src/etags.c (do_move_file): Fix coding style.
Po Lu [Sat, 17 Dec 2022 01:49:08 +0000 (09:49 +0800)]
; * lib-src/etags.c (do_move_file): Fix coding style.

2 years agoruby-mode: Recognize instance or global var as first arg in parenless call
Dmitry Gutov [Sat, 17 Dec 2022 01:30:52 +0000 (03:30 +0200)]
ruby-mode: Recognize instance or global var as first arg in parenless call

* lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p):
Recognize instance or global var as first arg in parenless call.

* test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add example.

2 years agoFix end-of-defun in ruby-mode
Dmitry Gutov [Sat, 17 Dec 2022 01:13:29 +0000 (03:13 +0200)]
Fix end-of-defun in ruby-mode

* lisp/progmodes/ruby-mode.el (ruby-beginning-of-defun):
Return t in case of success.

2 years ago; * lisp/subr.el (internal--with-narrowing): Simplify
Philip Kaludercic [Fri, 16 Dec 2022 23:11:46 +0000 (00:11 +0100)]
; * lisp/subr.el (internal--with-narrowing): Simplify

(Bug#60130)

2 years agoRemove treesit-defun-prefer-top-level and friends
Yuan Fu [Fri, 16 Dec 2022 23:04:32 +0000 (15:04 -0800)]
Remove treesit-defun-prefer-top-level and friends

Because they are not used anymore, after the new defun navigation is
installed.

* lisp/treesit.el (treesit-defun-prefer-top-level)
(treesit--defun-maybe-top-level): Remove.

2 years agoAdd yaml-ts-mode (Bug#60105)
Randy Taylor [Tue, 13 Dec 2022 14:41:01 +0000 (09:41 -0500)]
Add yaml-ts-mode (Bug#60105)

* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add yaml support.
* etc/NEWS: Mention it.
* lisp/textmodes/yaml-ts-mode.el: New major mode with
tree-sitter support.
* lisp/progmodes/eglot.el (eglot-server-programs): Add it.

2 years agoFix indentation in json-ts-mode (bug#60123)
Jostein Kjønigsen [Fri, 16 Dec 2022 15:01:41 +0000 (16:01 +0100)]
Fix indentation in json-ts-mode (bug#60123)

* lisp/progmodes/json-ts-mode.el
(json-ts--indent-rules): Add indentation rules for arrays.

2 years ago; Handle nil ARG in treesit-beginning/end-of-defun
Yuan Fu [Fri, 16 Dec 2022 05:23:20 +0000 (21:23 -0800)]
; Handle nil ARG in treesit-beginning/end-of-defun

* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Handle nil ARG.

2 years agoNew input method 'cyrillic-chuvash'
Eli Zaretskii [Fri, 16 Dec 2022 20:05:52 +0000 (22:05 +0200)]
New input method 'cyrillic-chuvash'

* lisp/leim/quail/cyrillic.el ("cyrillic-chuvash"): New input
method, contributed by flashymittens@tutanota.com.  (Bug#60023)

Copyright-paperwork-exempt: yes

2 years ago; Improve wording of 'format' doc string
Eli Zaretskii [Fri, 16 Dec 2022 18:46:00 +0000 (20:46 +0200)]
; Improve wording of 'format' doc string

* src/editfns.c (Fformat): Use "produce" instead of "print".
(Bug#60125)

2 years agoUse equal and member instead of eq and memq
Mattias Engdegård [Fri, 16 Dec 2022 11:17:33 +0000 (12:17 +0100)]
Use equal and member instead of eq and memq

* lisp/cedet/semantic/complete.el (semantic-displayer-show-request):
* lisp/descr-text.el (describe-char-categories):
* lisp/mh-e/mh-identity.el (mh-select-identity):
* lisp/transient.el (transient--delay-post-command)
(transient--post-command):
* lisp/vc/vc-git.el (vc-git-create-tag):
* test/lisp/emacs-lisp/cl-lib-tests.el
(cl-lib-nth-value-test-multiple-values):
* lisp/emulation/viper-cmd.el (viper-preserve-cursor-color):
Use `equal` instead of `eq` and `member` instead of `memq` where
the comparison is with literals without guaranteed identity.
In some cases this change corrects evident bugs, in others it is
mostly cosmetic.

2 years agoElide broken but unnecessary `if` optimisations
Mattias Engdegård [Fri, 16 Dec 2022 14:56:04 +0000 (15:56 +0100)]
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))

2 years agoalist-get testfn argument evaluation correction
Mattias Engdegård [Fri, 16 Dec 2022 10:08:02 +0000 (11:08 +0100)]
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.

2 years agoBackport: ; * lisp/bs.el: Small doc and whitespace fixes
Juanma Barranquero [Fri, 16 Dec 2022 17:36:42 +0000 (18:36 +0100)]
Backport: ; * lisp/bs.el: Small doc and whitespace fixes

(cherry picked from commit 8624734504af4572525665c713a47e1b6f439a2c)

2 years ago; * lisp/bs.el: Small doc and whitespace fixes
Juanma Barranquero [Fri, 16 Dec 2022 17:36:42 +0000 (18:36 +0100)]
; * lisp/bs.el: Small doc and whitespace fixes

2 years agoRevert "alist-get testfn argument evaluation correction"
Eli Zaretskii [Fri, 16 Dec 2022 17:29:30 +0000 (19:29 +0200)]
Revert "alist-get testfn argument evaluation correction"

This reverts commit 17d65c99cd812e085d85f790c83ec0d540490a55.

Please don't install unnecessary improvements on the release
branch.

2 years agoRevert "Elide broken but unnecessary `if` optimisations"
Eli Zaretskii [Fri, 16 Dec 2022 17:27:33 +0000 (19:27 +0200)]
Revert "Elide broken but unnecessary `if` optimisations"

This reverts commit 13aa376e93564a8cf2ddbbcf0968c6666620db89.

Please don't install anything on the release branch that is
not a clear bugfix for a known bug.

2 years agoRevert "Use equal and member instead of eq and memq"
Eli Zaretskii [Fri, 16 Dec 2022 17:25:45 +0000 (19:25 +0200)]
Revert "Use equal and member instead of eq and memq"

This reverts commit f4b430140f0866f98bbf18b7094348dc64032813.

Please don't install anything on the release branch that is not
strictly necessary fro Emacs 29.

2 years agoNew option for selecting symbols by double-clicking
Eli Zaretskii [Fri, 16 Dec 2022 16:26:14 +0000 (18:26 +0200)]
New option for selecting symbols by double-clicking

* lisp/mouse.el (mouse-1-double-click-prefer-symbols): New user
option.
(mouse-skip-word): If 'mouse-1-double-click-prefer-symbols' is
non-nil, skip over the entire symbol at point.  (Bug#60080)

2 years agoUse equal and member instead of eq and memq
Mattias Engdegård [Fri, 16 Dec 2022 11:17:33 +0000 (12:17 +0100)]
Use equal and member instead of eq and memq

* lisp/cedet/semantic/complete.el (semantic-displayer-show-request):
* lisp/descr-text.el (describe-char-categories):
* lisp/mh-e/mh-identity.el (mh-select-identity):
* lisp/transient.el (transient--delay-post-command)
(transient--post-command):
* lisp/vc/vc-git.el (vc-git-create-tag):
* test/lisp/emacs-lisp/cl-lib-tests.el
(cl-lib-nth-value-test-multiple-values):
* lisp/emulation/viper-cmd.el (viper-preserve-cursor-color):
Use `equal` instead of `eq` and `member` instead of `memq` where
the comparison is with literals without guaranteed identity.
In some cases this change corrects evident bugs, in others it is
mostly cosmetic.

2 years agoClosures are always non-nil
Mattias Engdegård [Thu, 15 Dec 2022 10:22:06 +0000 (11:22 +0100)]
Closures are always non-nil

* lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp):
Treat closures as true in boolean context.

2 years agoElide broken but unnecessary `if` optimisations
Mattias Engdegård [Fri, 16 Dec 2022 14:56:04 +0000 (15:56 +0100)]
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))

2 years agoalist-get testfn argument evaluation correction
Mattias Engdegård [Fri, 16 Dec 2022 10:08:02 +0000 (11:08 +0100)]
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.

2 years ago* lisp/term/xterm.el (xterm-function-map): Add M-SPC. (Bug#60077)
Eli Zaretskii [Fri, 16 Dec 2022 16:02:57 +0000 (18:02 +0200)]
* lisp/term/xterm.el (xterm-function-map): Add M-SPC.  (Bug#60077)