]> git.eshelyaron.com Git - emacs.git/log
emacs.git
21 months ago; Whitespace cleanup feature/tramp-thread-safe
Michael Albinus [Sat, 4 Mar 2023 09:19:38 +0000 (10:19 +0100)]
; Whitespace cleanup

21 months agoMerge branch 'master' into feature/tramp-thread-safe
Michael Albinus [Sat, 4 Mar 2023 09:17:25 +0000 (10:17 +0100)]
Merge branch 'master' into feature/tramp-thread-safe

21 months agoRemove ineffective uses of condition-case
Mattias Engdegård [Fri, 3 Mar 2023 10:32:34 +0000 (11:32 +0100)]
Remove ineffective uses of condition-case

* lisp/gnus/message.el (message-setup-1):
* lisp/progmodes/cc-engine.el (c-forward-single-comment):
* lisp/progmodes/ruby-mode.el (ruby-add-log-current-method):
Eliminate uses of condition-case without handlers.  These seem to have
been there for quite a long time.  This change does not affect the
behaviour of the code and makes some warnings go away.

21 months agoMerge from origin/emacs-29
Stefan Kangas [Fri, 3 Mar 2023 05:30:12 +0000 (06:30 +0100)]
Merge from origin/emacs-29

9e105d483fa Fix c-ts-mode indentation for statement after preproc (bu...
a72a55e3e49 Fix c/c++-ts-mode's mode lighter
67befc1f5a5 Eglot: use shell-file-name in eglot--cmd (bug#61748)
1c7b2673bdd Avoid signaling errors in url-basic-auth when password is...
756225e3778 Fix wdired-tests on MS-Windows
a137f71c67e Improvements to xwidget on macOS (bug#60703)
3f43a16bc63 ; Avoid byte-compilation warning in c-ts-mode.el

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 agoFix `cond` miscompilation bug
Mattias Engdegård [Thu, 2 Mar 2023 08:56:59 +0000 (09:56 +0100)]
Fix `cond` miscompilation bug

This fixes a bug that miscompiled

  (cond ... C S1...Sn)

where S1...Sn are switch clauses (that can be compiled into a switch
op) and C a non-switch clause, by tucking on an extra copy of C at the
end.  This was a serious wrong-code bug when the condition of C had
side-effects; otherwise it was only a waste of time and space.

* lisp/emacs-lisp/bytecomp.el (byte-compile-cond): Fix.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.

21 months agoSmall unwind-protect optimisation improvement
Mattias Engdegård [Wed, 1 Mar 2023 18:37:52 +0000 (19:37 +0100)]
Small unwind-protect optimisation improvement

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Use the current for-effect mode when optimising the body form,
instead of always optimising it for value.

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 agoTramp cleanup
Michael Albinus [Thu, 2 Mar 2023 12:54:14 +0000 (13:54 +0100)]
Tramp cleanup

* lisp/net/tramp.el (tramp-handle-unlock-file): Raise a warning
only when `create-lockfiles'.

* test/lisp/net/tramp-tests.el (tramp-test26-file-name-completion):
Extend test.

21 months agoFix bootstrap failure
Po Lu [Thu, 2 Mar 2023 12:44:47 +0000 (20:44 +0800)]
Fix bootstrap failure

* lisp/man.el (Man-prefer-synchronous-call): Fix version
specification.

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 agoAdd option to keep some columns in dired-hide-details-mode
Augusto Stoffel [Sat, 25 Feb 2023 11:15:43 +0000 (12:15 +0100)]
Add option to keep some columns in dired-hide-details-mode

* lisp/dired.el (dired-hide-details-preserved-columns): New user
option.
(dired-insert-set-properties): Use it.  (Bug#61785)

21 months ago; Fix last change
Eli Zaretskii [Thu, 2 Mar 2023 11:28:28 +0000 (13:28 +0200)]
; Fix last change

* doc/emacs/programs.texi (Man Page): Improve wording.

* lisp/man.el (Man-prefer-synchronous-call): Fix quoting and
spelling.  (Bug#61552)

21 months agoAdd new user option Man-prefer-synchronous-call
Sebastian Tennant [Thu, 10 Mar 2022 08:36:04 +0000 (08:36 +0000)]
Add new user option Man-prefer-synchronous-call

* lisp/man.el (Man-getpage-in-background): Add new defcustom
Man-prefer-synchronous-call and modify #'Man-getpage-in-background.
Only call #'start-process when 'make-process satisfies #'fboundp AND
Man-prefer-synchronous-call is bound to nil.  (Bug#61552)

Copyright-paperwork-exempt: yes

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 agoAdd support for Zsh's case branches ;|.
Philippe Altherr [Sun, 15 Jan 2023 12:37:00 +0000 (13:37 +0100)]
Add support for Zsh's case branches ;|.

* lisp/progmodes/sh-script.el (sh-font-lock-paren)
(sh-smie-sh-grammar, sh-smie-sh-rules, sh-smie-rc-grammar):
Support case branches ending with ";|", per Zsh.  (Bug#60833)

* test/manual/indent/shell.sh (bar): Add ";|".

21 months agoUse 'sh-indent-for-continuation' for continued lines in 'sh-script-mode'
Philippe Altherr [Sat, 14 Jan 2023 04:22:26 +0000 (05:22 +0100)]
Use 'sh-indent-for-continuation' for continued lines in 'sh-script-mode'

* lisp/progmodes/sh-script.el (sh-smie--indent-continuation): Use
'sh-indent-for-continuation' instead of 'sh-basic-offset'.
(Bug#60832)

* test/lisp/progmodes/sh-script-tests.el
(test-indent-after-continuation): New test.

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 agoMerge from origin/emacs-29
Stefan Kangas [Thu, 2 Mar 2023 05:30:15 +0000 (06:30 +0100)]
Merge from origin/emacs-29

59365f92856 * lisp/progmodes/go-ts-mode.el: Use treesit-language-avai...
56cd810b9d1 Don’t signal warning when loading go-ts-mode.el without g...
b06d5519664 Fix c-ts-mode empty line indentation (bug#61893)
6b2720778dc Improve tree-sitter's prev-sibling indent anchor

21 months ago; Merge from origin/emacs-29
Stefan Kangas [Thu, 2 Mar 2023 05:30:15 +0000 (06:30 +0100)]
; Merge from origin/emacs-29

The following commits were skipped:

db50545e3e9 * lisp/icomplete.el (fido-mode): Enable in-buffer complet...
ef72e99e867 * lisp/icomplete.el: Fix in-buffer completion.

21 months agoMerge from origin/emacs-29
Stefan Kangas [Thu, 2 Mar 2023 05:30:15 +0000 (06:30 +0100)]
Merge from origin/emacs-29

07f3236133b * src/profiler.c (malloc_probe): Make it safe for GC (bug...
1f1d36fa808 * lisp/emacs-lisp/debug-early.el (debug-early-backtrace):...
99df815c153 Revert "Don't disable eldoc when doing edebug"
0a4b1c0102d ; Eglot: improve bug-reference-url-format/bug-reference-u...
40c9fc8e3b3 Eglot: work around Tramp instability bug#61350
4a6db125b9e Fix treesit-indent-region
7ef9a8210c9 Replace C++ comments with C style equivalents

21 months ago; * src/haikufont.c (haikufont_open): Remove unused variable.
Po Lu [Thu, 2 Mar 2023 03:07:37 +0000 (03:07 +0000)]
; * src/haikufont.c (haikufont_open): Remove unused variable.

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 agoMake Tramp file name completion more quiet
Michael Albinus [Wed, 1 Mar 2023 16:07:59 +0000 (17:07 +0100)]
Make Tramp file name completion more quiet

* lisp/net/tramp-sh.el (tramp-perl-file-name-all-completions):
Don't print status message.
(tramp-sh-handle-file-name-all-completions): Return nil when check
fails.  (Bug#61890)

* test/lisp/net/tramp-tests.el
(tramp-test26-file-name-completion-with-perl):
(tramp-test26-file-name-completion-with-ls): New tests.

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 agoSimplify effect-free code elimination
Mattias Engdegård [Wed, 1 Mar 2023 12:37:06 +0000 (13:37 +0100)]
Simplify effect-free code elimination

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Simplify overly defensive code.  This does not affect code generation.

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.

21 months agoReplace C++ comments with C style equivalents
Po Lu [Wed, 1 Mar 2023 06:28:04 +0000 (14:28 +0800)]
Replace C++ comments with C style equivalents

* src/alloc.c (Fmake_byte_code, purecopy):
* src/bytecode.c (exec_byte_code):
* src/xdisp.c (face_at_pos): Do not use C++-style comments!

21 months ago; Merge from origin/emacs-29
Stefan Kangas [Wed, 1 Mar 2023 05:30:20 +0000 (06:30 +0100)]
; Merge from origin/emacs-29

The following commit was skipped:

ec1dea7b43f ; Auto-commit of loaddefs files.

21 months agoMerge from origin/emacs-29
Stefan Kangas [Wed, 1 Mar 2023 05:30:20 +0000 (06:30 +0100)]
Merge from origin/emacs-29

97a83ff31fa Eglot: fix M-x eglot-show-workspace-configuration (bug#61...
48a0804d10d ruby-mode: Fix method call indentation in rhs of multiple...
16d012cf3bd * lisp/net/tramp.el (tramp-remote-path): Improve docstring.
b371697cdca Minor change in 'dired--find-possibly-alternative-file'
c2b5c6acc58 Implement prefix arg for 'c-ts-mode-toggle-comment-style'
eb2ab52fb01 Defaults to zero for image-dired--number-of-thumbnails
5dc163f592a ; Add a doc string for 'ediff-window-display-p' obsolescence

21 months agoUpdate SKK-JISYO.L from upstream
Stefan Kangas [Wed, 1 Mar 2023 05:00:53 +0000 (06:00 +0100)]
Update SKK-JISYO.L from upstream

* leim/SKK-DIC/SKK-JISYO.L: Update from
https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.L

21 months agoUpdate publicsuffix.txt from upstream
Stefan Kangas [Wed, 1 Mar 2023 05:00:51 +0000 (06:00 +0100)]
Update publicsuffix.txt from upstream

* etc/publicsuffix.txt: Update from
https://publicsuffix.org/list/public_suffix_list.dat
dated 2023-02-28 02:16:27 UTC.

21 months ago; Auto-commit of loaddefs files.
Stefan Kangas [Wed, 1 Mar 2023 04:08:22 +0000 (05:08 +0100)]
; Auto-commit of loaddefs files.

21 months ago; Auto-commit of loaddefs files.
Stefan Kangas [Wed, 1 Mar 2023 04:07:53 +0000 (05:07 +0100)]
; Auto-commit of loaddefs files.

21 months agoEglot: fix M-x eglot-show-workspace-configuration (bug#61866)
João Távora [Wed, 1 Mar 2023 01:22:15 +0000 (01:22 +0000)]
Eglot: fix M-x eglot-show-workspace-configuration (bug#61866)

Now consult .dir-locals.el every time the workspace configuration is
needed:

- workspace/configuration server request
- workspace/didChangeConfiguration signal
- M-x eglot-show-workspace-configuration

The major-mode/hack-dir-local-variables-non-file-buffer trick is used.
When there is more than one, the server connection's "main" major mode
is used to find the relevant .dir-locals.el section.

* lisp/progmodes/eglot.el (eglot--lookup-mode): Fix docstring.
(eglot--connect): Simplify.
(eglot-show-workspace-configuration): Fix.
(eglot--workspace-configuration): Remove.
(eglot--workspace-configuration-plist): Rework.
(eglot-handle-request): Simplify.

21 months agoruby-mode: Fix method call indentation in rhs of multiple assignment
Dmitry Gutov [Tue, 28 Feb 2023 21:00:42 +0000 (23:00 +0200)]
ruby-mode: Fix method call indentation in rhs of multiple assignment

* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Special-case
assignment that follows a comma-separated list (bug#61871).

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

21 months agoFix some useless condition-case forms
Mattias Engdegård [Tue, 28 Feb 2023 16:07:06 +0000 (17:07 +0100)]
Fix some useless condition-case forms

* lisp/progmodes/cperl-mode.el (cperl-calculate-indent):
* lisp/progmodes/verilog-mode.el (verilog--suppressed-warnings):
Add error handler, seemingly the intention here.
* lisp/url/url-gw.el (url-open-stream): Remove condition-case;
it was neutered in 2006.

21 months ago* lisp/net/tramp.el (tramp-remote-path): Improve docstring.
Michael Albinus [Tue, 28 Feb 2023 15:42:11 +0000 (16:42 +0100)]
* lisp/net/tramp.el (tramp-remote-path): Improve docstring.

21 months agoImprove warning in tramp-handle-unlock-file
Michael Albinus [Tue, 28 Feb 2023 14:33:52 +0000 (15:33 +0100)]
Improve warning in tramp-handle-unlock-file

* lisp/net/tramp.el (tramp-connectable-p): Simplify.
(tramp-handle-unlock-file): Improve warning.

21 months agoMinor change in 'dired--find-possibly-alternative-file'
Felix [Sun, 26 Feb 2023 13:14:59 +0000 (14:14 +0100)]
Minor change in 'dired--find-possibly-alternative-file'

* lisp/dired.el (dired--find-possibly-alternative-file): Don't
kill the buffer if the directory is shown in other windows.

Copyright-paperwork-exempt: yes

21 months agoImplement prefix arg for 'c-ts-mode-toggle-comment-style'
Felix [Mon, 27 Feb 2023 15:15:02 +0000 (16:15 +0100)]
Implement prefix arg for 'c-ts-mode-toggle-comment-style'

* lisp/progmodes/c-ts-mode.el (c-ts-mode-toggle-comment-style):
Actually implement the optional numeric arg mentioned in the
docstring.

Copyright-paperwork-exempt: yes

21 months agoDefaults to zero for image-dired--number-of-thumbnails
Manuel Giraud [Thu, 23 Feb 2023 15:42:48 +0000 (16:42 +0100)]
Defaults to zero for image-dired--number-of-thumbnails

* lisp/image/image-dired.el (image-dired--number-of-thumbnails):
Defaults zero to avoid wrong type argument error.  (Bug#61734)

21 months ago; Add a doc string for 'ediff-window-display-p' obsolescence
Eli Zaretskii [Tue, 28 Feb 2023 13:15:27 +0000 (15:15 +0200)]
; Add a doc string for 'ediff-window-display-p' obsolescence

* lisp/vc/ediff-init.el (ediff-window-display-p): Document how to
prevent Ediff from creating additional frames, now that this
function can no longer be used or advised for that.  (Bug#61850)

21 months agoMerge from origin/emacs-29
Stefan Kangas [Tue, 28 Feb 2023 05:30:13 +0000 (06:30 +0100)]
Merge from origin/emacs-29

613de662811 Rename the newly added -ref- faces to -use-
f601e9666d8 Eglot: support multiple labels in same inlay hint
4a5eda7ed2a Eglot: don't paint hints outside requested region (bug#61...
11c1aa1eb12 ; * doc/misc/gnus.texi: Fix last change.
44949c292f9 ; Add `nnimap-user' to Gnus manual
6c7078c66f4 ; * lisp/progmodes/c-ts-mode.el (treesit-node-prev-siblin...
3d0a6c9baa6 Eglot: protect against unintended field text motion (bug#...
647e40f4a0c ; And yet another fix to eglot-current-linepos-function's...
9d0f856a167 Fix description of 'desktop-save-mode'
aee10ca1cbe Adjust tree-sitter defun navigation (bug#61617)
edf5b976869 Simplify c-ts-mode--top-level-label-matcher
0f15286c539 New tree-sitter indent anchor standalone-parent used by c...

# Conflicts:
# etc/NEWS

21 months agoRename the newly added -ref- faces to -use-
Dmitry Gutov [Tue, 28 Feb 2023 02:07:55 +0000 (04:07 +0200)]
Rename the newly added -ref- faces to -use-

* lisp/font-lock.el (font-lock-variable-use-face)
(font-lock-property-use-face): Rename from font-lock-variable-ref-face
and font-lock-property-ref-face.  Update all references (bug#61655).

21 months agoNew user option 'grep-use-headings'
Augusto Stoffel [Wed, 7 Dec 2022 17:44:07 +0000 (18:44 +0100)]
New user option 'grep-use-headings'

* lisp/progmodes/grep.el (grep-heading-regexp): New user option.
(grep-heading): New face (bug#59888).
(grep--heading-format, grep--heading-state, grep--heading-filter):
Filter function for grep processes and supporting variables.
(grep-use-headings): New user option.
(grep-mode): Use the above, if applicable.

21 months agoIntroduce 'compilation-annotation' text property
Augusto Stoffel [Thu, 8 Dec 2022 20:05:10 +0000 (21:05 +0100)]
Introduce 'compilation-annotation' text property

It is meant to mark parts of compilation buffers which do not
correspond to process output (bug#59888).

* lisp/progmodes/compile.el (compilation-insert-annotation): New
function.
(compilation-start, compilation-handle-exit): Use it.
(compilation--ensure-parse) Rely on 'compilation-annotation' property
instead of 'compilation-header-end'.

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

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

21 months agoEglot: support multiple labels in same inlay hint
João Távora [Mon, 27 Feb 2023 14:54:53 +0000 (14:54 +0000)]
Eglot: support multiple labels in same inlay hint

Mainly the rust-analyzer LSP server uses this.  There are still more
things we could support, like tooltips and stuff.

* lisp/progmodes/eglot.el (lsp-interface-alist): Add
InlayHintLabelPart.
(eglot--update-hints-1): Support multiple labels for same hint.

21 months agoEglot: don't paint hints outside requested region (bug#61812)
João Távora [Mon, 27 Feb 2023 14:23:35 +0000 (14:23 +0000)]
Eglot: don't paint hints outside requested region (bug#61812)

* lisp/progmodes/eglot.el (eglot--lambda): Add cl-block.
(eglot--update-hints-1): Return early if hint is outside the
requested inlay hint range.

21 months agoAdjust some `pure` and `side-effect-free` function declarations
Mattias Engdegård [Sun, 26 Feb 2023 15:56:24 +0000 (16:56 +0100)]
Adjust some `pure` and `side-effect-free` function declarations

* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns):
Add `format-message` and `substring-no-properties`.
* lisp/subr.el (number-sequence, copy-tree, looking-at-p)
(string-match-p, string-trim-right, string-lines):
Declare side-effect-free.
(syntax-class, version-list-<, version-list-=, version-list-<=)
(version-list-not-zero): Declare pure and side-effect-free.
(ensure-list): Declare side-effect-free and error-free.
(string-equal-ignore-case): Remove `pure` declaration.
We may want it to be pure but right now it's not.

21 months agoWarn about `condition-case` without handlers
Mattias Engdegård [Mon, 27 Feb 2023 12:57:48 +0000 (13:57 +0100)]
Warn about `condition-case` without handlers

Omitting handlers from a `condition-case` form makes it useless
since no errors are caught.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): New warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
* etc/NEWS: Announce.

21 months ago; * doc/misc/gnus.texi: Fix last change.
Eli Zaretskii [Mon, 27 Feb 2023 12:32:57 +0000 (14:32 +0200)]
; * doc/misc/gnus.texi: Fix last change.

21 months ago; Add `nnimap-user' to Gnus manual
Arash Esbati [Mon, 27 Feb 2023 09:10:13 +0000 (10:10 +0100)]
; Add `nnimap-user' to Gnus manual

* doc/misc/gnus.texi (Customizing the IMAP Connection): Document
backend variable `nnimap-user' which was introduced with commit
5e68f8614f in 2011.
Add index entries for all backend variables.  (bug#61837)

21 months ago; * lisp/progmodes/c-ts-mode.el (treesit-node-prev-sibling): Declare.
Eli Zaretskii [Mon, 27 Feb 2023 12:11:13 +0000 (14:11 +0200)]
; * lisp/progmodes/c-ts-mode.el (treesit-node-prev-sibling): Declare.

21 months agoEglot: protect against unintended field text motion (bug#61726)
João Távora [Mon, 27 Feb 2023 11:29:32 +0000 (11:29 +0000)]
Eglot: protect against unintended field text motion (bug#61726)

Suggested-by: Augusto Stoffel <arstoffel@gmail.com>
* lisp/progmodes/eglot.el (eglot--bol): New helper.
(eglot-utf-8-linepos, eglot-utf-16-linepos)
(eglot-utf-32-linepos, eglot-move-to-utf-8-linepos)
(eglot-move-to-utf-16-linepos, eglot-move-to-utf-32-linepos)
(eglot-handle-notification, eglot--xref-make-match)
(eglot-completion-at-point): Use it.

21 months ago; And yet another fix to eglot-current-linepos-function's docstring
João Távora [Mon, 27 Feb 2023 11:04:44 +0000 (11:04 +0000)]
; And yet another fix to eglot-current-linepos-function's docstring

bug#61726

* lisp/progmodes/eglot.el (eglot-current-linepos-function):
Another fix.

21 months agoFix description of 'desktop-save-mode'
Eli Zaretskii [Mon, 27 Feb 2023 11:31:47 +0000 (13:31 +0200)]
Fix description of 'desktop-save-mode'

* doc/emacs/misc.texi (Saving Emacs Sessions): Adjust to changes
in 'desktop-path'.  Reported by Petteri Hintsanen <petterih@iki.fi>.

21 months ago* lisp/calc/calc.el (calcDigit-backspace): Hush warning.
Mattias Engdegård [Mon, 27 Feb 2023 09:40:11 +0000 (10:40 +0100)]
* lisp/calc/calc.el (calcDigit-backspace): Hush warning.

21 months agoImprove delete-consecutive-dups doc precision and add test
Mattias Engdegård [Sun, 26 Feb 2023 13:34:58 +0000 (14:34 +0100)]
Improve delete-consecutive-dups doc precision and add test

* lisp/subr.el (delete-consecutive-dups): Document which element of
each run is retained (the earliest in the list).  This matters because
it makes it safe to ignore the return value.
* test/lisp/subr-tests.el (subr--delete-dups)
(subr--delete-consecutive-dups): Add tests.

21 months agoAdjust tree-sitter defun navigation (bug#61617)
Yuan Fu [Mon, 27 Feb 2023 08:14:32 +0000 (00:14 -0800)]
Adjust tree-sitter defun navigation (bug#61617)

Before this change, when you use a tree-sitter navigation function to
move to the next beginning of a thing, it jumps over the immediate
next thing and lands you at the beginning of the next-next thing.

Eg, when point is at the "|", and we evaluate
(treesit--navigate-thing pos 1 'beg), we go from

|  (thing) (thing)

to

   (thing) |(thing)

But some might expect point to go to

   |(thing) (thing)

instead, which makes sense.  Also, that's how Emacs expect defun
navigation functions to work.  The discrepancy in expectation causes
bug#61617.

In this change I made tree-sitter navigation functions to work as what
Emacs expects.  And what I described for moving to the next beginning
of thing is similarly applicable to moving to the end of previous end
of thing.

* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Handle the case where defun-skipper moves
point back to where we started, by adding a retry.

(treesit--navigate-thing): Add a single condition checking for
progress to the condition form responsible for checking whether to
skip the next defun.  Namely (eq pos (funcall advance next)))).

* test/src/treesit-tests.el:
(treesit--ert-defun-navigation-nested-master)
(treesit--ert-defun-navigation-top-level-master): Change tests to
reflect the new expectation.

21 months agoSimplify c-ts-mode--top-level-label-matcher
Yuan Fu [Mon, 27 Feb 2023 02:24:49 +0000 (18:24 -0800)]
Simplify c-ts-mode--top-level-label-matcher

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--top-level-label-matcher): Make more assumptions and remove
the loop, so it's faster in large files.

21 months agoNew tree-sitter indent anchor standalone-parent used by c-ts-mode
Yuan Fu [Mon, 27 Feb 2023 02:05:13 +0000 (18:05 -0800)]
New tree-sitter indent anchor standalone-parent used by c-ts-mode

When writing c-ts-mode Theo used parent-bol which works well except
one case:

1 for (int i=0;
2      i < 5;
3      i++) {
4   func(i);
5 }

In this case, when indenting "func(i)", parent-bol returns the start
of "i++" on line 3, instead of the "correct" anchor, the start of
"for" on line 1.  parent-bol would have worked if the "for (...) {"
part is in one line.

To support this case I tried numerous things and added a bunch of
stuff, culminating in c-ts-common-statement-offset.  It's complicated,
requires extra setup, and slow.

Not anymore! I think the new anchor standalone-parent really captures
the logic behind how people expect indentation to work. It's simple
and fast, and requires no setup.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--standalone-grandparent): New anchor.
(c-ts-mode--indent-styles): Replace c-ts-common-statement-offset with
standalone-parent.
(c-ts-base-mode): Add comment.

* lisp/treesit.el:
(treesit-simple-indent-presets): New anchor standalone-parent.

21 months agoMerge from origin/emacs-29
Stefan Kangas [Mon, 27 Feb 2023 05:30:20 +0000 (06:30 +0100)]
Merge from origin/emacs-29

267fc6d00c4 ruby-smie-rules: Fix misindentation of a method call afte...
0fde314f6f6 * lib-src/etags.c (process_file_name): Free malloc'ed var...
dde9d149af3 ; Improve documentation of loading *.eln files
7c552be89da ; Another doc fix in eglot.el
75c65fcc98e ; Fix last change
a3d15c1f749 ; Fix last change
ca79b138d42 Eglot: rename and redocument encoding-related functions (...
3e3e6d71be7 Eglot: support positionEncoding LSP capability (bug#61726)
b0e87e930e8 Eglot: use faster strategy for moving to LSP positions (b...
5b174b96834 Fix mule-tests in UTF-8 locales
5256392a7ec Fix 'vertical-motion' when display strings are around
0db88d625a7 ; * src/treesit.c (treesit_predicate_match): Fix typo.

21 months agoruby-smie-rules: Fix misindentation of a method call after assignment
Dmitry Gutov [Mon, 27 Feb 2023 00:05:56 +0000 (02:05 +0200)]
ruby-smie-rules: Fix misindentation of a method call after assignment

* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Fix indentation of a
method call after assignment with ruby-after-operator-indent=nil
(bug#61822).

* test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb:
Add corresponding example.

21 months ago* lib-src/etags.c (process_file_name): Free malloc'ed vars (bug#61819).
Eli Zaretskii [Sun, 26 Feb 2023 18:03:20 +0000 (20:03 +0200)]
* lib-src/etags.c (process_file_name): Free malloc'ed vars (bug#61819).

21 months ago; Improve documentation of loading *.eln files
Eli Zaretskii [Sun, 26 Feb 2023 17:51:59 +0000 (19:51 +0200)]
; Improve documentation of loading *.eln files

* doc/lispref/loading.texi (How Programs Do Loading):
* doc/emacs/building.texi (Lisp Libraries): Some additional
details about what happens with natively-compiled files.

21 months ago; Another doc fix in eglot.el
Eli Zaretskii [Sun, 26 Feb 2023 14:48:07 +0000 (16:48 +0200)]
; Another doc fix in eglot.el

* lisp/progmodes/eglot.el (eglot-current-linepos-function):
Another doc fix.

21 months agoTramp: Do not unlock when connection is broken
Michael Albinus [Sun, 26 Feb 2023 14:40:30 +0000 (15:40 +0100)]
Tramp: Do not unlock when connection is broken

* lisp/net/tramp.el (tramp-handle-unlock-file): Do not unlock when
connection is broken.  (Bug#61663)

* test/lisp/net/tramp-tests.el (tramp-test39-make-lock-file-name):
Extend test.

21 months ago; Fix last change
João Távora [Sun, 26 Feb 2023 14:05:07 +0000 (14:05 +0000)]
; Fix last change

bug#61726

* lisp/progmodes/eglot.el (eglot-current-linepos-function): Fix docstring.

21 months ago; Fix last change
Eli Zaretskii [Sun, 26 Feb 2023 13:24:11 +0000 (15:24 +0200)]
; Fix last change

* lisp/progmodes/eglot.el (eglot-current-linepos-function)
(eglot-utf-8-linepos, eglot-utf-16-linepos)
(eglot-utf-32-linepos, eglot-move-to-linepos-function)
(eglot-move-to-utf-8-linepos, eglot-move-to-utf-32-linepos): Doc
fixes.  (Bug#61726)

21 months agoEglot: rename and redocument encoding-related functions (bug#61726)
João Távora [Sun, 26 Feb 2023 12:50:42 +0000 (12:50 +0000)]
Eglot: rename and redocument encoding-related functions (bug#61726)

* lisp/progmodes/eglot.el (eglot-current-column): Obsolete.
(eglot-lsp-abiding-column): Obsolete.
(eglot-current-column-function): Obsolete.
(eglot-current-linepos-function): Rename from eglot-current-column-function.
(eglot-utf-8-linepos): Rename from eglot-bytewise-column.
(eglot-utf-16-linepos): Rename from eglot-lsp-abiding-column.
(eglot-utf-32-linepos): Rename from eglot-current-column.
(eglot-move-to-current-column): Obsolete.
(eglot-move-to-lsp-abiding-column): Obsolete.
(eglot-move-to-column-function): Obsolete.
(eglot-move-to-linepos-function): Rename from eglot-move-to-column-function.
(eglot-move-to-utf-8-linepos): Rename from eglot-move-to-bytewise-column.
(eglot-move-to-utf-16-linepos): Rename from eglot-move-to-lsp-abiding-column.
(eglot-move-to-utf-32-linepos): Rename from eglot-move-to-current-column.
(eglot--managed-mode): Adjust.
(eglot-client-capabilities): Trim whitespace.

* test/lisp/progmodes/eglot-tests.el (eglot-test-lsp-abiding-column)
(eglot-test-lsp-abiding-column-1): Use new function/variable names.

21 months agoEglot: support positionEncoding LSP capability (bug#61726)
Augusto Stoffel [Sun, 26 Feb 2023 11:47:32 +0000 (11:47 +0000)]
Eglot: support positionEncoding LSP capability (bug#61726)

* lisp/progmodes/eglot.el(eglot-client-capabilities):  Announce the
new capability.
(eglot-bytewise-column, eglot-move-to-bytewise-column): New functions.
(eglot--managed-mode): Set 'eglot-current-column-function' and
'eglot-move-to-bytewise-column' appropriately.

21 months agoEglot: use faster strategy for moving to LSP positions (bug#61726)
Eli Zaretskii [Sun, 26 Feb 2023 10:27:18 +0000 (10:27 +0000)]
Eglot: use faster strategy for moving to LSP positions (bug#61726)

Turns out we don't need encode-coding-region after all.

* lisp/progmodes/eglot.el (eglot-move-to-lsp-abiding-column): Rewrite.

Co-authored-by: Augusto Stoffel <arstoffel@gmail.com>
21 months agoFix mule-tests in UTF-8 locales
Eli Zaretskii [Sun, 26 Feb 2023 09:46:20 +0000 (11:46 +0200)]
Fix mule-tests in UTF-8 locales

* test/lisp/international/mule-tests.el
(sgml-html-meta-no-post-less-than-10lines): Fix test condition.

21 months agoFix 'vertical-motion' when display strings are around
Eli Zaretskii [Sun, 26 Feb 2023 09:34:14 +0000 (11:34 +0200)]
Fix 'vertical-motion' when display strings are around

* src/indent.c (Fvertical_motion): Correct bidi-related condition
for character position, when we didn't move vertically.  (Bug#61636)

21 months ago; * src/treesit.c (treesit_predicate_match): Fix typo.
Yuan Fu [Sun, 26 Feb 2023 09:12:18 +0000 (01:12 -0800)]
; * src/treesit.c (treesit_predicate_match): Fix typo.

21 months agoDisable xattr test on MS-Windows.
Paul Eggert [Sat, 25 Feb 2023 23:38:38 +0000 (15:38 -0800)]
Disable xattr test on MS-Windows.

* nt/mingw-cfg.site (enable_xattr): Set to "no".  (Bug#61782)

21 months agoFix the MS-DOS build
Po Lu [Sun, 26 Feb 2023 06:42:14 +0000 (14:42 +0800)]
Fix the MS-DOS build

* msdos/sedlibmk.inp: Update getopt.h conditions.

21 months agoMerge from origin/emacs-29
Stefan Kangas [Sun, 26 Feb 2023 05:30:12 +0000 (06:30 +0100)]
Merge from origin/emacs-29

3cae0e3d96a python-ts-mode: Fix single-quote string fontification
68d753e3712 ; * etc/NEWS: Fix typos.
ab0cc4e7811 Fix infloop in bidi.c
3b8b23f66df ; Fix doc string of 'emacs-lisp-byte-compile'

# Conflicts:
# etc/NEWS

21 months agoBe more cautious in completing Eshell variable assignments
Jim Porter [Sat, 25 Feb 2023 05:49:54 +0000 (21:49 -0800)]
Be more cautious in completing Eshell variable assignments

Previously, Eshell treated cases like the second argument in "tar
--directory=dir" as a variable assignment, but that prevented
'pcomplete/tar' from implementing its own completion for that
argument (bug#61778).

* lisp/eshell/esh-var.el (eshell-complete-variable-assignment): Only
handle completion when all initial arguments are variable assignments.

* test/lisp/eshell/em-cmpl-tests.el
(em-cmpl-test/variable-assign-completion/non-assignment): New test.

21 months ago(bytecomp-warn--ignore): New test
Stefan Monnier [Sun, 26 Feb 2023 03:34:02 +0000 (22:34 -0500)]
(bytecomp-warn--ignore): New test

Add tests for the interaction of `ignore` with warnings.

* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-warn--ignore): New test.
(bytecomp--with-warning-test): Really make it a function.

21 months agoOmit no-longer-needed SEEK_END workaround
Paul Eggert [Sun, 26 Feb 2023 01:13:00 +0000 (17:13 -0800)]
Omit no-longer-needed SEEK_END workaround

* lib-src/ebrowse.c (SEEK_END): Remove; no longer needed
on any supported SunOS version.

21 months agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sun, 26 Feb 2023 01:01:22 +0000 (17:01 -0800)]
Update from Gnulib by running admin/merge-gnulib

21 months agopython-ts-mode: Fix single-quote string fontification
Dmitry Gutov [Sun, 26 Feb 2023 01:09:29 +0000 (03:09 +0200)]
python-ts-mode: Fix single-quote string fontification

* lisp/progmodes/python.el (python--treesit-fontify-string):
Look for ', not just ", as opening delimiter (bug#61796).

21 months agobytecomp--with-warning-test: Make it a function
Stefan Monnier [Sat, 25 Feb 2023 22:45:40 +0000 (17:45 -0500)]
bytecomp--with-warning-test: Make it a function

* lisp/emacs-lisp/bytecomp.el (bytecomp--with-warning-test):
Make it a function.

21 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Sat, 25 Feb 2023 17:45:14 +0000 (18:45 +0100)]
; * etc/NEWS: Fix typos.

21 months agoFix infloop in bidi.c
Eli Zaretskii [Sat, 25 Feb 2023 15:19:15 +0000 (17:19 +0200)]
Fix infloop in bidi.c

* src/bidi.c (bidi_set_paragraph_end): Reset the isolate_level to
zero.  Whenever stack_idx is reset to zero, the isolate_level must
also be reset, since there cannot be any isolate status outside of
embeddings.  Failure to reset isolate_level will cause us infloop
when we see a PDI.  Reported by Matt Beshara <m@mfa.pw>.