]> git.eshelyaron.com Git - emacs.git/log
emacs.git
22 months agovc-git-checkin: Stash other staged changes
Sean Whitton [Fri, 23 Dec 2022 03:54:08 +0000 (20:54 -0700)]
vc-git-checkin: Stash other staged changes

* lisp/vc/vc-git.el (vc-git--stash-staged-changes): New function.
(vc-git-checkin): Use new function to avoid needing to unstage changes
unrelated to the patch we want to commit (bug#60126).

22 months ago; Fix typos
Stefan Kangas [Fri, 23 Dec 2022 17:21:10 +0000 (18:21 +0100)]
; Fix typos

22 months agoSpeed up completion plugins over slow networks
Po Lu [Fri, 23 Dec 2022 10:05:44 +0000 (18:05 +0800)]
Speed up completion plugins over slow networks

* src/xterm.c (x_make_frame_invisible): Do not sync if
`x-lax-frame-positioning' is enabled.
(syms_of_xterm): Update doc string.

22 months agoLeap seconds are planned to go away by the year 2035.
Paul Eggert [Fri, 23 Dec 2022 06:40:23 +0000 (22:40 -0800)]
Leap seconds are planned to go away by the year 2035.

22 months ago; Merge from origin/emacs-29
Stefan Kangas [Fri, 23 Dec 2022 05:30:12 +0000 (06:30 +0100)]
; Merge from origin/emacs-29

The following commits were skipped:

5a34e7c86ca ; * admin/notes/git-workflow: Adding "Backport:" is optio...
baaa9f42e57 vc-git-checkin: Don't try to apply an empty patch

22 months agoMerge from origin/emacs-29
Stefan Kangas [Fri, 23 Dec 2022 05:30:12 +0000 (06:30 +0100)]
Merge from origin/emacs-29

0754173c923 ; Fix docstring
014232d3840 Eglot: eglot--servers-by-xrefed-file doesn't need to be v...
bbe35c280c2 Prevent stale servers when using eglot-extend-to-xref
9bf13a3fb9e ; * src/alloc.c (Fmemory_info): Doc fix.
baa33a5c054 * etc/tutorials/TUTORIAL.cn: Fix typos.  (Bug#60221)
98d7f76b451 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
a488a6870ac Add alias for removed font-lock function
02e046566e2 Set beginning/end-of-defun-function in treesit-major-mode...
7dea58b88db Add treesit-defun-at-point and fix c-ts-mode-indent-defun
69123d4aa4e ; Fix treesit--defuns-around
05d8310fb5d Use the new keyword ':repeat' in repeatable keymaps.

22 months ago; * admin/notes/git-workflow: Adding "Backport:" is optional.
Sean Whitton [Thu, 22 Dec 2022 20:38:48 +0000 (13:38 -0700)]
; * admin/notes/git-workflow: Adding "Backport:" is optional.

22 months 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.

(cherry picked from commit 1424342225ef5b18c630364dd88e004f4ebb1c7f)

22 months agoSimplify handling of /dev/null redirection in Eshell
Jim Porter [Tue, 20 Dec 2022 21:47:20 +0000 (13:47 -0800)]
Simplify handling of /dev/null redirection in Eshell

This also fixes an issue where "echo hi > foo > /dev/null" didn't
write to the file "foo".  (Note that users can still use their
system's null device name when redirecting; Eshell doesn't need to do
anything special to support that.)

* lisp/eshell/esh-io.el (eshell-virtual-targets): Add "/dev/null".
(eshell-set-output-handle): Handle 'eshell-null-device'.

* test/lisp/eshell/esh-io-tests.el
(esh-io-test/redirect-subcommands/dev-null)
(esh-io-test/virtual/dev-null, esh-io-test/virtual/dev-null/multiple):
New tests.

22 months agoFix handling of output handles in nested Eshell forms
Jim Porter [Tue, 20 Dec 2022 17:39:07 +0000 (09:39 -0800)]
Fix handling of output handles in nested Eshell forms

Previously, the output handles in nested forms would be reset to the
default, leading to wrong behavior for commands like

  {echo a; echo b} > file

"b" would be written to "file" as expected, but "a" would go to
standard output (bug#59545).

* lisp/eshell/esh-cmd.el (eshell-parse-command): Use
'eshell-with-copied-handles' for each statement within the whole
Eshell command.

* test/lisp/eshell/esh-io-tests.el (esh-io-test/redirect-subcommands)
(esh-io-test/redirect-subcommands/override)
(esh-io-test/redirect-subcommands/interpolated): New tests.

* test/lisp/eshell/em-script-tests.el
(em-script-test/source-script/redirect)
(em-script-test/source-script/redirect/dev-null): New tests.
(em-script-test/source-script, em-script-test/source-script/arg-vars)
(em-script-test/source-script/all-args-var): Tweak names/docstrings.

* test/lisp/eshell/em-extpipe-tests.el (em-extpipe-tests--deftest):
Skip over the newly-added 'eshell-with-copied-handles' form when
checking the parse results.

* test/lisp/eshell/em-tramp-tests.el (em-tramp-test/su-default)
(em-tramp-test/su-user, em-tramp-test/su-login)
(em-tramp-test/sudo-shell, em-tramp-test/sudo-user-shell)
(em-tramp-test/doas-shell, em-tramp-test/doas-user-shell): Update
expected command forms.

22 months agoAdd 'eshell-duplicate-handles' to return a copy of file handles
Jim Porter [Tue, 20 Dec 2022 06:21:10 +0000 (22:21 -0800)]
Add 'eshell-duplicate-handles' to return a copy of file handles

* lisp/eshell/esh-io.el (eshell-create-handles): Support creating with
multiple targets for stdout and/or stderr.  Make the targets for a
handle always be a list, and store whether the targets are the default
in a separate 'default' field.
(eshell-protect-handles, eshell-close-handles)
(eshell-copy-output-handle, eshell-interactive-output-p)
(eshell-output-object): Update for changes in 'eshell-create-handles'.
(eshell-duplicate-handles, eshell-get-targets): New functions.

* lisp/eshell/esh-cmd.el (eshell-copy-handles): Rename and alias to...
(eshell-with-copied-handles): ... this function, and use
'eshell-duplicate-handles'.
(eshell-execute-pipeline): Use 'eshell-duplicate-handles'.

22 months agoHandle make-directory return values in file name handlers
Michael Albinus [Thu, 22 Dec 2022 18:39:59 +0000 (19:39 +0100)]
Handle make-directory return values in file name handlers

* lisp/net/ange-ftp.el (ange-ftp-make-directory): Handle return
values.

* lisp/net/tramp.el (tramp-skeleton-make-directory): New defmacro.
Handle also return values.
* lisp/net/tramp-adb.el (tramp-adb-handle-make-directory):
* lisp/net/tramp-crypt.el (tramp-crypt-handle-make-directory):
* lisp/net/tramp-fuse.el (tramp-fuse-handle-make-directory):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-make-directory):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-make-directory):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-make-directory):
Use it.

* test/lisp/net/tramp-tests.el (tramp-test13-make-directory):
Handle return values.

22 months ago; Fix docstring
Ikumi Keita [Thu, 22 Dec 2022 17:23:34 +0000 (18:23 +0100)]
; Fix docstring

* lisp/textmodes/reftex-vars.el
(reftex-allow-detached-macro-args): Fix macro name in docstring.

22 months agoEglot: eglot--servers-by-xrefed-file doesn't need to be value-weak
João Távora [Thu, 22 Dec 2022 15:44:11 +0000 (15:44 +0000)]
Eglot: eglot--servers-by-xrefed-file doesn't need to be value-weak

* lisp/progmodes/eglot.el (eglot--servers-by-xrefed-file): Doesn't
need to be weak.

22 months agoPrevent stale servers when using eglot-extend-to-xref
João Távora [Thu, 22 Dec 2022 11:29:49 +0000 (11:29 +0000)]
Prevent stale servers when using eglot-extend-to-xref

A weak-valued hash-table is not enough to guarantee that a reference
to a zombie server in eglot--servers-by-xrefed-file variable won't
survive long enough to confuse the next call to eglot--current-server
in some buffers.

So, before this fix it was common to get "Process EGLOT ... not
running" errors if some xref-extended buffers (like system libraries)
were open and M-x eglot-reconnect was issued.  This should be
prevented now.

Note however, that even after this the eglot-extend-to-xref logic is
still flawed.  For example, if a buffer for the xref-extended buffer
happens to be already visited by the time M-. is issued to navigate to
it, Eglot won't be activated.  A half-decent workaround is to kill the
buffer and re-visit it.

* lisp/progmodes/eglot.el (eglot--servers-by-xrefed-file): Move
up.
(eglot--on-shutdown): Make sure to cleanup
eglot--servers-by-xrefed-file.

22 months ago; * src/alloc.c (Fmemory_info): Doc fix.
Eli Zaretskii [Thu, 22 Dec 2022 11:02:45 +0000 (13:02 +0200)]
; * src/alloc.c (Fmemory_info): Doc fix.

22 months ago* etc/tutorials/TUTORIAL.cn: Fix typos. (Bug#60221)
Xi Lu [Tue, 20 Dec 2022 15:19:13 +0000 (23:19 +0800)]
* etc/tutorials/TUTORIAL.cn: Fix typos.  (Bug#60221)

22 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Thu, 22 Dec 2022 09:00:41 +0000 (11:00 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

22 months agoAdd alias for removed font-lock function
Benson Chu [Wed, 21 Dec 2022 23:41:32 +0000 (17:41 -0600)]
Add alias for removed font-lock function

As part of 18947103fabf8070738b3bd9c5a8d02f90988a3d,
`font-lock-fontify-syntactically-region' was renamed to
`font-lock-default-fontify-sytactically'.

* lisp/font-lock.el (font-lock-fontify-syntactically-region): Add
obsolete alias for the renamed function.

Copyright-paperwork-exempt: yes

22 months agoSet beginning/end-of-defun-function in treesit-major-mode-setup
Yuan Fu [Thu, 22 Dec 2022 08:41:58 +0000 (00:41 -0800)]
Set beginning/end-of-defun-function in treesit-major-mode-setup

* lisp/treesit.el (treesit-major-mode-setup): Set them.

22 months agoAdd treesit-defun-at-point and fix c-ts-mode-indent-defun
Yuan Fu [Wed, 21 Dec 2022 05:22:30 +0000 (21:22 -0800)]
Add treesit-defun-at-point and fix c-ts-mode-indent-defun

* lisp/treesit.el (treesit-defun-at-point): New function.
* lisp/progmodes/c-ts-mode.el (c-ts-mode-indent-defun): Implement with
treesit-defun-at-point.

22 months ago; Fix treesit--defuns-around
Yuan Fu [Wed, 21 Dec 2022 05:21:48 +0000 (21:21 -0800)]
; Fix treesit--defuns-around

Now it doesn't move point.

* lisp/treesit.el (treesit--defuns-around): Wrap some code with
save-excursion.

22 months agoUse the new keyword ':repeat' in repeatable keymaps.
Juri Linkov [Thu, 22 Dec 2022 08:03:09 +0000 (10:03 +0200)]
Use the new keyword ':repeat' in repeatable keymaps.

* lisp/bindings.el (undo-repeat-map)
(buffer-navigation-repeat-map, next-error-repeat-map)
(page-navigation-repeat-map):
* lisp/comint.el (comint-repeat-map):
* lisp/dired.el (dired-jump-map):
* lisp/outline.el (outline-navigation-repeat-map)
(outline-editing-repeat-map):
* lisp/shell.el (shell-repeat-map):
* lisp/tab-bar.el (tab-bar-switch-repeat-map)
(tab-bar-move-repeat-map):
* lisp/window.el (other-window-repeat-map)
(resize-window-repeat-map):
* lisp/winner.el (winner-repeat-map):
* lisp/eshell/em-prompt.el (eshell-prompt-repeat-map):
* lisp/eshell/esh-mode.el (eshell-command-repeat-map):
Add the keyword ':repeat' to 'defvar-keymap' instead of
setting the symbol property 'repeat-map' explicitly.

* lisp/keymap.el (defvar-keymap): Check for 'props'
that is used in 'defvar-form'.

22 months agoSimplify X premultipled pixel allocation code
Po Lu [Thu, 22 Dec 2022 07:50:12 +0000 (15:50 +0800)]
Simplify X premultipled pixel allocation code

* src/xterm.c (x_premultiply_pixel): New function.
(x_query_colors): Improve documentation.
(x_draw_fringe_bitmap, x_query_frame_background_color): Use
x_premultiply_pixel.

22 months ago; Merge from origin/emacs-29
Stefan Kangas [Thu, 22 Dec 2022 05:30:10 +0000 (06:30 +0100)]
; Merge from origin/emacs-29

The following commit was skipped:

d6c8d5dbc9f When redirecting in Eshell, check for "/dev/null" specifi...

22 months agoMerge from origin/emacs-29
Stefan Kangas [Thu, 22 Dec 2022 05:30:09 +0000 (06:30 +0100)]
Merge from origin/emacs-29

e59216d3be8 * Invoke spawed Emacs processes with '-Q' when native com...
777b383dd0f Fix Eshell electric slash when used from the root directo...
c088cdad9e9 Fix the --without-all build with tree-sitter
ec9fbad908d Fix write-region to null device on MS-Windows
f35da111990 message: Do not default to eudc-capf-complete yet
98c16a8c883 ; * lisp/tab-bar.el: Remaining renaming of "fixed-width" ...
d76d7a3bebf whitespace: Avoid mutating original buffer's markers in c...

22 months agoWhen redirecting in Eshell, check for "/dev/null" specifically
Jim Porter [Wed, 21 Dec 2022 00:20:50 +0000 (16:20 -0800)]
When redirecting in Eshell, check for "/dev/null" specifically

This is so that users can type "cmd ... > /dev/null" in Eshell no
matter what their system's null device is called.  (Users can still
use their system's null device name when redirecting, too.  Eshell
doesn't need to do anything special to support that.)  This partially
reverts 67a8bdb90c9b5865b7f17290c7135b1a5458c36d.  See bug#59545.

Do not merge to master.

* lisp/eshell/esh-io.el (eshell-set-output-handle): Use "/dev/null"
literally.

22 months ago* Invoke spawed Emacs processes with '-Q' when native compiling (bug#60208)
Andrea Corallo [Wed, 21 Dec 2022 22:26:52 +0000 (23:26 +0100)]
* 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.

22 months agoFix Eshell electric slash when used from the root directory of a remote host
montag451 [Wed, 21 Dec 2022 22:21:20 +0000 (14:21 -0800)]
Fix Eshell electric slash when used from the root directory of a remote host

* lisp/eshell/em-elecslash.el (eshell-electric-forward-slash): Insert
the remote prefix as determined by 'file-remote-p'.

Copyright-paperwork-exempt: Yes

22 months agoFix the --without-all build with tree-sitter
Eli Zaretskii [Wed, 21 Dec 2022 19:52:18 +0000 (21:52 +0200)]
Fix the --without-all build with tree-sitter

* configure.ac (HAVE_TREE_SITTER): Set NEED_DYNLIB=yes, since
tree-sitter support requires dynlib.o.  (Bug#60061)

22 months agoFix write-region to null device on MS-Windows
Eli Zaretskii [Wed, 21 Dec 2022 19:23:51 +0000 (21:23 +0200)]
Fix write-region to null device on MS-Windows

* src/fileio.c (write_region) [WINDOWSNT]: Ignore EBADF errors
from fsync -- this means fsync is not supported for this file.
Happens, for example, with the null device.  (Bug#59545)

22 months agomessage: Do not default to eudc-capf-complete yet
Alexander Adolf [Wed, 21 Dec 2022 17:32:36 +0000 (12:32 -0500)]
message: Do not default to eudc-capf-complete yet

* lisp/gnus/message.el (message-mode): No longer add
eudc-capf-complete to the buffer-local value of
completion-at-point-functions.  (Bug#59314)

22 months ago; * lisp/tab-bar.el: Remaining renaming of "fixed-width" to "auto-width".
Juri Linkov [Wed, 21 Dec 2022 17:30:24 +0000 (19:30 +0200)]
; * lisp/tab-bar.el: Remaining renaming of "fixed-width" to "auto-width".

22 months agowhitespace: Avoid mutating original buffer's markers in clones
Richard Hansen [Tue, 13 Dec 2022 06:33:43 +0000 (01:33 -0500)]
whitespace: Avoid mutating original buffer's markers in clones

* lisp/whitespace.el (whitespace--clone): New hook function that is
run after cloning a buffer that copies `whitespace-bob-marker' and
`whitespace-eob-marker' and changes the copies to point to the new
buffer (Bug#59618).
(whitespace-color-on): Register the hook function.
(whitespace-color-off): Unregister the hook function.

* test/lisp/whitespace-tests.el
(whitespace-tests--with-test-buffer): New macro.
(whitespace-tests--check-markers): New function.
(whitespace-tests--indirect-clone-breaks-base-markers)
(whitespace-tests--indirect-clone-markers)
(whitespace-tests--regular-clone-markers): New tests.

22 months agoFix broken eww desktop restore reload prompt message insertion
Mattias Engdegård [Wed, 21 Dec 2022 11:33:25 +0000 (12:33 +0100)]
Fix broken eww desktop restore reload prompt message insertion

* lisp/net/eww.el (eww-restore-desktop): Repair a malformed `cl-case`
clause.  This code probably never worked as intended.

22 months agosoap-client: fix validation against byte[]
Mattias Engdegård [Wed, 21 Dec 2022 11:05:08 +0000 (12:05 +0100)]
soap-client: fix validation against byte[]

* lisp/net/soap-client.el (soap-validate-xs-basic-type):
`byte[]` is read as the two Lisp values `byte` and `[]` but here the
symbol `byte[]` is intended: the brackets need escaping.

22 months agoMerge from origin/emacs-29
Stefan Kangas [Wed, 21 Dec 2022 05:30:10 +0000 (06:30 +0100)]
Merge from origin/emacs-29

12b2b8864c2 Fix empty pairs in js tree-sitter imenu alist (bug#59945)
6d9f367ead3 ; * lisp/treesit.el (treesit-simple-indent-presets): Fix ...

22 months agoFix empty pairs in js tree-sitter imenu alist (bug#59945)
Charl P. Botha [Sat, 10 Dec 2022 17:09:38 +0000 (19:09 +0200)]
Fix empty pairs in js tree-sitter imenu alist (bug#59945)

The current js--treesit-imenu, used by the JavaScript, TypeScript and
TSX tree-sitter modes, would return empty pairs in the imenu alist if
there were none of that type of symbol.

This would break both the built in imenu and also packages like
consult-imenu.

See https://github.com/minad/consult/issues/697 for the discussion
there.

* lisp/progmodes/js.el (js--treesit-imenu): Don't add nil indexes.

Copyright-paperwork-exempt: yes

22 months ago; * lisp/treesit.el (treesit-simple-indent-presets): Fix typo.
Yuan Fu [Tue, 20 Dec 2022 01:54:12 +0000 (17:54 -0800)]
; * lisp/treesit.el (treesit-simple-indent-presets): Fix typo.

22 months ago; Manually fix merge errors in etc/NEWS
Stefan Kangas [Wed, 21 Dec 2022 01:38:13 +0000 (02:38 +0100)]
; Manually fix merge errors in etc/NEWS

22 months agoMerge from origin/emacs-29
Stefan Kangas [Wed, 21 Dec 2022 01:37:17 +0000 (02:37 +0100)]
Merge from origin/emacs-29

d3a76db88b4 * lisp/repeat.el: Fix repeat-keep-prefix to allow customi...
8ef3777d544 Correct capitalization of Lisp in the manual (bug#60222)
d03ea893780 eglot.el: Add vscode-json-languageserver to eglot-server-...
8550a993785 ; * src/emacs-module.h.in (enum emacs_funcall_exit): Fix ...
fb7f3999c59 ; Fix ruby-method-params-indent's :version value
cfbfd393b45 * lisp/progmodes/project.el (project--read-file-cpd-relat...
2b1fdbffcb5 ruby-method-params-indent: New user option
b9e813f79f2 ; ruby-indent-level: Improve the docstring
399433cc2b9 * lisp/progmodes/project.el: Filter out empty strings fro...
23f7c9c2a92 Fix storing email into nnmail by Gnus
63cdbd986bb ; Really respect browse-url var in erc-compat
64163618d21 whitespace: Fix unintended change in buffer modification ...
a75d1da911c Make emacsclient add abbreviated file names to file-name-...
b3e7768a0ee Repair setopt test after error demotion to warning

22 months 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.

22 months 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).

22 months ago* lisp/repeat.el: Fix repeat-keep-prefix to allow customizing it to non-nil.
Juri Linkov [Tue, 20 Dec 2022 17:22:15 +0000 (19:22 +0200)]
* lisp/repeat.el: Fix repeat-keep-prefix to allow customizing it to non-nil.

* lisp/repeat.el (repeat-keep-prefix): Add or remove
'repeat-pre-hook' depending on the customized value.
(repeat-mode): Add or remove 'repeat-pre-hook' to/from
'pre-command-hook' when 'repeat-keep-prefix' is non-nil.
(repeat-pre-hook): New function.
(repeat-get-map, repeat-check-map): New function refactored from
'repeat-post-hook'.
(repeat-post-hook): Move some code to smaller functions.
(describe-repeat-maps): Set outline-regexp without ^L.

* test/lisp/repeat-tests.el (repeat-tests-keep-prefix):
Uncomment test case that is fixed now in bug#51281 and bug#55986.

22 months 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.

22 months agoCorrect capitalization of Lisp in the manual (bug#60222)
Daniel Martín [Tue, 20 Dec 2022 15:32:37 +0000 (16:32 +0100)]
Correct capitalization of Lisp in the manual (bug#60222)

* doc/lispref/compile.texi (Native-Compilation Functions): Fix typo.

22 months agoeglot.el: Add vscode-json-languageserver to eglot-server-programs
Brian Leung [Mon, 19 Dec 2022 23:03:06 +0000 (15:03 -0800)]
eglot.el: Add vscode-json-languageserver to eglot-server-programs

* lisp/progmodes/eglot.el (eglot-server-programs): Add the
alternative name of the vcscode JSON server.  (Bug#60198)

22 months ago; * src/emacs-module.h.in (enum emacs_funcall_exit): Fix typo.
Philipp Stephani [Tue, 20 Dec 2022 12:29:49 +0000 (13:29 +0100)]
; * src/emacs-module.h.in (enum emacs_funcall_exit): Fix typo.

22 months 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.

22 months 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.

22 months 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.

22 months ago; Fix ruby-method-params-indent's :version value
Dmitry Gutov [Tue, 20 Dec 2022 00:58:48 +0000 (02:58 +0200)]
; Fix ruby-method-params-indent's :version value

22 months 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.

22 months 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).

22 months ago* lisp/progmodes/project.el (project--read-file-cpd-relative): Optimize.
Juri Linkov [Mon, 19 Dec 2022 19:46:40 +0000 (21:46 +0200)]
* lisp/progmodes/project.el (project--read-file-cpd-relative): Optimize.

22 months agoruby-method-params-indent: New user option
Dmitry Gutov [Mon, 19 Dec 2022 19:01:27 +0000 (21:01 +0200)]
ruby-method-params-indent: New user option

* lisp/progmodes/ruby-mode.el (ruby-method-params-indent):
New option (bug#60110).

(ruby-smie-rules): Use it.

* etc/NEWS: Mention it.

* test/lisp/progmodes/ruby-mode-resources/ruby.rb:
Ensure the var's value is default.

* test/lisp/progmodes/ruby-mode-resources/ruby-method-params-indent.rb:
New file.

* test/lisp/progmodes/ruby-mode-tests.el (ruby-deftest-indent):
New macro, use it to run the indentation test using the new file.
Disable the :expensive-test tag, because neither runs for "longer
than some few seconds", both take significantly below 1s.

22 months ago; ruby-indent-level: Improve the docstring
Dmitry Gutov [Mon, 19 Dec 2022 17:37:44 +0000 (19:37 +0200)]
; ruby-indent-level: Improve the docstring

22 months ago* lisp/progmodes/project.el: Filter out empty strings from history (bug#58447)
Juri Linkov [Mon, 19 Dec 2022 17:54:08 +0000 (19:54 +0200)]
* lisp/progmodes/project.el: Filter out empty strings from history (bug#58447)

(project--read-file-cpd-relative): Do not include empty strings (when
prefix has the same length as the string).

22 months 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'.

22 months agoFix storing email into nnmail by Gnus
Eli Zaretskii [Mon, 19 Dec 2022 17:01:04 +0000 (19:01 +0200)]
Fix storing email into nnmail by Gnus

* lisp/gnus/nnml.el (nnml--encode-headers): Wrap
'rfc2047-encode-string' calls with 'ignore-errors', to avoid
disrupting email workflows due to possibly-invalid headers.
Reported by Florian Weimer <fweimer@redhat.com>.

22 months 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.

22 months ago; Really respect browse-url var in erc-compat
F. Jason Park [Mon, 12 Dec 2022 03:16:07 +0000 (19:16 -0800)]
; Really respect browse-url var in erc-compat

* lisp/erc/erc-compat.el: Do what was supposed to be done by
75f26646d4a569cfb485de4baddcda66ff44b2c3 "; Be nicer when updating
browse-url var in erc-compat".  This is the less harmful version of
that patch (from bug#59976#8) but without the cl-lib requirement since
users may not want to load the main ERC library right away.
* lisp/erc/erc.el: Clarify some comments regarding the core API.

22 months agowhitespace: Fix unintended change in buffer modification status
Richard Hansen [Mon, 19 Dec 2022 04:04:00 +0000 (23:04 -0500)]
whitespace: Fix unintended change in buffer modification status

* lisp/whitespace.el (whitespace--empty-at-bob-matcher)
whitespace--empty-at-eob-matcher, whitespace--update-bob-eob):
Silently add the `font-lock-multiline' text property when
highlighting beginning-of-buffer and end-of-buffer empty lines
to prevent Emacs from running modification hooks or considering
the buffer to be modified (Bug#60066).

* test/lisp/whitespace-tests.el
(whitespace-tests--empty-bob-eob-modified): Add a regression test.

22 months agoMake emacsclient add abbreviated file names to file-name-history
Eli Zaretskii [Mon, 19 Dec 2022 13:33:09 +0000 (15:33 +0200)]
Make emacsclient add abbreviated file names to file-name-history

* lisp/server.el (server-visit-files): Use
'file-name-history--add' to add the visited files to history.
(Bug#60097)

22 months 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.

22 months 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.

22 months 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))

22 months 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.

22 months agoRepair setopt test after error demotion to warning
Mattias Engdegård [Mon, 19 Dec 2022 11:05:09 +0000 (12:05 +0100)]
Repair setopt test after error demotion to warning

* test/lisp/cus-edit-tests.el (test-setopt):
Check for a warrning instead of an error in attempt to call `setopt`
with a value that does not match the declared type (bug#60162).

22 months 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.

22 months 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'.

22 months 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'.

22 months 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

22 months 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

22 months 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

22 months 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

22 months 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

22 months 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"

22 months 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

22 months 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...

22 months 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).

22 months 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

22 months 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.

22 months 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.

22 months 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.

22 months 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.

22 months 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'.

22 months 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>.

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

22 months 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.

22 months 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`.

22 months 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.

22 months 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.

22 months 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>
22 months 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'.

22 months 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.

22 months 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)

22 months 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)

22 months 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)

22 months 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.