]> git.eshelyaron.com Git - emacs.git/log
emacs.git
14 months agoSpeed up duplicate-dwim and duplicate-line by another factor 10
Mattias Engdegård [Wed, 28 Jun 2023 12:36:39 +0000 (14:36 +0200)]
Speed up duplicate-dwim and duplicate-line by another factor 10

* lisp/misc.el (duplicate--insert-copies): New.
(duplicate-line, duplicate-dwim): Call it.

14 months agoMerge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs
Stefan Monnier [Tue, 27 Jun 2023 20:14:43 +0000 (16:14 -0400)]
Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs

14 months agocl-macs-tests.el (cl-&key-arguments): Fix regression
Stefan Monnier [Tue, 27 Jun 2023 20:14:32 +0000 (16:14 -0400)]
cl-macs-tests.el (cl-&key-arguments): Fix regression

* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Turn "cannot use
lexical var" errors into warnings.
Make the obey `with-suppressed-warnings`.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments):
Suppress warnings.

14 months agoAmend the handling of c-laomib-cache.
Alan Mackenzie [Tue, 27 Jun 2023 20:11:48 +0000 (20:11 +0000)]
Amend the handling of c-laomib-cache.

There was unstable syntactic analysis of lines which were brace
lists.  This fixes bug#64133.

* lisp/progmodes/cc-engine.el (c-laomib-cache): Allow several
entries with the same LIM element corresponding to distinct
scanning regions.
(c-laomib-get-cache): Add new parameter START.  Adjust to be
able to have entries with the same LIM element and handle them
correctly.
(c-laomib-put-cache): Amend the handling of cache entries with
the same LIM element.
(c-looking-at-or-maybe-in-bracelist): Supply the needed new
argument to c-laomib-get-cache.  Add in a new call to
c-laomib-put-cache.

14 months agoSpeed up duplicate-line by a factor of 2
Mattias Engdegård [Tue, 27 Jun 2023 15:00:11 +0000 (17:00 +0200)]
Speed up duplicate-line by a factor of 2

* lisp/misc.el (duplicate-line): Add the newline to the string to be
inserted instead of inserting it separately.
This makes duplicate-line as fast as duplicate-dwim with a contiguous
region.  Both could easily be made faster yet by making the code more
complex.

14 months agoFix dired-insert-directory wrt remote directories
Michael Albinus [Tue, 27 Jun 2023 10:46:49 +0000 (12:46 +0200)]
Fix dired-insert-directory wrt remote directories

* lisp/dired.el (dired-insert-directory): Respect remote
directories consequently.

14 months agostartup.el: Don't override init.el custom of `debug-ignored-errors`
Stefan Monnier [Mon, 26 Jun 2023 15:25:14 +0000 (11:25 -0400)]
startup.el: Don't override init.el custom of `debug-ignored-errors`

* lisp/startup.el (startup--load-user-init-file): Undo commit 4302bc9b0f12.
Mimic the code we use for `debug-on-error` instead.

14 months agoFix Tramp mount-spec
Michael Albinus [Mon, 26 Jun 2023 13:48:48 +0000 (15:48 +0200)]
Fix Tramp mount-spec

* lisp/net/tramp-fuse.el (tramp-fuse-mounted-p): The mount-spec
could contain an optional trailing slash.  (Bug#64278)

* lisp/net/tramp-rclone.el (tramp-rclone-handle-file-system-info):
Check return code of command.

14 months agoCC Mode: Fix parenthesis bug in XEmacs part of macro
Alan Mackenzie [Mon, 26 Jun 2023 13:25:45 +0000 (13:25 +0000)]
CC Mode: Fix parenthesis bug in XEmacs part of macro

* lisp/progmodes/cc-defs.el (c-looking-at-non-alphnumspace):
Correct confused parentheses.

14 months ago; * doc/misc/erc.texi: Mention ERC's own mailing list.
F. Jason Park [Sun, 25 Jun 2023 13:43:56 +0000 (06:43 -0700)]
; * doc/misc/erc.texi: Mention ERC's own mailing list.

14 months agoAvoid "shadows" warning from erc-button--nick slots
F. Jason Park [Sun, 25 Jun 2023 13:15:11 +0000 (06:15 -0700)]
Avoid "shadows" warning from erc-button--nick slots

* lisp/erc/erc-button.el (erc-button-nick): Rename slots that share
names with user options to avoid "lexical argument shadows the dynamic
variable" warning.
(erc-button-add-nickname-buttons): Remove "erc-button-" namespace from
slot accessors.

14 months agoRevert "Allow erc-reuse-frames to favor connections"
F. Jason Park [Tue, 20 Jun 2023 06:14:40 +0000 (23:14 -0700)]
Revert "Allow erc-reuse-frames to favor connections"

This (mostly) reverts commit 0e4c07dc7448aafd2aa5f6e101d7b7aac23d8a6b.

* etc/ERC-NEWS: Also revert hunk from 52c8d537 "* etc/ERC-NEWS: Add
section for ERC 5.6." because it announced this feature, which no
longer exists.
* lisp/erc/erc.el (erc-reuse-frames): Revise doc string instead of
reverting completely.  (Bug#62833)

14 months agoMerge remote-tracking branch 'refs/remotes/origin/master'
Stefan Monnier [Sun, 25 Jun 2023 15:39:01 +0000 (11:39 -0400)]
Merge remote-tracking branch 'refs/remotes/origin/master'

14 months agocl-macs.el: Silence recent new "lexical arg shadows" warnings
Stefan Monnier [Sun, 25 Jun 2023 15:38:40 +0000 (11:38 -0400)]
cl-macs.el: Silence recent new "lexical arg shadows" warnings

* lisp/emacs-lisp/cl-macs.el (cl--slet): Add `nowarn` arg.
(cl--defsubst-expand): Use it.
(cl-defstruct): Silence warnings abour lexical shadowing when a slot's
name happens to be the same as a dynbound var.

14 months agoAllow suppressing the "lexical arg shadows dynbound var" warning
Stefan Monnier [Sun, 25 Jun 2023 15:11:03 +0000 (11:11 -0400)]
Allow suppressing the "lexical arg shadows dynbound var" warning

In most cases the right way to fix this warning is by renaming
the offending argument, but in some cases this is inconvenient, as is
the case in `cl-defstruct` where arg names are imposed by slot names.

This patch also happens to fix a few bugs along the way:
- miscompilation of (lambda (gcs-done) (lambda (x) (+ x gcs-done)))
- errors about void function `byte-compile-warn-x` if the warning was
  emitted via `cconv-fv` when bytecomp was not loaded.
Oh, and it improves the warning by making the location info slightly
more precise.

* lisp/emacs-lisp/cconv.el (cconv--analyze-function): Remove this warning.
* lisp/emacs-lisp/bytecomp.el (byte-compile-check-lambda-list):
Warn about it here instead.  Let `with-suppressed-warnings` control it
under `lexical`.

14 months agoCorrection to patch on 2023-06-21 15:36:56 +0000.
Alan Mackenzie [Sun, 25 Jun 2023 15:06:05 +0000 (15:06 +0000)]
Correction to patch on 2023-06-21 15:36:56 +0000.

This corrects an error where commenting out a template closer
left a subsequent closer without a syntax-table text property.

* lisp/progmodes/cc-engine.el (c-unmark-<>-around-region):
Don't scan from the inside of 2-character comment delimiters.
Replace invalid skip-syntax-forward call with a null string
argument by an invocation of
c-search-forward-non-nil-char-property.

14 months ago; * doc/lispintro/emacs-lisp-intro.texi (car & cdr): Fix typo.
Eli Zaretskii [Sun, 25 Jun 2023 05:25:13 +0000 (08:25 +0300)]
; * doc/lispintro/emacs-lisp-intro.texi (car & cdr): Fix typo.

14 months agoClarify list terminology
Richard M. Stallman [Sat, 24 Jun 2023 23:19:53 +0000 (19:19 -0400)]
Clarify list terminology

* doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed):
Mention "cons cell".  Add index entries.
(car & cdr): Simplify etymology of `car' and `cdr'.
Explain why for some purposes they are better than `first' and `rest'.
Mention cons cells.

14 months ago(macroexp--unfold-lambda): Obey the lexbind semantics
Stefan Monnier [Sat, 24 Jun 2023 21:53:41 +0000 (17:53 -0400)]
(macroexp--unfold-lambda): Obey the lexbind semantics

While at it, rework the code so as not to rely on an
intermediate rewriting of (funcall (lambda ..) ...)
to ((lambda ..) ...) since that forms is deprecated.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-funcall): Unfold lambdas
instead of turning them into the deprecated ((lambda ..) ..).
(byte-optimize-form-code-walker): Don't unfold ((lambda ..) ..) any more.
(byte-compile-inline-expand): Revert to non-optimized call if the unfolding
can't be optimized.

* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Don't unfold
((lambda ..) ..) any more.

* lisp/emacs-lisp/cl-macs.el (cl--slet): Remove workaround.

* lisp/emacs-lisp/disass.el (disassemble): Make sure the code is
compiled with its own `lexical-binding` value.

* lisp/emacs-lisp/macroexp.el (macroexp--unfold-lambda): Make it work
both for ((lambda ..) ..) and for (funcall #'(lambda ..) ..).
Be careful not to move dynbound vars from `lambda` to `let`.
(macroexp--expand-all): Unfold (funcall #'(lambda ..) ..) instead of
turning it into ((lambda ..) ..).  Don't unfold ((lambda ..) ..) any more.

14 months ago* lisp/emacs-lisp/cl-macs.el (cl--slet): Unbreak bootstrap
Stefan Monnier [Sat, 24 Jun 2023 15:44:32 +0000 (11:44 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl--slet): Unbreak bootstrap

14 months agoFix Python indentation of continuation lines within parens
kobarity [Sun, 18 Jun 2023 14:47:25 +0000 (23:47 +0900)]
Fix Python indentation of continuation lines within parens

* lisp/progmodes/python.el (python-indent-context): Add a new indent
context `:inside-paren-continuation-line'.
(python-indent--calculate-indentation): Use the new indent context.
* test/lisp/progmodes/python-tests.el (python-indent-pep8-2)
(python-indent-pep8-3)
(python-indent-inside-paren-1)
(python-indent-inside-paren-2)
(python-indent-inside-paren-3)
(python-indent-inside-paren-6)
(python-indent-after-backslash-2): Change to use the new indent
context.
(python-indent-inside-paren-8)
(python-indent-inside-paren-9): New tests. (Bug#63959)

14 months ago; Fix documentation of last change
Eli Zaretskii [Sat, 24 Jun 2023 11:58:44 +0000 (14:58 +0300)]
; Fix documentation of last change

* lisp/net/eww.el (eww-copy-alternate-url): Doc fix.
* etc/NEWS:
* doc/misc/eww.texi (Basics): Minor wording and punctuation fixes.
(Bug#64126)

14 months agoNew command 'eww-copy-alternate-url'
Eshel Yaron [Sat, 17 Jun 2023 10:48:51 +0000 (13:48 +0300)]
New command 'eww-copy-alternate-url'

This adds a new command to EWW that copies an alternate link to the
currently visited page into the kill ring.  This is useful for
subscribing to website feeds, etc.

* lisp/net/eww.el (eww--alternate-urls, eww-read-alternate-url):
 New functions.
(eww-copy-alternate-url): New command.
(eww-mode-map): Bind it to 'A'.

* doc/misc/eww.texi (Basics): Document it.

* etc/NEWS: Announce it.
(Bug#64126)

14 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 24 Jun 2023 11:13:42 +0000 (07:13 -0400)]
Merge from origin/emacs-29

d0147ff9e50 * lisp/emacs-lisp/shortdoc.el: More and better `substring...
fa06249a9fb Fix "C-x RET r" when the new encoding is UTF
679e9d7c56e ; Mention MinGW64 GCC 13.1 problems in PROBLEMS
fdc1a12ed1a Fix "vc-print-log does not erase buffer" and associated p...
d507aa7336b Add selector_expression indentation rule
1f664a0af75 Add "nixd" LSP server to Eglot
e962cf4ba72 Fix building --with-native-compilation=aot from release t...
4ca371e9cc7 Fix bug#64152 (Minibuffer sometimes goes "modal")
a0ccf1859cc Disable target-async by default in gdb-mi.el
2bad5829ff7 Revert "Fix parsing of dn line if WITHDN is non-nil"
7637e361d3b Don't truncate filenames with "emacs.el" in them
2591eb1190a Improve documentation of 'minibuffer-message'
6f211bc57b9 Eglot: again fix positions of coinciding inlay hint overl...
a24e9e3fee5 ; Update ChangeLog.4 and etc/AUTHORS.

14 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 24 Jun 2023 10:57:26 +0000 (06:57 -0400)]
; Merge from origin/emacs-29

The following commits were skipped:

c9022d69218 * lisp/ldefs-boot.el: Regenerate.
f690827fa50 Bump Emacs version to 29.0.92

14 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 24 Jun 2023 10:57:25 +0000 (06:57 -0400)]
Merge from origin/emacs-29

8f62e7b85f6 Describe primarily the Emacs s-exp dialect for treesit qu...
eacd75df4e4 ; Improve documentation of overlay priorities
b3f11e94fad Fix documentation of :predicate in 'define-globalized-min...

14 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 24 Jun 2023 10:57:25 +0000 (06:57 -0400)]
; Merge from origin/emacs-29

