]> git.eshelyaron.com Git - emacs.git/log
emacs.git
21 months agoBump Eglot version to 1.12
João Távora [Fri, 10 Mar 2023 11:30:58 +0000 (11:30 +0000)]
Bump Eglot version to 1.12

* etc/EGLOT-NEWS: New file.

* etc/NEWS: Briefly mention etc/EGLOT-NEWS.

* lisp/progmodes/eglot.el: Bump versions.

21 months agoUpdate Eglot's manual about eglot-workspace-configuration
João Távora [Sun, 12 Mar 2023 19:44:53 +0000 (19:44 +0000)]
Update Eglot's manual about eglot-workspace-configuration

There is a possible use for a global setting
eglot-workspace-configuration, which is to (ab)use it to set
user-specific configuration when the server doesn't permit other
methods.  Rearrange the "Advanced server configuration" section and
describe that use in the manual.

* doc/misc/eglot.texi (Project-specific configuration): Correct
mistake about global usefulness of eglot-workspace-configuration.
(Advanced server configuration): Swap order of sections.
(User-specific configuration): Mention possibility of globally
setting eglot-workspace-configuration.

21 months ago; * lisp/novice.el (disabled-command-function): Add note in a comment.
Eli Zaretskii [Sun, 12 Mar 2023 20:22:41 +0000 (22:22 +0200)]
; * lisp/novice.el (disabled-command-function): Add note in a comment.

