Merge from origin/emacs-29

861556c133 Fix minibuffer-completion tests
c0578edc8f ; * doc/misc/eglot.texi (Troubleshooting Eglot): Fix typo...
c6bbf9cc27 Add c-ts-mode tests
a760364f5f Fix c-ts-mode--fill-paragraph
2a2b1d09ac Fix minor issues with 'pp' and related commands
dfb38fb2ee ; Improve documentation of tree-sitter node comparison
e8a89a18b6 ; Fix non-tree-sitter builds
f27a330b99 ; Fix typo in ert-with-temp-file
956889d8ff Equal now recognizes tree-sitter nodes (bug#60659)
8f446c2d39 Fix c-ts-mode comment indentation (bug#60270)
083badc9c1 * lisp/subr.el (while-let): Use if-let, not if-let* (bug#...
9ecebcdded * lisp/simple.el (next-completion): Handle first completi...
cfd2b3504a Fix encoding with 'utf-8-auto'
53b47df822 Report cursor correctly on PGTK when there is a margin

# Conflicts:
#	etc/NEWS
This commit is contained in:
Stefan Monnier 2023-01-14 09:10:45 -05:00
commit 4f0459aaf7
18 changed files with 167 additions and 45 deletions

View file

@ -496,7 +496,7 @@ See also `ert-with-temp-directory'."
(progn ,@body)
(ignore-errors
,@(when buffer
(list `(with-current-buffer buf
(list `(with-current-buffer ,buffer
(set-buffer-modified-p nil))
`(kill-buffer ,buffer))))
(ignore-errors

View file

@ -47,7 +47,9 @@ Otherwise this should be a number."
(defcustom pp-use-max-width nil
"If non-nil, `pp'-related functions will try to fold lines.
The target width is given by the `pp-max-width' variable."
The target width is given by the `pp-max-width' variable.
Note that this could slow down `pp' considerably when formatting
large lists."
:type 'boolean
:version "29.1")
@ -162,14 +164,15 @@ Also add the value to the front of the list in the variable `values'."
(message "Evaluating...")
(let ((result (eval expression lexical-binding)))
(values--store-value result)
(pp-display-expression result "*Pp Eval Output*")))
(pp-display-expression result "*Pp Eval Output*" pp-use-max-width)))
;;;###autoload
(defun pp-macroexpand-expression (expression)
"Macroexpand EXPRESSION and pretty-print its value."
(interactive
(list (read--expression "Macroexpand: ")))
(pp-display-expression (macroexpand-1 expression) "*Pp Macroexpand Output*"))
(pp-display-expression (macroexpand-1 expression) "*Pp Macroexpand Output*"
pp-use-max-width))
(defun pp-last-sexp ()
"Read sexp before point. Ignore leading comment characters."
@ -219,7 +222,8 @@ Ignores leading comment characters."
;;;###autoload
(defun pp-emacs-lisp-code (sexp)
"Insert SEXP into the current buffer, formatted as Emacs Lisp code.
Use the `pp-max-width' variable to control the desired line length."
Use the `pp-max-width' variable to control the desired line length.
Note that this could be slow for large SEXPs."
(require 'edebug)
(let ((obuf (current-buffer)))
(with-temp-buffer