The following commit was skipped:

02f0be03017 Revert "Fix some tree-sitter :match regexps"

14 months ago* lisp/emacs-lisp/shortdoc.el: More and better `substring` examples.
Mattias Engdegård [Fri, 23 Jun 2023 17:42:44 +0000 (19:42 +0200)]
* lisp/emacs-lisp/shortdoc.el: More and better `substring` examples.

Suggested by Juri Linkov.

14 months agoFix "C-x RET r" when the new encoding is UTF
Eli Zaretskii [Sat, 24 Jun 2023 08:49:14 +0000 (11:49 +0300)]
Fix "C-x RET r" when the new encoding is UTF

* src/fileio.c (Finsert_file_contents): Update point of
'conversion_buffer' before decoding the last block.  (Bug#64253)

14 months agoApply quote substitution to popup choice menus
Stephen Berman [Sat, 24 Jun 2023 08:45:10 +0000 (10:45 +0200)]
Apply quote substitution to popup choice menus

* lisp/wid-edit.el (widget-choose): Iteratively apply
substitute-command-keys to choice item text before building popup
or text buffer menu.  Also fix two unnecessary uses of let*.

14 months ago; Mention MinGW64 GCC 13.1 problems in PROBLEMS
Eli Zaretskii [Sat, 24 Jun 2023 07:23:07 +0000 (10:23 +0300)]
; Mention MinGW64 GCC 13.1 problems in PROBLEMS

* etc/PROBLEMS: Mention the problems building with MinGW64 GCC
13.1.  (Bug#63365)

14 months agoFix "vc-print-log does not erase buffer" and associated problems
Dmitry Gutov [Sat, 24 Jun 2023 02:57:18 +0000 (05:57 +0300)]
Fix "vc-print-log does not erase buffer" and associated problems

* lisp/vc/vc.el (vc-deduce-fileset): Make sure to retain the
buffer switch (if it did), bug#63949.

14 months agoExtend Tramp kubernetes method
Michael Albinus [Fri, 23 Jun 2023 19:26:14 +0000 (21:26 +0200)]
Extend Tramp kubernetes method

* doc/misc/tramp.texi (Inline methods): Adapt kubernetes method.

* etc/NEWS: Describe changes in Tramp kubernetes method.

* lisp/net/tramp-container.el (tramp-kubernetes-context)
(tramp-kubernetes-namespace): New defcustoms.
(tramp-kubernetes--completion-function): Extend for CONTAINER.POD
syntax.
(tramp-kubernetes--host-name-regexp): New defconst.
(tramp-kubernetes--container, tramp-kubernetes--pod)
(tramp-kubernetes--current-context): New defuns.
(tramp-kubernetes--current-context-data): Simplify.
(tramp-kubernetes--context-namespace): New defun.
(tramp-methods) <kubernetes>: Respect container, context and
namespace.  (Bug#59797)
(tramp-container-connection-local-default-kubernetes-variables):
New defconst.  Set respective connection-local variables.

* lisp/net/tramp-sh.el (tramp-config-check): New variable.
(tramp-open-connection-setup-interactive-shell): Use it.

* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-extra-expand-args): New defvar.
(tramp-expand-args): Use it.

14 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Fri, 23 Jun 2023 19:15:13 +0000 (21:15 +0200)]
; * etc/NEWS: Fix typos.

14 months agocl-defsubst: Use static scoping for args
Stefan Monnier [Fri, 23 Jun 2023 15:37:12 +0000 (11:37 -0400)]
cl-defsubst: Use static scoping for args

* lisp/emacs-lisp/cl-macs.el (cl--slet): New function, partly extracted
from `cl--slet*`.
(cl--slet*): Use it.
(cl--defsubst-expand): Use it to fix bug#47552.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct-dynbound-label):
New test.

14 months agocl-defun/cl-struct: Use static scoping for function args
Stefan Monnier [Fri, 23 Jun 2023 14:45:49 +0000 (10:45 -0400)]
cl-defun/cl-struct: Use static scoping for function args

* lisp/emacs-lisp/cl-macs.el (cl--slet*): New function.
(cl--transform-lambda): Use it to fix bug#47552.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments): Add test.

14 months agoAdd selector_expression indentation rule
Theodor Thornhill [Fri, 23 Jun 2023 13:37:04 +0000 (15:37 +0200)]
Add selector_expression indentation rule

* lisp/progmodes/go-ts-mode.el (go-ts-mode--indent-rules): New rule.

14 months agoRevert "Avoid header line with some empty non-nil formats"
Eli Zaretskii [Fri, 23 Jun 2023 10:50:15 +0000 (13:50 +0300)]
Revert "Avoid header line with some empty non-nil formats"

This reverts commit 4f66cbbfe520ee31ef26676e09a926217d9736fe.
This is part of removing the recently-added feature whereby
certain non-nil values of 'header-line-format' could signal
that the header line shall not be displayed.  The feature is
being reverted because its advantages are very minor, whereas
the complications it causes are serious.

14 months agoRevert "; Fix last change"
Eli Zaretskii [Fri, 23 Jun 2023 10:47:53 +0000 (13:47 +0300)]
Revert "; Fix last change"

This reverts commit 05c2be28a3e97bd920d0bf8c8b59ec682a420cce.
This is part of removing the recently-added feature whereby
certain non-nil values of 'header-line-format' could signal
that the header line shall not be displayed.  The feature is
being reverted because its advantages are very minor, whereas
the complications it causes are serious.

14 months agoRevert "; Fix coding style in just installed change"
Eli Zaretskii [Fri, 23 Jun 2023 10:47:33 +0000 (13:47 +0300)]
Revert "; Fix coding style in just installed change"

This reverts commit 229f0b8dd3b92827b6e0c6fc105508e8b80858f5.
This is part of removing the recently-added feature whereby
certain non-nil values of 'header-line-format' could signal
that the header line shall not be displayed.  The feature is
being reverted because its advantages are very minor, whereas
the complications it causes are serious.

14 months agoRevert "; * src/window.c (window_wants_header_line): Shut up bogus GCC warning."
Eli Zaretskii [Fri, 23 Jun 2023 10:47:05 +0000 (13:47 +0300)]
Revert "; * src/window.c (window_wants_header_line): Shut up bogus GCC warning."

This reverts commit ef8485ad05dd9200b68ea8141fd44c7b976140cd.
This is part of removing the recently-added feature whereby
certain non-nil values of 'header-line-format' could signal
that the header line shall not be displayed.  The feature is
being reverted because its advantages are very minor, whereas
the complications it causes are serious.

14 months agoRevert "Avoid infinite recursion in 'window_wants_header_line'"
Eli Zaretskii [Fri, 23 Jun 2023 10:44:59 +0000 (13:44 +0300)]
Revert "Avoid infinite recursion in 'window_wants_header_line'"

This reverts commit 3de8ed09ab46b9922e15aaf0cc8884b41087c996.
This is part of removing the recently-added feature whereby
certain non-nil values of 'header-line-format' could signal
that the header line shall not be displayed.  The feature is
being reverted because its advantages are very minor, whereas
the complications it causes are serious.

14 months ago; * doc/lispref/frames.texi (Frame Layout): Fix typo.
Po Lu [Fri, 23 Jun 2023 00:24:45 +0000 (08:24 +0800)]
; * doc/lispref/frames.texi (Frame Layout): Fix typo.

14 months agolatin-ltx.el: Add \Phi; fix bug#64212
Stefan Monnier [Thu, 22 Jun 2023 17:11:03 +0000 (13:11 -0400)]
latin-ltx.el: Add \Phi; fix bug#64212

* lisp/leim/quail/latin-ltx.el (greek letters): Fix regexp which was
meant to avoid lowercase phi only.

14 months agoAdd "nixd" LSP server to Eglot
Eli Zaretskii [Thu, 22 Jun 2023 16:33:31 +0000 (19:33 +0300)]
Add "nixd" LSP server to Eglot

* lisp/progmodes/eglot.el (eglot-server-programs): Add "nixd".
Patch by Brian Leung <leungbk@posteo.net>.  (Bug#64214)

14 months agoFix orgtbl-to-table.el function to include last cell border
Jakub Ječmínek [Wed, 21 Jun 2023 13:50:31 +0000 (15:50 +0200)]
Fix orgtbl-to-table.el function to include last cell border

* lisp/org/org-table.el (orgtbl-to-table.el): Perform character
replacement in the temp buffer and fix missing cell border.  (Bug#64205)

Copyright-paperwork-exempt: yes

14 months ago* etc/NEWS: Announce the fix for bug#44418 (,@ prefix syntax)
Mattias Engdegård [Thu, 22 Jun 2023 11:17:00 +0000 (13:17 +0200)]
* etc/NEWS: Announce the fix for bug#44418 (,@ prefix syntax)

14 months agoFix building --with-native-compilation=aot from release tarball
Eli Zaretskii [Thu, 22 Jun 2023 11:03:17 +0000 (14:03 +0300)]
Fix building --with-native-compilation=aot from release tarball

* lisp/Makefile.in (%.eln): Pattern rule for AOT native
compilation.
(compile-eln-targets, compile-eln-aot): New targets for AOT native
compilation.

* src/Makefile.in (../native-lisp): If NATIVE_COMPILATION_AOT is
set, also native-compile all the other Lisp files.
(Bug#64167)

14 months agoRearrange some Tramp declarations
Michael Albinus [Thu, 22 Jun 2023 09:07:10 +0000 (11:07 +0200)]
Rearrange some Tramp declarations

* lisp/net/tramp.el (tramp-prefix-format, tramp-prefix-regexp)
(tramp-method-regexp, tramp-postfix-method-format)
(tramp-postfix-method-regexp, tramp-prefix-ipv6-format)
(tramp-prefix-ipv6-regexp, tramp-postfix-ipv6-format)
(tramp-postfix-ipv6-regexp, tramp-postfix-host-format)
(tramp-postfix-host-regexp, tramp-remote-file-name-spec-regexp)
(tramp-file-name-structure, tramp-file-name-regexp)
(tramp-completion-method-regexp)
(tramp-completion-file-name-regexp):
* lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-vector):
Rearrange declarations.

14 months agoMerge from origin/emacs-29
Michael Albinus [Thu, 22 Jun 2023 09:01:23 +0000 (11:01 +0200)]
Merge from origin/emacs-29

0154f5885e3 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ...
111efb0dd7f Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ...
948b471756e Require ls-lisp in Tramp only when needed
90c03ffcd4b After minibuffer action, don't make the minibuffer current

14 months ago; Merge from origin/emacs-29
Michael Albinus [Thu, 22 Jun 2023 08:50:49 +0000 (10:50 +0200)]
; Merge from origin/emacs-29

The following commit was skipped:

95091b77f0b Fix some tree-sitter :match regexps

14 months agoMerge from origin/emacs-29
Michael Albinus [Thu, 22 Jun 2023 08:50:46 +0000 (10:50 +0200)]
Merge from origin/emacs-29

3d930b928fe Eglot: fix relative position of coinciding inlay hint ove...
aad7d68164c ; * doc/lispref/display.texi (Display Tables): Remove ext...

14 months ago; Minor fixes of recently-installed regexp documentation changes
Eli Zaretskii [Thu, 22 Jun 2023 05:32:16 +0000 (08:32 +0300)]
; Minor fixes of recently-installed regexp documentation changes

* doc/emacs/search.texi (Regexps):
* doc/lispref/searching.texi (Regexp Special): Keep the old
terminology as "a.k.a.".
(Char Classes, POSIX Regexps, POSIX Regexps): Add cross-references
to where "bracket expression" is defined.  (Bug#64128)

15 months agoAdd Tramp option showing ad-hoc multi-hops
Michael Albinus [Wed, 21 Jun 2023 16:25:32 +0000 (18:25 +0200)]
Add Tramp option showing ad-hoc multi-hops

* doc/misc/tramp.texi (Ad-hoc multi-hops):
Describe tramp-show-ad-hoc-proxies.

* lisp/net/tramp.el (tramp-show-ad-hoc-proxies): New defcustom.
(tramp-make-tramp-file-name): Use it.
(tramp-make-tramp-hop-name): Don't add hop twice.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate): Adapt tests.

15 months agoDon't compile (+ X 0) as (* X 1)
Mattias Engdegård [Wed, 21 Jun 2023 14:56:12 +0000 (16:56 +0200)]
Don't compile (+ X 0) as (* X 1)

Previously (+ X 0) was reduced to (+ X) which became (* X 1) in
codegen, but this is wrong for X = -0.0 and also slightly slower.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-plus): Don't reduce an
addition to (+ X) by eliminating zeros; retain one 0 argument.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.

15 months agoPrefix syntax for ,@ in elisp-mode (bug#44418)
Mattias Engdegård [Wed, 21 Jun 2023 09:03:14 +0000 (11:03 +0200)]
Prefix syntax for ,@ in elisp-mode (bug#44418)

* lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize):
Use prefix syntax for ,@ to avoid the @ becoming part of a symbol
that follows.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env):
Propertise inserted Lisp code to keep the test working.

15 months agoStraighten regexp postfix operator after zero-width assertion parse
Mattias Engdegård [Tue, 20 Jun 2023 10:12:50 +0000 (12:12 +0200)]
Straighten regexp postfix operator after zero-width assertion parse

The zero-width assertions \` \' \b \B were parsed in a sloppy way so
that a following postfix repetition operator could yield surprising
results.  For instance, "\\b*" would act as "\\b\\*", and "xy\\b*"
would act as "\\(?:xy\\b\\)*".

Except for \` and ^, any following postfix operator now applies to the
zero-width assertion itself only, which is predictable and consistent
with other assertions, if useless in practice.
For historical compatibility, an operator character following \` and ^
always becomes a literal. (Bug#64128)

* src/regex-emacs.c (regex_compile):
Set `laststart` appropriately for each zero-width assertion instead
of leaving it with whatever value it had before.
Remove a redundant condition.
* test/src/regex-emacs-tests.el
(regexp-tests-zero-width-assertion-repetition): New test.
* doc/lispref/searching.texi (Regexp Special):
Say that repetition operators are not special after \`,
and that they work as expected after other backslash escapes.
* etc/NEWS: Announce.

15 months agoCorrect handling of template markers on deletion/insertion
Alan Mackenzie [Wed, 21 Jun 2023 15:36:56 +0000 (15:36 +0000)]
Correct handling of template markers on deletion/insertion

This fixes bug#62841.

In particular, correct the syntax-table text properties on the
remaining <...>s.

* lisp/progmodes/cc-align.el
(c-lineup-template-args-indented-from-margin): New lineup
function.

* lisp/progmodes/cc-defs.el (c-put-char-properties): New macro.
(c-search-forward-non-nil-char-property): Handle terminating
limit correctly.

* lisp/progmodes/cc-engine.el
(c-clear-<-pair-props-if-match-after)
(c-clear->-pair-props-if-match-before): Return the position
outside the matching < or >, not merely t.
(c-end-of-literal): New function.
(c-unmark-<>-around-region): New function.
(c-before-change-check-<>-operators): Refactor, calling
c-unmark-<>-around-region.
(c-<>-get-restricted): New function, extracted from
c-restore-<>-properties.
(c-restore-<>-properties): Handle ">" characters whose matching
"<" has not yet been encountered.
(c-ml-string-opener-at-or-around-point): Fix an off by one
error.
(c-backward-<>-arglist): New parameter restricted-function, a
function which calculates c-restricted-<>-arglists for the
current operation.

* lisp/progmodes/cc-fonts.el (c-font-lock-c++-using): Check
point is less than limit in the loop.

* lisp/progmodes/cc-langs.el
(c-get-state-before-change-functions)
(c-before-font-lock-functions): Add the new function
c-unmark-<>-around-region into the C++ and Java values of the
variable.

* lisp/progmodes/cc-mode.el (c-clear-string-fences)
(c-restore-string-fences): Neutralize and restore the
syntax-table properties between an unbalanced " and EOL.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Put new lineup
function c-lineup-template-args-indented-from-margin into entry
for template-args-cont.

* doc/misc/cc-mode.texi (List Line-Up): Document
c-lineup-template-args-indented-from-margin.

15 months agoFix bug#64152 (Minibuffer sometimes goes "modal")
Alan Mackenzie [Wed, 21 Jun 2023 14:23:14 +0000 (14:23 +0000)]
Fix bug#64152 (Minibuffer sometimes goes "modal")

In particular, when a frame has no minibuffer and is using that
of a different "normal" frame, C-x 5 o, etc., and GUI
operations fail.

Fix by partially reverting the commit from 2022-07-07 15:38:09
+0000 "Remove obscure, obsolete code from do_switch_frame".  As
a consequent change, also revert the commit from 2022-07-08
20:19:03 +0000 "Remove now unused parameter TRACK from
do_switch_frame".

* src/frame.c (do_switch_frame): Restore the TRACK parameter.
Restore the code which redirects the frame focus when a new
frame gets selected.

* src/frame.c (Fselect_frame, Fhandle_switch_frame)
(delete_frame)
* src/keyboard.c (quit_throw_to_read_char)
* src/lisp.h (do_switch_frame prototype)
* src/minibuf.c (read_minibuf_unwind)
* src/window.c (Fset_window_configuration): Restore the TRACK
argument to do_switch_frame.

* src/xterm.c (x_try_restore_frame): Add a zero TRACK argument
to do_switch_frame.

15 months agoExtend handling of prefix arg in some kmacro.el commands
Eli Zaretskii [Wed, 21 Jun 2023 13:58:32 +0000 (16:58 +0300)]
Extend handling of prefix arg in some kmacro.el commands

* lisp/kmacro.el (kmacro-call-ring-2nd)
(kmacro-call-ring-2nd-repeat, kmacro-end-macro)
(kmacro-end-and-call-macro): Accept just "C-u" and interpret it as
a numeric argument of 4.  Suggested by Al Petrofsky
<al@petrofsky.org>.  (Bug#64138)

15 months agoPrevent crashes on macOS when fullscreen frame is deleted
Daniel Martín [Sun, 18 Jun 2023 22:23:03 +0000 (00:23 +0200)]
Prevent crashes on macOS when fullscreen frame is deleted

* src/nsterm.m (ns_free_frame_resources): Remove the frame's
window from the hierarchy.  (Bug#64147)

15 months agoAllow --debug-init to debug all errors in init files
Eli Zaretskii [Wed, 21 Jun 2023 13:27:42 +0000 (16:27 +0300)]
Allow --debug-init to debug all errors in init files

* lisp/startup.el (startup--load-user-init-file): Ignore the value
of 'debug-ignored-errors' when loading init files if we were
invoked interactively with --debug-init.  (Bug#64163)

15 months agoDisable target-async by default in gdb-mi.el
Eli Zaretskii [Wed, 21 Jun 2023 13:10:52 +0000 (16:10 +0300)]
Disable target-async by default in gdb-mi.el

* lisp/progmodes/gdb-mi.el (gdb-non-stop-setting): Disable until
bug#63084 is fixed.  (Bug#64186)

15 months agoDelete eval-command-interactive-spec
Sean Whitton [Wed, 21 Jun 2023 12:26:09 +0000 (13:26 +0100)]
Delete eval-command-interactive-spec

* etc/NEWS: Delete announcement of eval-command-interactive-spec.
* lisp/emacs-lisp/subr-x.el (eval-command-interactive-spec): Delete.

15 months ago* configure.ac: Update GCC bug number in comment.
Paul Eggert [Wed, 21 Jun 2023 07:06:44 +0000 (00:06 -0700)]
* configure.ac: Update GCC bug number in comment.

15 months ago; * src/pgtkfns.c (frame_geometry): Fix typo in last change.
Po Lu [Wed, 21 Jun 2023 03:32:41 +0000 (11:32 +0800)]
; * src/pgtkfns.c (frame_geometry): Fix typo in last change.

15 months agoAllow displaying tool bar on the bottom of the frame
Po Lu [Wed, 21 Jun 2023 02:04:31 +0000 (10:04 +0800)]
Allow displaying tool bar on the bottom of the frame

* src/xterm.c (x_clear_under_internal_border): Subtract bottom
margins before clearing bottom border.
(XTflash): Subtract bottom margins before flashing mini window.

* src/xfns.c (x_set_tool_bar_position): Allow setting different
values outside of GTK+.
(frame_geometry): Adjust inner width and height for tool bars
placed on the bottom.

* src/xdisp.c (init_xdisp): Calculate using top margins only.

* src/window.c (resize_frame_windows): Fix commentary.

* src/w32fns.c (Fw32_frame_geometry): Report tool bar position
correctly.
(w32_clear_under_internal_border): Subtract bottom margins
prior to clearing bottom border.
(w32_set_tool_bar_position): New function.
(Fw32_frame_edges): Subtract bottom tool bar from inner width and
height.
(w32_frame_parm_handlers): Add `set_tool_bar_position' parameter
handler.

* src/pgtkterm.c (pgtk_flash): Subtract bottom
margins before clearing bottom border.
(XTflash): Subtract bottom margins before flashing mini window.

* src/pgtkfns.c (frame_geometry): Set `inner_top' correctly.
(Fpgtk_set_mouse_absolute_pixel_position):
(Fpgtk_mouse_absolute_pixel_position):
(Fpgtk_page_setup_dialog):
(Fpgtk_get_page_setup): Wrap lines which cause C Mode to hang.

* src/nsterm.m (ns_clear_under_internal_border): Subtract bottom
margins before clearing bottom border.

* src/nsfns.m (ns_set_tool_bar_position): New function.  Error if
arg is not top.
(ns_frame_parm_handlers): Add that as the handler for
`tool-bar-position', to prevent it from being set to an invalid
value.

* src/haikuterm.c (haiku_flash): Subtract bottom margins before
flashing mini window.
(haiku_clear_under_internal_border): Subtract bottom margins
before clearing bottom border.

* src/haikufns.c (haiku_set_tool_bar_position): Allow setting
values other than `top'.
(frame_geometry): Take bottom margin into account when calculating
inner dimensions.

* src/frame.h (struct frame): Always define `tool_bar_position'.
(fset_tool_bar_position): Define function everywhere.
(FRAME_TOOL_BAR_POSITION): Define correctly on all toolkits.
(FRAME_TOOL_BAR_TOP_HEIGHT):
(FRAME_TOOL_BAR_TOP_LINES):
(FRAME_TOOL_BAR_BOTTOM_HEIGHT):
(FRAME_TOOL_BAR_BOTTOM_LINES): New macros.  Each pair returns the
tool bar dimensions only if the tool bar position is set
appropriately.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT): Only add tool bar
height if it is placed at the top of the frame.
(FRAME_BOTTOM_MARGIN, FRAME_BOTTOM_MARGIN_HEIGHT): Add ``bottom
margins''.
(FRAME_MARGINS, FRAME_MARGIN_HEIGHT): Move original margin macro
here.
(FRAME_PIXEL_HEIGHT_TO_TEXT_LINES):
(FRAME_TEXT_TO_PIXEL_HEIGHT):
(FRAME_PIXEL_TO_TEXT_HEIGHT):
(FRAME_INNER_HEIGHT): Subtract both vertical margins.

* src/frame.c (adjust_frame_size): Subtract both top and bottom
margins to determine the inner height.
(make_frame): Initialize `f->tool_bar_position' unconditionally.

* src/dispnew.c (adjust_frame_glyphs_for_window_redisplay): Place
internal tool bar on bottom if requested.

* doc/lispref/frames.texi (Frame Layout): Describe the possibility
of the tool bar being placed below the inner area of the frame.
(Layout Parameters): Describe that `tool-bar-position' is now
supported almost everywhere.

15 months ago; cperl-mode.el: Eliminate cperl-font-lock-multiline
Harald Jörg [Tue, 20 Jun 2023 20:51:29 +0000 (22:51 +0200)]
; cperl-mode.el: Eliminate cperl-font-lock-multiline

This undocumented variable was always set to t.  There was no
function to change the variable.

* lisp/progmodes/cperl-mode.el: Eliminate top-level variables
cperl-font-lock-multiline and cperl-font-lock-multiline-start.
(cperl-mode): Don't set cperl-font-lock-multiline.
(cperl-windowed-init): Don't set cperl-font-lock-multiline.
(cperl-init-faces): Eliminate (if cperl-font-lock-multiline)
conditionals.

15 months agoFix ldap-search when WITHDN is non-nil (bug#64089)
Filipp Gunbin [Tue, 20 Jun 2023 17:43:32 +0000 (20:43 +0300)]
Fix ldap-search when WITHDN is non-nil (bug#64089)

* lisp/net/ldap.el (ldap-search): Apply ldap-decode-attribute only to
attribute pairs.
(ldap-search-internal): Parse dn with the same regexp as other attrs;
use its value instead of the whole line.  Include entry into result
only if valid dn is present, to avoid treating process sentinel
messages like an entry.  Fix accidental match data clobbering.
Document return value format.

15 months agoRevert "Fix parsing of dn line if WITHDN is non-nil"
Filipp Gunbin [Tue, 20 Jun 2023 15:25:24 +0000 (18:25 +0300)]
Revert "Fix parsing of dn line if WITHDN is non-nil"

This reverts commits 71b27779a9a and d2246b26275, because they change
the return value of "ldap-search" in an incompatible way.  The fix
(a different one) will be done on master instead (bug#64089).

15 months agoDon't truncate filenames with "emacs.el" in them
Eli Zaretskii [Tue, 20 Jun 2023 13:35:09 +0000 (16:35 +0300)]
Don't truncate filenames with "emacs.el" in them

* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol):
Avoid false positives when looking for "emacs.el" matches the
likes of "emacs.elpa".  (Bug#64143)

15 months agoImprove documentation of 'minibuffer-message'
Eli Zaretskii [Tue, 20 Jun 2023 12:31:57 +0000 (15:31 +0300)]
Improve documentation of 'minibuffer-message'

* doc/lispref/minibuf.texi (Minibuffer Misc): Clarify that
'minibuffer-message' behaves like 'message' if called from a
buffer that is not a minibuffer.

* lisp/minibuffer.el (minibuffer-message)
(set-minibuffer-message, clear-minibuffer-message): Doc fixes.
(Bug#64165)

15 months agoSignal error upon setting unsupported tool bar position
Po Lu [Tue, 20 Jun 2023 02:13:41 +0000 (02:13 +0000)]
Signal error upon setting unsupported tool bar position

* src/haikufns.c (haiku_set_tool_bar_position): New function.
Port non-GTK code from X.
(haiku_frame_parm_handlers): Add new function.

15 months agoDon't read all headers in gnus thread referral (bug#63842)
Andrew G Cohen [Mon, 19 Jun 2023 23:59:51 +0000 (07:59 +0800)]
Don't read all headers in gnus thread referral (bug#63842)

Gnus thread referral tries to add newly found articles to an existing
summary buffer. When the list of such articles is known from searching
we can speed things up by only entering these specific headers into
the dependencies table.

* lisp/gnus/gnus-sum.el (gnus-summary-refer-thread): Don't set
`gnus-read-all-available-headers' when finding articles by searching.

15 months agoEglot: again fix positions of coinciding inlay hint overlays (bug#64101)
João Távora [Mon, 19 Jun 2023 22:31:03 +0000 (23:31 +0100)]
Eglot: again fix positions of coinciding inlay hint overlays (bug#64101)

This bug originated from the previous fix, and is reproducible on non
Mac OS platforms, as long as the very latest version (at time of
writing) of the rust-analyzer server is used.

* lisp/progmodes/eglot.el (eglot--update-hints-1): Reverse
priorities when pegging overlays after (i.e. when before-string is
used).

15 months ago; Improve 'rx' form from edb0862f5e69
Jim Porter [Mon, 19 Jun 2023 20:45:37 +0000 (13:45 -0700)]
; Improve 'rx' form from edb0862f5e69

Thanks to Michael Albinus for the suggestion.

* test/lisp/eshell/esh-util-tests.el
(esh-util-test/eshell-stringify/list): Use 'any' instead of 'or' in
'rx' form.

15 months agoCall them “bracket expressions” more consistently
Paul Eggert [Mon, 19 Jun 2023 18:09:00 +0000 (11:09 -0700)]
Call them “bracket expressions” more consistently

Emacs comments and doc were inconsistent about the name used for
regexps like [a-z].  Sometimes it called them “character
alternatives”, sometimes “character sets”, sometimes “bracket
expressions”.  Prefer “bracket expressions” as it is less confusing:
POSIX and most other programs’ doc uses “bracket expressions”,
“alternative” is also used in the Emacs documentation to talk about
...\|... in regexps, and “character set” normally has a different
meaning in Emacs.

15 months agoDocument Emacs vs POSIX REs
Paul Eggert [Mon, 19 Jun 2023 18:09:00 +0000 (11:09 -0700)]
Document Emacs vs POSIX REs

* doc/lispref/searching.texi (Longest Match):
Rename from POSIX Regexps, as this section
is about longest-match functions, not about POSIX regexps.
(POSIX Regexps): New section.

15 months agoDocument regular expression special cases better
Paul Eggert [Mon, 19 Jun 2023 18:09:00 +0000 (11:09 -0700)]
Document regular expression special cases better

In particular, document that escape sequences like \b*
are currently buggy.

15 months agoAdapt Tramp specific tests in eglot-tests.el
Michael Albinus [Tue, 13 Dec 2022 19:06:48 +0000 (20:06 +0100)]
Adapt Tramp specific tests in eglot-tests.el

* test/lisp/progmodes/eglot-tests.el (tramp): Move up.
(tramp-sh): Don't require.
(eglot--cleanup-after-test): Delete Tramp buffers if needed.
(eglot-tests-lsp-abiding-column): Rename from `eglot-lsp-abiding-column'.
(tramp-histfile-override): Declare.
(eglot--call-with-tramp-test):
Use `ert-remote-temporary-file-directory'.  Skip if needed.
(eglot--tramp-test, eglot--tramp-test-2): Don't skip.

15 months ago* src/regex-emacs.c (regex_compile): Remove useless condition
Mattias Engdegård [Mon, 19 Jun 2023 08:25:15 +0000 (10:25 +0200)]
* src/regex-emacs.c (regex_compile): Remove useless condition

This condition didn't have any visible effect (as ^ is not a
repetition operator); all it did was to generate slightly worse regexp
bytecode for out-of-place (literal) ^ in the midst of literal
characters (bug#64128).

15 months ago; Fix test failure from 2f181d60323 (new 'pp' implementation)
Jim Porter [Sun, 18 Jun 2023 21:35:01 +0000 (14:35 -0700)]
; Fix test failure from 2f181d60323 (new 'pp' implementation)

* test/lisp/eshell/esh-util-tests.el
(esh-util-test/eshell-stringify/list): Be more flexible when checking
stringification of nested lists.

15 months ago; Update ChangeLog.4 and etc/AUTHORS. emacs-29.0.92
Eli Zaretskii [Sun, 18 Jun 2023 11:15:29 +0000 (07:15 -0400)]
; Update ChangeLog.4 and etc/AUTHORS.

15 months ago* lisp/ldefs-boot.el: Regenerate.
Eli Zaretskii [Sun, 18 Jun 2023 11:14:46 +0000 (07:14 -0400)]
* lisp/ldefs-boot.el: Regenerate.

15 months agoBump Emacs version to 29.0.92
Eli Zaretskii [Sun, 18 Jun 2023 10:47:21 +0000 (06:47 -0400)]
Bump Emacs version to 29.0.92

* README:
* configure.ac:
* nt/README.W32:
* msdos/sed2v2.inp: Bump version to 29.0.92.

15 months agoDescribe primarily the Emacs s-exp dialect for treesit queries
Mattias Engdegård [Sun, 18 Jun 2023 08:37:53 +0000 (10:37 +0200)]
Describe primarily the Emacs s-exp dialect for treesit queries

* doc/lispref/parsing.texi (Pattern Matching, Multiple Languages):
Writing tree-sitter queries as Emacs s-expressions is much more
convenient than using the native query notation inside a string,
so it makes sense to base the documentation on the former dialect
(bug#64017).

15 months agoMake C-SPC work in "M-x term"
Al Petrofsky [Sat, 17 Jun 2023 00:06:57 +0000 (20:06 -0400)]
Make C-SPC work in "M-x term"

* lisp/term.el (term-raw-map): Add bindings for C-SPC, C-M-SPC,
and C-M-/.
(term-send-C-@, term-send-C-M-_, term-send-C-M-@): New commands.
(Bug#64121)

15 months ago; Improve documentation of overlay priorities
Eli Zaretskii [Sun, 18 Jun 2023 06:13:02 +0000 (09:13 +0300)]
; Improve documentation of overlay priorities

* doc/lispref/display.texi (Overlay Properties): Don't advise
against using overlay property values that are cons cells.
(Bug#64101)

15 months agoFix documentation of :predicate in 'define-globalized-minor-mode'
Eli Zaretskii [Sun, 18 Jun 2023 05:50:54 +0000 (08:50 +0300)]
Fix documentation of :predicate in 'define-globalized-minor-mode'

* doc/lispref/modes.texi (Defining Minor Modes):
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Document that :predicate creates a customizable user option.
(Bug#64048)

15 months agoMerge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs
Stefan Monnier [Sat, 17 Jun 2023 22:06:01 +0000 (18:06 -0400)]
Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs

15 months agopp-fill: Fix tests breakage
Stefan Monnier [Sat, 17 Jun 2023 22:05:33 +0000 (18:05 -0400)]
pp-fill: Fix tests breakage

* lisp/emacs-lisp/pp.el (pp-to-string, pp-buffer, pp): Preserve old
behavior of (almost always) returning a trailing newline.

* test/lisp/emacs-lisp/pp-tests.el (pp-print-quote): Adjust tests, now
that `pp-to-string` always returns a trailing newline, rather than only
most of the time.

* test/lisp/emacs-lisp/backtrace-tests.el
(backtrace-tests--single-and-multi-line): Make the test less sensitive
to the choice of what is "pretty".

15 months ago* doc/lispref/streams.texi (Output Variables): Document `pp-default-function`
Stefan Monnier [Fri, 16 Jun 2023 17:35:36 +0000 (13:35 -0400)]
* doc/lispref/streams.texi (Output Variables): Document `pp-default-function`

15 months agopp.el (pp-fill): New default pp function
Stefan Monnier [Fri, 16 Jun 2023 17:35:06 +0000 (13:35 -0400)]
pp.el (pp-fill): New default pp function

* lisp/emacs-lisp/pp.el (pp-default-function): Change default.
(pp--within-fill-column-p): New helper function.
(pp-fill): New function.

15 months agopp.el (pp-default-function): New custom var
Stefan Monnier [Fri, 16 Jun 2023 17:31:13 +0000 (13:31 -0400)]
pp.el (pp-default-function): New custom var

* lisp/emacs-lisp/pp.el (pp-use-max-width): Make obsolete.
(pp-default-function): New custom var.
(pp--object, pp--region): New helper functions.
(pp-29): New function, extracted from `pp-to-string`.
(pp-to-string): Add `pp-function` arg and obey `pp-default-function`.
(pp-28): New function, extracted from `pp-buffer`.
(pp-buffer): Rewrite, to obey `pp-default-function`.
(pp): Obey `pp-default-function`.
(pp-emacs-lisp-code): Add new calling convention to apply it to a region.

15 months ago* lisp/emacs-lisp/lisp-mode.el (lisp-ppss): Fix performance bug
Stefan Monnier [Fri, 16 Jun 2023 17:14:27 +0000 (13:14 -0400)]
* lisp/emacs-lisp/lisp-mode.el (lisp-ppss): Fix performance bug

(nth 2 ppss) can be absent but not incorrect, so don't recompute ppss
for (nth 2 ppss) when (nth 2 ppss) is already provided.
When calling `lisp-indent-line` on all the lines in a region, this
sometimes introduced a gratuitous O(N²) complexity.

15 months agoFix some tree-sitter :match regexps
Basil L. Contovounesios [Tue, 13 Jun 2023 12:53:31 +0000 (13:53 +0100)]
Fix some tree-sitter :match regexps

This was originally installed on 2023-06-17 in the emacs-29 release
branch and later reverted.  The intention is to backport it after
Emacs 29.1 is released.

The shy groups were caught by modified versions of the GNU ELPA
packages xr and relint:
- https://github.com/mattiase/xr/pull/6
- https://github.com/mattiase/relint/pull/14

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Quote special
character in regexp.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings):
* lisp/progmodes/js.el (js--plain-method-re):
(js--treesit-font-lock-settings):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Replace character
alternative [\\d], which matches '\' or 'd', with the most likely
intention [0-9].  Fix shy groups mistyped as optional colons.
Remove unneeded numbered :match group in rust-ts-mode (bug#64019).

15 months agoRevert "Fix some tree-sitter :match regexps"
Basil L. Contovounesios [Sat, 17 Jun 2023 19:39:16 +0000 (20:39 +0100)]
Revert "Fix some tree-sitter :match regexps"

This reverts commit 95091b77f0bbb2ae1aa94ef4a413626e7d434d58
of 2023-06-17, mistakenly pushed to emacs-29.

The patch will be installed on master instead, and backported later,
after Emacs 29.1 is released (bug#64019).

Do not merge to master.

15 months agoMerge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29
Michael Albinus [Sat, 17 Jun 2023 16:16:24 +0000 (18:16 +0200)]
Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29

15 months agoMerge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29
Michael Albinus [Sat, 17 Jun 2023 16:15:47 +0000 (18:15 +0200)]
Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29

15 months agoRequire ls-lisp in Tramp only when needed
Michael Albinus [Sat, 17 Jun 2023 16:15:09 +0000 (18:15 +0200)]
Require ls-lisp in Tramp only when needed

* lisp/net/tramp-compat.el (ls-lisp): Require only on MS Windows.
(Bug#64124)

* lisp/net/tramp-sh.el (ls-lisp-use-insert-directory-program): Declare.
(tramp-sh-handle-insert-directory): Simplify.

* lisp/net/tramp.el (ls-lisp-use-insert-directory-program): Declare.
(tramp-handle-insert-directory): Require ls-lisp.  Simplify.