21 months agoAmend last Eglot commit (bug#62065)
João Távora [Sun, 12 Mar 2023 19:30:53 +0000 (19:30 +0000)]
Amend last Eglot commit (bug#62065)

The fix contained a spurious check for this-command that shouldn't
have made it in..

* lisp/progmodes/eglot.el (eglot-ensure): Don't check this-command.

21 months agoMake eglot-ensure's post-command-hook run a bit later (bug#62065)
João Távora [Sun, 12 Mar 2023 18:19:40 +0000 (18:19 +0000)]
Make eglot-ensure's post-command-hook run a bit later (bug#62065)

'eglot-ensure', typically used in the major-mode-hook, use
'post-command-hook' to schedule an automated, non-interactive
connection attempt to a server.  The goal is to connect when the
buffer is ready, i.e. after the user command that found the file.

However, if there are dir-local or buffer-local variables to confirm,
finding the file will cause a minibuffer prompt to appear.

In that case, 'eglot-ensure's addition to the global post-command-hook
runs before it was intended too and a connection is started
prematurely.

In turn, this means that a call to 'hack-dir-local-variables' -- which
is part of the connection process -- which also needs a minibuffer
prompt, collides with the previous one.  This generates an error and
confuses the user, who doesn't know if the directory-local variables
have been applied or not.

This commit fixes the clash by having 'eglot-ensure' set
'post-command-hook' buffer-locally.  This causes the automated
connection to take place, as intended, after the user's original
file-finding command has ended.

However, the problem reported in bug#62065 is not completely fixed.
If the user answers "no" to the first "confirm local variables"
"prompt, she will be prompted again in the second one.  A subsequent
commit will address this separate problem.

* lisp/progmodes/eglot.el (eglot-ensure): Use buffer-local post-command-hook.

21 months agoFix display of disabled-command help text
Eli Zaretskii [Sun, 12 Mar 2023 17:32:02 +0000 (19:32 +0200)]
Fix display of disabled-command help text

* lisp/novice.el (disabled-command-function): Improve wording, and
make sure the prompt doesn't exceed one screen line, so that the
mini-window is not resized (which gets in the way of fitting the
window to the size of the help text), and the help text is fully
visible when Emacs prompts for input.  (Bug#62146)

21 months agoRemove mention of old dotted-list reader quirk from manual
Mattias Engdegård [Sun, 12 Mar 2023 16:57:38 +0000 (17:57 +0100)]
Remove mention of old dotted-list reader quirk from manual

* doc/lispref/objects.texi (Dotted Pair Notation):
The (. X) reader peculiarity is no more (bug#62020).

21 months agoFix value history shown for 'gc-cons-percentage'
Eli Zaretskii [Sun, 12 Mar 2023 14:19:49 +0000 (16:19 +0200)]
Fix value history shown for 'gc-cons-percentage'

When Emacs is built, temacs is run in batch mode, so if we enlarge
'gc-cons-percentage' in that case, the enlarged value will be
"remembered" by the dumped Emacs, and will show confusing
information in "C-h v", claiming that the original value was 1.0.
Keeping the value at 0.1 during dumping avoids that.

* src/emacs.c (main): Increase 'gc-cons-percentage' in batch mode
only if we are not initializing (a.k.a. "dumping") Emacs.

21 months agoTRework fix for bug#62106
Michael Albinus [Sun, 12 Mar 2023 10:01:22 +0000 (11:01 +0100)]
TRework fix for bug#62106

* lisp/files-x.el (connection-local-set-profiles)
(connection-local-set-profile-variables):
Use `custom-set-variables'.  It serves the purpose to not keep
unsaved user options, and it is less invasive than
`customize-save-variable'.

21 months ago; * etc/NEWS: Fix last change.
Eli Zaretskii [Sun, 12 Mar 2023 07:48:45 +0000 (09:48 +0200)]
; * etc/NEWS: Fix last change.

21 months ago; Remove 'ns-popup-font-panel' from documentation
Eli Zaretskii [Sun, 12 Mar 2023 07:45:48 +0000 (09:45 +0200)]
; Remove 'ns-popup-font-panel' from documentation

* doc/emacs/macos.texi (Mac / GNUstep Customization): Remove the
reference to 'ns-popup-font-panel'.  (Bug#62130)

21 months agoAdd missing indentation rule for rust-ts-mode (Bug#62109)
Randy Taylor [Sat, 11 Mar 2023 01:56:04 +0000 (20:56 -0500)]
Add missing indentation rule for rust-ts-mode (Bug#62109)

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--indent-rules): Add
missing rule.

21 months ago; One more improvement to ELisp "internals" appendix.
Eli Zaretskii [Sat, 11 Mar 2023 17:30:06 +0000 (19:30 +0200)]
; One more improvement to ELisp "internals" appendix.

21 months agoFix bug#62106
Michael Albinus [Sat, 11 Mar 2023 16:31:11 +0000 (17:31 +0100)]
Fix bug#62106

* lisp/files-x.el (connection-local-set-profiles)
(connection-local-set-profile-variables):
Use `customize-save-variable' instead of `customize-set-variable'.
(Bug#62106)

21 months ago; Minor improvement of documentation of GC thresholds
Eli Zaretskii [Sat, 11 Mar 2023 16:16:35 +0000 (18:16 +0200)]
; Minor improvement of documentation of GC thresholds

* doc/lispref/internals.texi (Garbage Collection): More practical
aspects of enlarging the GC threshold.

21 months agoAdd missing rust-ts-mode highlight query for scoped_type_identifiers
Randy Taylor [Sat, 11 Mar 2023 02:12:33 +0000 (21:12 -0500)]
Add missing rust-ts-mode highlight query for scoped_type_identifiers

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
Add missing query.

21 months agoMake "case" keyword a dedenter in Python
kobarity [Fri, 10 Mar 2023 05:26:22 +0000 (14:26 +0900)]
Make "case" keyword a dedenter in Python

* lisp/progmodes/python.el (python-rx): Add "case" to dedenter.
(python-info-dedenter-opening-block-positions): Add "case" to pairs.
* test/lisp/progmodes/python-tests.el (python-indent-dedenters-9):
New test.

21 months ago; * lisp/arc-mode.el (w32-get-console-codepage): Declare.
Eli Zaretskii [Sat, 11 Mar 2023 12:54:22 +0000 (14:54 +0200)]
; * lisp/arc-mode.el (w32-get-console-codepage): Declare.

21 months agoFix decoding non-ASCII file names in zip archives on MS-Windows
Eli Zaretskii [Sat, 11 Mar 2023 11:30:37 +0000 (13:30 +0200)]
Fix decoding non-ASCII file names in zip archives on MS-Windows

* lisp/arc-mode.el (archive-zip-summarize): On MS-Windows,
override archive-file-name-coding-system for files compressed
on MS-Windows, and use the local console encoding instead.

21 months agoFix copying binary files from zip archives
Eli Zaretskii [Sat, 11 Mar 2023 09:54:31 +0000 (11:54 +0200)]
Fix copying binary files from zip archives

* lisp/arc-mode.el (archive-copy-file): Prevent any coding
conversions when writing output files.  (Bug#62091)

21 months agoSkip ruby-ts-syntax-propertize-symbol unless treesitter is available
Robert Pluim [Fri, 10 Mar 2023 10:13:42 +0000 (11:13 +0100)]
Skip ruby-ts-syntax-propertize-symbol unless treesitter is available

 *
 test/lisp/progmodes/ruby-ts-mode-tests.el (ruby-ts-syntax-propertize-symbol):
 Add check for treesitter.

21 months ago; * doc/misc/eglot.texi (Project-specific configuration): Fix typo.
Yuan Fu [Fri, 10 Mar 2023 06:15:36 +0000 (22:15 -0800)]
; * doc/misc/eglot.texi (Project-specific configuration): Fix typo.

21 months agoFix enums and unions appearing as structs in c-ts-base-mode's imenu
Randy Taylor [Wed, 8 Mar 2023 01:38:18 +0000 (20:38 -0500)]
Fix enums and unions appearing as structs in c-ts-base-mode's imenu

* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Separate enums and unions out
from structs.

21 months agoruby-ts-mode: Fine-tune s-p-f on symbols (bug#62086)
Dmitry Gutov [Thu, 9 Mar 2023 21:49:39 +0000 (23:49 +0200)]
ruby-ts-mode: Fine-tune s-p-f on symbols (bug#62086)

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query):
Don't match ':' in symbol node text.  Or '_', I suppose.
(ruby-ts--syntax-propertize): Make sure to only put the '_' syntax
on punctuation syntax characters, and not on the whole symbol (to
e.g. have symbols like :foo? include text recognized as word).

* test/lisp/progmodes/ruby-ts-mode-tests.el
(ruby-ts-syntax-propertize-symbol): New test.

21 months agopython-info-dedenter-opening-block-positions: Fix to support "bare" match
Dmitry Gutov [Thu, 9 Mar 2023 15:24:54 +0000 (17:24 +0200)]
python-info-dedenter-opening-block-positions: Fix to support "bare" match

* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions): Make the check
stricter.  Require that block starts only at indentation.

* test/lisp/progmodes/python-tests.el
(python-indent-after-bare-match): Another test (bug#62031).

21 months agoAutoload Eglot helper funtion eglot--debbugs-or-github-bug-uri
João Távora [Thu, 9 Mar 2023 13:07:02 +0000 (13:07 +0000)]
Autoload Eglot helper funtion eglot--debbugs-or-github-bug-uri

This isn't a typical autoload: the progn block is plced in the
autoloads file, but the eglot.el file itself isn't loaded as a result
when the function inside the progn block is called.

* lisp/progmodes/eglot.el (eglot--debbugs-or-github-bug-uri):
autoload, but in progn.

21 months agoAdd chapter on advanced server configuration to Eglot manual
João Távora [Thu, 9 Mar 2023 01:20:11 +0000 (01:20 +0000)]
Add chapter on advanced server configuration to Eglot manual

* doc/misc/eglot.texi (Top): Add section "Advanced server configuration"
(Setting Up LSP Servers): Rework.
(Advanced server configuration): New chapter.

21 months ago; * lisp/progmodes/java-ts-mode.el (treesit-query-capture): Declare.
Eli Zaretskii [Thu, 9 Mar 2023 10:23:14 +0000 (12:23 +0200)]
; * lisp/progmodes/java-ts-mode.el (treesit-query-capture): Declare.

21 months agojava-ts-mode: detect if text_block is supported.
Vincenzo Pupillo [Mon, 6 Mar 2023 11:24:34 +0000 (12:24 +0100)]
java-ts-mode: detect if text_block is supported.

A recent commit in tree-sitter-java (issue #141) removed support for
the text_block node type from the grammar. To support the old released
version and the new one, a helper function was added on which the
string syntax highlighting now depends. (bug#61913)

* lisp/progmodes/java-ts-mode.el
(java-ts-mode--string-highlight-helper): New helper function that
return the right query string
(java-ts-mode--font-lock-settings): Use it

Copyright-paperwork-exempt: yes

21 months agoRevert workaround introduced in Bug#56271
kobarity [Sun, 5 Mar 2023 08:07:17 +0000 (17:07 +0900)]
Revert workaround introduced in Bug#56271

* lisp/progmodes/python.el (python-nav-end-of-statement)
(python-nav-end-of-block): Revert workaround introduced in Bug#56271
as the bug is fixedin Bug#58780.

21 months agoFix searching for end of string in python-nav-end-of-statement
kobarity [Sun, 5 Mar 2023 08:06:26 +0000 (17:06 +0900)]
Fix searching for end of string in python-nav-end-of-statement

* lisp/progmodes/python.el (python-nav-end-of-statement): Add
searching for corresponding string-quote.
* test/lisp/progmodes/python-tests.el (python-nav-end-of-statement-3)
(python-nav-end-of-statement-4, python-info-current-defun-4): New
tests. (Bug#58780)

21 months agoFix libwebp check for some webp installations
Po Lu [Thu, 9 Mar 2023 00:52:54 +0000 (08:52 +0800)]
Fix libwebp check for some webp installations

* configure.ac: Look for WebPGetInfo; if it is not there, look
for libwebpdecoder as well.  (bug#61988)

21 months agoAvoid potential infloop
Dmitry Gutov [Wed, 8 Mar 2023 22:43:31 +0000 (00:43 +0200)]
Avoid potential infloop

* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions):
Avoid potential infloop (bug#62031).

21 months agoDon't misindent 'else:' after 'if re.match:' in Python
Dmitry Gutov [Wed, 8 Mar 2023 20:41:23 +0000 (22:41 +0200)]
Don't misindent 'else:' after 'if re.match:' in Python

* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions): Check that the
supposed block start is not a method call (bug#62031).

* test/lisp/progmodes/python-tests.el (python-indent-after-re-match):
New test.

Co-authored-by: Lele Gaifax <lele@metapensiero.it>
21 months ago* Make sure `default-directory' exists before spawning processes (bug#62004)
Andrea Corallo [Wed, 8 Mar 2023 20:08:49 +0000 (21:08 +0100)]
* Make sure `default-directory' exists before spawning processes (bug#62004)

* lisp/emacs-lisp/comp.el (comp-final, comp-run-async-workers): Bind
`default-directory' to `invocation-directory'.

21 months agoFix sed expression in install-etc make target
Ulrich Müller [Wed, 8 Mar 2023 18:48:33 +0000 (19:48 +0100)]
Fix sed expression in install-etc make target

* Makefile.in (install-etc): Fix sed expression for emacsclient
desktop files.  (Bug#62045)

21 months agoAvoid using bash in the emacsclient desktop file
Ulrich Müller [Wed, 8 Mar 2023 18:37:27 +0000 (19:37 +0100)]
Avoid using bash in the emacsclient desktop file

* etc/emacsclient-mail.desktop (Exec): Use sh and sed instead
of bash, because the latter may not be available everywhere.

21 months agoFix documentation of the 'line-height' text property
Eli Zaretskii [Wed, 8 Mar 2023 17:29:33 +0000 (19:29 +0200)]
Fix documentation of the 'line-height' text property

* doc/lispref/display.texi (Line Height): More accurate
documentation of the value t of 'line-height' text property.
(Bug#62048)

21 months agoAdd 'declare' specs to with- and without-restriction
Gregory Heytings [Wed, 8 Mar 2023 09:55:06 +0000 (09:55 +0000)]
Add 'declare' specs to with- and without-restriction

* lisp/subr.el (with-restriction):
(without-restriction): Add 'declare' specs.

21 months agoFix empty line indentation in c-ts-mode (bug#61997)
Yuan Fu [Wed, 8 Mar 2023 00:35:23 +0000 (16:35 -0800)]
Fix empty line indentation in c-ts-mode (bug#61997)

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Handle the empty line case.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el (treesit-simple-indent-presets): Support null as
a value for NODE-TYPE in the 'match' matcher.

21 months agoFix tree-sitter indent preset prev-line (bug#61998)
Yuan Fu [Wed, 8 Mar 2023 00:26:33 +0000 (16:26 -0800)]
Fix tree-sitter indent preset prev-line (bug#61998)

* lisp/treesit.el (treesit-simple-indent-presets): Fix return value.

21 months agoRevert 'forward-sentence-default-function' to return point (bug#62027)
Manuel Giraud [Tue, 7 Mar 2023 19:03:53 +0000 (20:03 +0100)]
Revert 'forward-sentence-default-function' to return point (bug#62027)

* lisp/textmodes/paragraphs.el
(forward-sentence-default-function): Revert to return the
position of point.
(count-sentences): Adapt to this change.

21 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Tue, 7 Mar 2023 17:50:44 +0000 (18:50 +0100)]
; * etc/NEWS: Fix typos.

21 months agoFix Elisp code injection vulnerability in emacsclient-mail.desktop
Ulrich Müller [Tue, 7 Mar 2023 17:25:37 +0000 (18:25 +0100)]
Fix Elisp code injection vulnerability in emacsclient-mail.desktop

A crafted mailto URI could contain unescaped double-quote
characters, allowing injection of Elisp code.  Therefore, any
'\' and '"' characters are replaced by '\\' and '\"', using Bash
pattern substitution (which is not available in the POSIX shell).

We want to pass literal 'u=${1//\\/\\\\}; u=${u//\"/\\\"};' in the
bash -c command, but in the desktop entry '"', '$', and '\' must
be escaped as '\\"', '\\$', and '\\\\', respectively (backslashes
are expanded twice, see the Desktop Entry Specification).

Reported by Gabriel Corona <gabriel.corona@free.fr>.

* etc/emacsclient-mail.desktop (Exec): Escape backslash and
double-quote characters.

21 months agoFix problem with debuginfod queries in "M-x gdb"
Eli Zaretskii [Tue, 7 Mar 2023 12:39:27 +0000 (14:39 +0200)]
Fix problem with debuginfod queries in "M-x gdb"

* lisp/progmodes/gdb-mi.el (gdb-debuginfod-enable-setting): New
defcustom.
(gdb-debuginfod-message): New function.
(gdb-init-1): Initialize gdb-debuginfod-enable.  Ask the user
about debuginfod queries and display any error messages.
(Bug#61973)

* etc/NEWS: Announce the change.

21 months agoFix regression in Fido mode (bug#62015)
João Távora [Mon, 6 Mar 2023 22:28:47 +0000 (22:28 +0000)]
Fix regression in Fido mode (bug#62015)

To understand the regression consider this recipe where the 'fo'
pattern is typed by the user in the last step.

   emacs -Q
   C-x b foo RET
   C-x b afoo RET
   C-x b *scratch* RET
   M-x fido-mode RET
   C-x b fo

This used to offer both 'foo' and 'afoo' as candidates but now only
offered 'foo'.  This is because the pattern 'fo' matches 'foo', but
not 'afoo' with 'basic' completion style.

Fido mode, however, prioritizes 'flex' completion style, and that is
not happening here as it used to.

This was introduced in this commit

     commit bf81df86e52fdc995bec8d9646f84d114cb896d1
     Author: João Távora <joaotavora@gmail.com>
     Date:   Wed Dec 7 10:43:59 2022 +0000

         Don't override completion-category-defaults in fido-mode

I took away the nil setting of 'completion-category-defaults; in Fido
mode's minibuffer. It seemed generally the correct thing to do, and
was done mainly because Eglot added its style preferences to that
variable instead of completion-category-overrides directly, which is a
nono.  So, to be able use the Fido UI with Eglot successfully,
'completion-category-defaults' should stay untouched.  Or so I
thought.

However, I failed to notice that, for most categories, the default
value of 'completion-category-defaults' prioritizes the 'basic'
completion style.

For example, in the 'buffer' category, the default value has the
styles list '(basic substring)'.  This means that if a pattern matches
accoring to the 'basic' style, 'substring' will not be tried.  And
neither will 'completion-styles' which in Fido mode's case happens to
be 'flex'.

The solution in this commit is to craft a value for completion
category defaults that is just like the default one, but prioritizes
'flex' completion for every category.

* lisp/icomplete.el (icomplete--fido-ccd): New helper.
(icomplete--fido-mode-setup): Use it.

21 months ago* Fix `emacs-lisp-native-compile-and-load' for (bug#61917)
Andrea Corallo [Mon, 6 Mar 2023 16:27:32 +0000 (17:27 +0100)]
* Fix `emacs-lisp-native-compile-and-load' for (bug#61917)

* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
Don't load if no compialtion happened.

21 months ago* lisp/emacs-lisp/comp.el (comp-prettyformat-insn): Fix (bug#61917)
Andrea Corallo [Mon, 6 Mar 2023 15:51:07 +0000 (16:51 +0100)]
* lisp/emacs-lisp/comp.el (comp-prettyformat-insn): Fix (bug#61917)

21 months agoRevert "Fix configuration of webp libraries"
Eli Zaretskii [Mon, 6 Mar 2023 15:31:57 +0000 (17:31 +0200)]
Revert "Fix configuration of webp libraries"

This reverts commit de4277af009115ceba7fe920163c05c608ea9524.
It breaks WebP support at least on my system.
There's no reason to require libwebpdecoder library to be
installed, since we don't use the functions from it, at least
not in libwebp 1.2.1.

21 months agoFix configuration of webp libraries
Po Lu [Mon, 6 Mar 2023 13:42:29 +0000 (21:42 +0800)]
Fix configuration of webp libraries

* configure.ac: Link with libwebpdecoder along with
libwebpdemux.  (bug#61988)

21 months agoFix c-ts-mode indentation
Yuan Fu [Sun, 5 Mar 2023 23:22:36 +0000 (15:22 -0800)]
Fix c-ts-mode indentation

Mentioned in bug#61893.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Handle
"#elif" and "#else".
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts: Add an
"#elif" to the test.

21 months agoFix c-ts-mode indentation
Yuan Fu [Sun, 5 Mar 2023 23:07:58 +0000 (15:07 -0800)]
Fix c-ts-mode indentation

Mentioned in bug#61893, although not the subject of it.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--anchor-prev-sibling): Fix the child index for preproc_else
and preproc_elif case.
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts:
New test.

21 months agoFix c-ts-mode indentation
Yuan Fu [Sun, 5 Mar 2023 23:01:54 +0000 (15:01 -0800)]
Fix c-ts-mode indentation

Not the subject of it, but mentioned in bug#61893.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Skip
the sibling if it doesn't start on it's own line.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

21 months ago; Change font-lock-variable-name-face to font-lock-variable-use-face
Yuan Fu [Sun, 5 Mar 2023 22:42:28 +0000 (14:42 -0800)]
; Change font-lock-variable-name-face to font-lock-variable-use-face

* lisp/progmodes/sh-script.el:
(sh-mode--treesit-settings): Change font-lock-variable-name-face to
font-lock-variable-use-face.

21 months agoUpdate to Org 9.6.1-40-g3d817c
Kyle Meyer [Sun, 5 Mar 2023 22:22:06 +0000 (17:22 -0500)]
Update to Org 9.6.1-40-g3d817c

21 months agoAdd string-interpolation feature to bash-ts-mode
Yuan Fu [Sun, 5 Mar 2023 22:16:58 +0000 (14:16 -0800)]
Add string-interpolation feature to bash-ts-mode

* lisp/progmodes/sh-script.el:
(bash-ts-mode): Add string-interpolation feature.
(sh-mode--treesit-settings): Add rule for string-interpolation feature.

21 months agoFix tramp-sh-handle-insert-directory
Michael Albinus [Sun, 5 Mar 2023 16:31:26 +0000 (17:31 +0100)]
Fix tramp-sh-handle-insert-directory

* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Remove also
//DIRED-OPTIONS// line when there is no //DIRED// line.

21 months ago; Minor fix of last change
Eli Zaretskii [Sun, 5 Mar 2023 10:24:39 +0000 (12:24 +0200)]
; Minor fix of last change

* lisp/emacs-lisp/comp.el (comp-subr-trampoline-install): Fix
wording.  (Bug#61880)

21 months ago* Warn when certain primitives are redefined (bug#61880)
Andrea Corallo [Sun, 5 Mar 2023 09:46:18 +0000 (10:46 +0100)]
* Warn when certain primitives are redefined (bug#61880)

* lisp/emacs-lisp/comp.el (comp-warn-primitives): New constant.
(comp-subr-trampoline-install): Warn when a sensitive primitive is
being redefined.

21 months ago; * lib-src/etags.c (print_help): Fix indentation.
Eli Zaretskii [Sun, 5 Mar 2023 06:43:03 +0000 (08:43 +0200)]
; * lib-src/etags.c (print_help): Fix indentation.

21 months agoFix c-ts-mode preproc directive indentation
Yuan Fu [Sat, 4 Mar 2023 22:39:44 +0000 (14:39 -0800)]
Fix c-ts-mode preproc directive indentation

Mentioned in bug#61893, although not the subject of that report.  This
change fixes indentation for nested directives.  For example, when the
directive involves elif and the like, the elif is nested in the if
directive, so simply using grand-parent and great-grand-parent for
anchor is insufficient, because the nesting can grow arbitrarily.

The test added also covers the last preproc fix.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--standalone-parent-skip-preproc): New function.
(c-ts-mode--indent-styles): New rules.
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts: New test.

21 months ago; * lisp/files.el (hack-local-variables): Fix typo in the doc string.
Eli Zaretskii [Sat, 4 Mar 2023 20:03:14 +0000 (22:03 +0200)]
; * lisp/files.el (hack-local-variables): Fix typo in the doc string.

21 months agoMore robustly unspoof HOME in Eglot tests (bug#61637)
João Távora [Sat, 4 Mar 2023 19:14:48 +0000 (19:14 +0000)]
More robustly unspoof HOME in Eglot tests (bug#61637)

A fair number of LSP servers allow user-local installations instead of
system wide installations.  Emacs's technique of spoofing the HOME env
var to some non-existent or non-home directory during 'make check'
breaks these tests.  That's because the executables are still found by
executable-find, but their invocation will rarely be successful as
HOME isn't what they expect it to be.

Eglot tests already had a technique for dealing with this,
"unspoffing" HOME just for the invocations of LSP server but it
stopped working a while back.  So make it more robust.

Eventually, we'll want to decide wether these local servers should be
considered in 'make check' runs at all, or whether there is a way to
use them with a spoofed HOME.

* test/lisp/progmodes/eglot-tests.el (eglot--call-with-fixture):
More robustly unspoof HOME.

21 months agoTurn on Eglot inlay hints by default
João Távora [Sat, 4 Mar 2023 15:05:15 +0000 (15:05 +0000)]
Turn on Eglot inlay hints by default

This is like any other server-provided feature, and may be turned off
client-side by setting eglot-ignored-server-capabilities like

   (add-to-list 'eglot-ignored-server-capabilities :inlayHintProvider)

* lisp/progmodes/eglot.el (eglot--maybe-activate-editing-mode):
Activate eglot-inlay-hints-mode.
(eglot-inlay-hints-mode): Instead of warning about missing
:inlayHintProvider, turn off eglot-inlay-hints-mode.

21 months agoUpdate ts modes missed in 4c16fd3a512 to use column-0
Dmitry Gutov [Sat, 4 Mar 2023 17:45:39 +0000 (19:45 +0200)]
Update ts modes missed in 4c16fd3a512 to use column-0

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
* lisp/progmodes/go-ts-mode.el (go-ts-mode--indent-rules):
Change point-min anchor to column-0.

21 months agoRobustify Eglot for "transient" projects
João Távora [Sat, 4 Mar 2023 12:49:00 +0000 (12:49 +0000)]
Robustify Eglot for "transient" projects

When Eglot needs to synthesize a "transient" project for
default-directory sometimes the value of that variable is set to an
unexpanded value, sometimes not.  This can cause simple invocations
like.

   Emacs -Q ~/path/to-some-python-file.py -f eglot

to fail, because eglot--current-server will be looking for a project
in the registry called

    (transient . "~/path")

where in reality it is stored there as

    (transient . "/home/someuser/path")

The fix is to always expand default-directory in eglot--current-project.

* lisp/progmodes/eglot.el (eglot--current-project): Use
expand-file-name.

21 months agoFix documentation of 'normal-mode' in buffers that don't visit files
Eli Zaretskii [Sat, 4 Mar 2023 10:16:51 +0000 (12:16 +0200)]
Fix documentation of 'normal-mode' in buffers that don't visit files

* lisp/files.el (normal-mode):
* lisp/subr.el (run-mode-hooks):
* doc/emacs/modes.texi (Choosing Modes): Mention the caveat with
'normal-mode' in buffers not visiting files.  (Bug#61925)
* lisp/files.el (hack-local-variables): Doc fix.

21 months agoChange tree-sitter indent anchor 'point-min' to 'column-0'
Yuan Fu [Sat, 4 Mar 2023 09:09:00 +0000 (01:09 -0800)]
Change tree-sitter indent anchor 'point-min' to 'column-0'

Point-min isn't necessarily at column 0, using line-beginning-position
is better. column-0 is also more intuitive.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles):
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--indent-rules):
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--indent-rules): Change point-min to column-0.
* lisp/treesit.el (treesit-simple-indent-presets): Change point-min to
column-0.

21 months agoFix go-ts-mode multi-line string indentation (bug#61923)
Yuan Fu [Sat, 4 Mar 2023 08:37:03 +0000 (00:37 -0800)]
Fix go-ts-mode multi-line string indentation (bug#61923)

* lisp/progmodes/go-ts-mode.el:
(go-ts-mode--indent-rules): Add indent rule for multi-line sting.

21 months ago; More accurate doc strings for 'window-at' and 'window-at-x-y'.
Eli Zaretskii [Sat, 4 Mar 2023 08:43:25 +0000 (10:43 +0200)]
; More accurate doc strings for 'window-at' and 'window-at-x-y'.

* lisp/window.el (window-at-x-y):
* src/window.c (Fwindow_at): Doc fix.  (Bug#61948)

21 months agoRemove Eglot activation check from find-file-hook
João Távora [Sat, 4 Mar 2023 00:09:32 +0000 (00:09 +0000)]
Remove Eglot activation check from find-file-hook

Adding eglot--maybe-activate-editing-mode to find-file-hook isn't
really necessary, since it is already in
'after-change-major-mode-hook', and that also runs every time we find
a file.

This reduces the number of project.el logic that runs every time the
user visits a file.

* lisp/progmodes/eglot.el (find-file-hook): No need to add
eglot--maybe-activate-editing-mode here.

21 months ago* src/intervals.c (set_intervals_multibyte_1): Fix bug#61887
Stefan Monnier [Sat, 4 Mar 2023 00:13:03 +0000 (19:13 -0500)]
* src/intervals.c (set_intervals_multibyte_1): Fix bug#61887

When `total_length` is 0 there should be no subtree at all, but
`delete_interval` only deletes one interval, so make sure we don't end
up with some stale child of `i`.

21 months agoRevert inadvertent change to lisp/icomplete.el in previous commit
João Távora [Fri, 3 Mar 2023 23:36:26 +0000 (23:36 +0000)]
Revert inadvertent change to lisp/icomplete.el in previous commit

The change

   commit 3a651773d29afb48ac4229cd19e532bd57a4ee2d
   Author: João Távora <joaotavora@gmail.com>
   Date:   Fri Mar 3 13:13:35 2023 +0000

       Eglot: pay better attention to hints' paddingLeft/Right (bug#61924)

Inadvertently added a line to this file, which shouldn't (yet) bet
added.

* lisp/icomplete.el (icomplete--vertical-minibuffer-setup): Remove
truncate-lines.

21 months agoRevert previous change in go-ts-mode.el
Yuan Fu [Fri, 3 Mar 2023 21:59:54 +0000 (13:59 -0800)]
Revert previous change in go-ts-mode.el

Reverts 59365f928565f1be551b1697b9246b00cb87a9b7 and
56cd810b9d1a4d537bee5a2fd954d6e0d346631a.

Reverting because the use of treesit-ready-p is very much intentional.

* lisp/progmodes/go-ts-mode.el (treesit-ready-p): Revert change.

21 months agoRelease ERC 5.5
F. Jason Park [Tue, 14 Feb 2023 07:27:50 +0000 (23:27 -0800)]
Release ERC 5.5

* doc/misc/erc.texi: Update ERCVER to 5.5.
* lisp/erc/erc.el: Increment main version header to 5.5.  Update
Compat version in package-requires header to 29.1.3.4.  Update
`customize-package-emacs-version-alist' entry by mapping ERC 5.5 to
Emacs 29.1.
(erc-version): Update value to 5.5.

21 months ago; More doc improvements for OClosures
Eli Zaretskii [Fri, 3 Mar 2023 19:44:54 +0000 (21:44 +0200)]
; More doc improvements for OClosures

* doc/lispref/functions.texi (OClosures):
* doc/lispref/commands.texi (Using Interactive):
* etc/NEWS: Some more docs improvements for OClosures.

21 months agoDon't create GUI frames in batch sessions
Jim Porter [Tue, 28 Feb 2023 19:35:21 +0000 (11:35 -0800)]
Don't create GUI frames in batch sessions

This resolves an issue with running test/lisp/server-tests.el when
'DISPLAY' is set: the tests would start the Emacs server in a batch
session, and then request a new GUI frame.  However, that caused the
tests to terminate with SIGIO, since a batch Emacs doesn't set a SIGIO
handler.

Ref: <https://lists.gnu.org/archive/html/emacs-devel/2023-02/msg00879.html>

* lisp/frame.el (make-frame): Always create a terminal frame in batch
sessions.

21 months ago; Fix wrong error name in erc-server-908 doc string.
F. Jason Park [Fri, 3 Mar 2023 07:37:06 +0000 (23:37 -0800)]
; Fix wrong error name in erc-server-908 doc string.

* lisp/erc/erc-sasl.el (erc-server-908): Correct well-known name for
908 numeric in doc string.
(erc--register-connection): Fold overlong line.

21 months ago; * etc/ERC-NEWS: Mention more deprecations.
F. Jason Park [Fri, 3 Mar 2023 07:33:28 +0000 (23:33 -0800)]
; * etc/ERC-NEWS: Mention more deprecations.

21 months agoMinor copyedits of documentation of OClosures
Eli Zaretskii [Fri, 3 Mar 2023 13:23:22 +0000 (15:23 +0200)]
Minor copyedits of documentation of OClosures

* doc/lispref/functions.texi (OClosures): Improve wording,
indexing, and markup; add details.

21 months agoEglot: pay better attention to hints' paddingLeft/Right (bug#61924)
João Távora [Fri, 3 Mar 2023 13:13:35 +0000 (13:13 +0000)]
Eglot: pay better attention to hints' paddingLeft/Right (bug#61924)

* lisp/progmodes/eglot.el (eglot--update-hints-1): Consider
:json-false, which is a non-nil value.

21 months agoFix c-ts-mode indentation for statement after preproc (bug#61893)
Yuan Fu [Fri, 3 Mar 2023 03:59:11 +0000 (19:59 -0800)]
Fix c-ts-mode indentation for statement after preproc (bug#61893)

Originally our c-ts-mode--anchor-prev-sibling only specially handled
labeled_statements, now we add special case for preproc in the similar
fasion: instead of using the preproc directive as anchor, use the last
statement in that preproc as the anchor. Thus effectively ignore the
preproc.

There should be an accompanying test, but there are some problem in
the elif preproc directive indent so it would pass, we'll add the test
when that is fixed.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--anchor-prev-sibling): Add special case for preproc
directives.

21 months agoFix c/c++-ts-mode's mode lighter
Eli Zaretskii [Thu, 2 Mar 2023 19:34:22 +0000 (21:34 +0200)]
Fix c/c++-ts-mode's mode lighter

* lisp/progmodes/c-ts-mode.el (c-ts-mode-set-modeline): Remove
trailing blank from comment-start when indicating the comment
style on the mode line.

21 months agoEglot: use shell-file-name in eglot--cmd (bug#61748)
João Távora [Thu, 2 Mar 2023 13:27:14 +0000 (13:27 +0000)]
Eglot: use shell-file-name in eglot--cmd (bug#61748)

* lisp/progmodes/eglot.el (eglot--cmd): Use shell-file-name.

21 months agoAvoid signaling errors in url-basic-auth when password is nil
Eli Zaretskii [Thu, 2 Mar 2023 12:35:15 +0000 (14:35 +0200)]
Avoid signaling errors in url-basic-auth when password is nil

* lisp/url/url-auth.el (url-basic-auth): Handle nil PASS.
Suggested by Ellis Kenyo <me@elken.dev>.  (Bug#61411)

21 months agoFix wdired-tests on MS-Windows
Eli Zaretskii [Thu, 2 Mar 2023 12:21:33 +0000 (14:21 +0200)]
Fix wdired-tests on MS-Windows

* test/lisp/wdired-tests.el (wdired-test-bug32173-01)
(wdired-test-bug32173-02, wdired-test-unfinished-edit-01)
(wdired-test-bug39280): Run test-dir through file-truename, to
avoid failures due to MS-Windows "numeric tails" (mis)feature and
similar issues, which make file names fail to compare 'equal'.
(wdired-test-bug34915, wdired-test-bug61510): Skip if symlinks
fail.

21 months agoImprovements to xwidget on macOS (bug#60703)
Andrew De Angelis [Fri, 24 Feb 2023 03:47:41 +0000 (22:47 -0500)]
Improvements to xwidget on macOS (bug#60703)

* src/nsxwidget.m ()
([XwWebView initWithFrame:configuration:xwidget:])
(nsxwidget_init):  Fixed memory leaks: when sending an alloc
message to an object, send an autorelease message to any objects
we won't explictly release.
([XwWebView webView:didFinishNavigation:]): Second string to
store in 'store_xwidget_event_string' is "load finished" rather
than empty string.
([XwWebView webView:didStartProvisionalNavigation:])
([XwWebView webView:didReceiveServerRedirectForProvisionalNavigation:])
([XwWebView webView:didCommitNavigation:]): New functions.
(nsxwidget_webkit_estimated_load_progress): New function.
(nsxwidget_webkit_stop_loading): New function.
* src/xwidget.c (Fxwidget_webkit_estimated_load_progress): Call
'nsxwidget_webkit_estimated_load_progress' if we're on MacOS.
(Fxwidget_webkit_stop_loading): Call 'nsxwidget_webkit_stop_loading'
if we're on MacOS.
(syms_of_xwidget): Define symbol for function.
'xwidget_webkit_estimated_load_progress' if we're on MacOS.
* src/nsxwidget.h: Signature for functions
'nsxwidget_webkit_estimated_load_progress' and
'nsxwidget_webkit_stop_loading'.
* lisp/xwidget.el (xwidget-webkit-current-url): Message URL rather
than return value of 'kill-new' (which is always nil).

21 months ago; Avoid byte-compilation warning in c-ts-mode.el
Eli Zaretskii [Thu, 2 Mar 2023 07:33:04 +0000 (09:33 +0200)]
; Avoid byte-compilation warning in c-ts-mode.el

* lisp/progmodes/c-ts-mode.el (treesit-node-first-child-for-pos):
Declare.

21 months ago* lisp/progmodes/go-ts-mode.el: Use treesit-language-available-p.
Yuan Fu [Wed, 1 Mar 2023 22:38:22 +0000 (14:38 -0800)]
* lisp/progmodes/go-ts-mode.el: Use treesit-language-available-p.

treesit-ready-p does more checks than language grammar availability.

21 months agoDon’t signal warning when loading go-ts-mode.el without grammar
Yuan Fu [Wed, 1 Mar 2023 22:34:56 +0000 (14:34 -0800)]
Don’t signal warning when loading go-ts-mode.el without grammar

* lisp/progmodes/go-ts-mode.el: Add a QUIET flag to the call of
treesit-ready-p, so that it doesn't signal a warning if
go-mod (tree-sitter grammar) is not available.

21 months agoFix c-ts-mode empty line indentation (bug#61893)
Yuan Fu [Wed, 1 Mar 2023 22:01:47 +0000 (14:01 -0800)]
Fix c-ts-mode empty line indentation (bug#61893)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Make the
"rest sibling" matchers catch the case where NODE is nil, when
indenting an empty line.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

21 months agoImprove tree-sitter's prev-sibling indent anchor
Yuan Fu [Wed, 1 Mar 2023 21:55:53 +0000 (13:55 -0800)]
Improve tree-sitter's prev-sibling indent anchor

Now it handles the case where NODE is nil when indenting an empty
line: it tries to get the previous sibling nonetheless.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling):
* lisp/treesit.el (treesit-simple-indent-presets): Add an or form to
handle more cases.

21 months ago* lisp/icomplete.el (fido-mode): Enable in-buffer completion (bug#45763).
João Távora [Mon, 27 Feb 2023 18:40:48 +0000 (20:40 +0200)]
* lisp/icomplete.el (fido-mode): Enable in-buffer completion (bug#45763).

Backport:
(cherry picked from commit b5c13032538377b0037c745715613693a1580f81)

21 months ago* lisp/icomplete.el: Fix in-buffer completion.
Juri Linkov [Mon, 27 Feb 2023 18:32:53 +0000 (20:32 +0200)]
* lisp/icomplete.el: Fix in-buffer completion.

(icomplete-force-complete-and-exit, icomplete-force-complete): Use
'icomplete--field-beg/end' when not in the minibuffer to not erase
the current buffer.  Also disable 'completion-in-region-mode' instead
of calling 'exit-minibuffer' (bug#45764, bug#51575, bug#61479).

Backport:
(cherry picked from commit a7a984c0ebebb891e2052d8416544f0bd7002007)

21 months ago* src/profiler.c (malloc_probe): Make it safe for GC (bug#60237)
Stefan Monnier [Wed, 1 Mar 2023 17:36:58 +0000 (12:36 -0500)]
* src/profiler.c (malloc_probe): Make it safe for GC (bug#60237)

21 months ago* lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Fix bug#61847
Stefan Monnier [Wed, 1 Mar 2023 17:31:09 +0000 (12:31 -0500)]
* lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Fix bug#61847

The `noerror` arg of `require` doesn't do what Stefan naively thought
when he wrote this code, so use `condition-case` instead.
Also check for `cl-defmethod` since `cl-prin1` can't be loaded before
that anyway.

21 months agoRevert "Don't disable eldoc when doing edebug"
Eli Zaretskii [Wed, 1 Mar 2023 15:35:51 +0000 (17:35 +0200)]
Revert "Don't disable eldoc when doing edebug"

This reverts commit 6fd1fb8a6837acde8e1c9ab26618ec0f36121c72.
It turns out ElDoc does show messages inside Edebug, if you
are (un)lucky enough to have point where ElDoc has something
to show.  Bug#56459 needs to be fixed in some more complex
way.

21 months ago; Eglot: improve bug-reference-url-format/bug-reference-url-regexp
João Távora [Wed, 1 Mar 2023 13:24:07 +0000 (13:24 +0000)]
; Eglot: improve bug-reference-url-format/bug-reference-url-regexp

* lisp/progmodes/eglot.el (eglot--debbugs-or-github-bug-uri): New helper.

21 months agoEglot: work around Tramp instability bug#61350
João Távora [Wed, 1 Mar 2023 11:12:51 +0000 (11:12 +0000)]
Eglot: work around Tramp instability bug#61350

Unconditionally disable ControlMaster for the Eglot's Tramp
connection.

* lisp/progmodes/eglot.el (tramp-ssh-controlmaster-options)
(use-tramp-ssh-controlmaster-options): Forward declare
(eglot--connect): Set variables to unconditionally disable ControlMaster.

21 months agoFix treesit-indent-region
Yuan Fu [Wed, 1 Mar 2023 07:51:06 +0000 (23:51 -0800)]
Fix treesit-indent-region

Fix it for the case where there is no suitable rule for the line.
Right now treesit-indent-region would indent the line to column 0.
After the change the indentation is not altered.

* lisp/treesit.el (treesit-indent-region): Handle the case where
ANCHOR or OFFSET is nil specially.