[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c9b0f1df0d3 1/3: Merge from origin/emacs-29
From: |
Stefan Kangas |
Subject: |
master c9b0f1df0d3 1/3: Merge from origin/emacs-29 |
Date: |
Thu, 2 Mar 2023 00:45:13 -0500 (EST) |
branch: master
commit c9b0f1df0d372a0b10094146913f4c2657721c36
Merge: a1cb77771a2 07f3236133b
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
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
---
lisp/emacs-lisp/debug-early.el | 8 ++++----
lisp/emacs-lisp/eldoc.el | 1 +
lisp/progmodes/eglot.el | 26 ++++++++++++++++++++++----
lisp/treesit.el | 20 +++++++++++++++-----
src/alloc.c | 5 +++--
src/bytecode.c | 4 ++--
src/profiler.c | 3 +++
src/xdisp.c | 2 +-
8 files changed, 51 insertions(+), 18 deletions(-)
diff --git a/lisp/emacs-lisp/debug-early.el b/lisp/emacs-lisp/debug-early.el
index 395498f2206..e393daee879 100644
--- a/lisp/emacs-lisp/debug-early.el
+++ b/lisp/emacs-lisp/debug-early.el
@@ -46,10 +46,10 @@ of the build process."
(print-escape-control-characters t)
(print-escape-nonascii t)
(prin1 (if (and (fboundp 'cl-prin1)
- ;; If we're being called while
- ;; bootstrapping, we won't be able to load
- ;; cl-print.
- (require 'cl-print nil t))
+ (fboundp 'cl-defmethod) ;Used by `cl-print'.
+ (condition-case nil
+ (require 'cl-print)
+ (error nil)))
#'cl-prin1
#'prin1)))
(mapbacktrace
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 83948ad00d4..a175edcc671 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -388,6 +388,7 @@ Also store it in `eldoc-last-message' and return that
value."
(defun eldoc-display-message-no-interference-p ()
"Return nil if displaying a message would cause interference."
(not (or executing-kbd-macro
+ (bound-and-true-p edebug-active)
;; The following configuration shows "Matches..." in the
;; echo area when point is after a closing bracket, which
;; conflicts with eldoc.
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index bee86a38bb0..cd7b6a10868 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -130,7 +130,8 @@
(defvar markdown-fontify-code-blocks-natively)
(defvar company-backends)
(defvar company-tooltip-align-annotations)
-
+(defvar tramp-ssh-controlmaster-options)
+(defvar tramp-use-ssh-controlmaster-options)
;;; User tweakable stuff
@@ -1249,7 +1250,15 @@ This docstring appeases checkdoc, that's all."
(contact (cl-subseq contact 0 probe)))
`(:process
,(lambda ()
- (let ((default-directory default-directory))
+ (let ((default-directory default-directory)
+ ;; bug#61350: Tramp turns on a feature
+ ;; by default that can't (yet) handle
+ ;; very much data so we turn it off
+ ;; unconditionally -- just for our
+ ;; process.
+ (tramp-use-ssh-controlmaster-options t)
+ (tramp-ssh-controlmaster-options
+ "-o ControlMaster=no -o ControlPath=none"))
(make-process
:name readable-name
:command (setq server-info (eglot--cmd contact))
@@ -3653,6 +3662,15 @@ If NOERROR, return predicate, else erroring function."
(add-to-list 'desktop-minor-mode-handlers '(eglot--managed-mode . ignore)))
+;;; Misc
+;;;
+(defun eglot--debbugs-or-github-bug-uri ()
+ (format (if (string= (match-string 2) "github")
+ "https://github.com/joaotavora/eglot/issues/%s"
+ "https://debbugs.gnu.org/%s")
+ (match-string 3)))
+(put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t)
+
;;; Obsolete
;;;
@@ -3662,8 +3680,8 @@ If NOERROR, return predicate, else erroring function."
;; Local Variables:
-;; bug-reference-bug-regexp: "\\(github#\\([0-9]+\\)\\)"
-;; bug-reference-url-format: "https://github.com/joaotavora/eglot/issues/%s"
+;; bug-reference-bug-regexp: "\\(\\(github\\|bug\\)#\\([0-9]+\\)\\)"
+;; bug-reference-url-format: eglot--debbugs-or-github-bug-uri
;; checkdoc-force-docstrings-flag: nil
;; End:
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 9e639149ce0..9491658de2c 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1532,14 +1532,24 @@ Similar to `treesit-indent', but indent a region
instead."
(aref meta-vec (+ 1 (* idx meta-len))) nil)
(pcase-let* ((`(,anchor . ,offset) (treesit--indent-1))
(marker (aref meta-vec (* idx meta-len))))
- ;; Set ANCHOR.
- (when anchor
+ (if (not (and anchor offset))
+ ;; No indent for this line, either...
+ (if (markerp marker)
+ (progn
+ ;; ... Set marker and offset to do a dummy
+ ;; indent, or...
+ (back-to-indentation)
+ (move-marker marker (point))
+ (setf (aref meta-vec (+ 1 (* idx meta-len))) 0))
+ ;; ...Set anchor to nil so no indent is performed.
+ (setf (aref meta-vec (* idx meta-len)) nil))
+ ;; Set ANCHOR.
(if (markerp marker)
(move-marker marker anchor)
(setf (aref meta-vec (* idx meta-len))
- (copy-marker anchor t))))
- ;; SET OFFSET.
- (setf (aref meta-vec (+ 1 (* idx meta-len))) offset)))
+ (copy-marker anchor t)))
+ ;; SET OFFSET.
+ (setf (aref meta-vec (+ 1 (* idx meta-len))) offset))))
(cl-incf idx)
(setq lines-left-to-move (forward-line 1)))
;; Now IDX = last valid IDX + 1.
diff --git a/src/alloc.c b/src/alloc.c
index a05e4aa5811..6a7037b6bb0 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3729,7 +3729,8 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH
&optional DOCSTRING INT
&& FIXNATP (args[COMPILED_STACK_DEPTH])))
error ("Invalid byte-code object");
- pin_string (args[COMPILED_BYTECODE]); // Bytecode must be immovable.
+ /* Bytecode must be immovable. */
+ pin_string (args[COMPILED_BYTECODE]);
/* We used to purecopy everything here, if purify-flag was set. This worked
OK for Emacs-23, but with Emacs-24's lexical binding code, it can be
@@ -5930,7 +5931,7 @@ purecopy (Lisp_Object obj)
memcpy (vec, objp, nbytes);
for (i = 0; i < size; i++)
vec->contents[i] = purecopy (vec->contents[i]);
- // Byte code strings must be pinned.
+ /* Byte code strings must be pinned. */
if (COMPILEDP (obj) && size >= 2 && STRINGP (vec->contents[1])
&& !STRING_MULTIBYTE (vec->contents[1]))
pin_string (vec->contents[1]);
diff --git a/src/bytecode.c b/src/bytecode.c
index 124348e5b35..74a94859aba 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -789,10 +789,10 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template,
Lisp_Object template;
Lisp_Object bytecode;
if (COMPILEDP (call_fun)
- // Lexical binding only.
+ /* Lexical binding only. */
&& (template = AREF (call_fun, COMPILED_ARGLIST),
FIXNUMP (template))
- // No autoloads.
+ /* No autoloads. */
&& (bytecode = AREF (call_fun, COMPILED_BYTECODE),
!CONSP (bytecode)))
{
diff --git a/src/profiler.c b/src/profiler.c
index 81b5e7b0cf0..8247b2e90c6 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -505,6 +505,9 @@ Before returning, a new log is allocated for future
samples. */)
void
malloc_probe (size_t size)
{
+ if (EQ (backtrace_top_function (), QAutomatic_GC)) /* bug#60237 */
+ /* FIXME: We should do something like what we did with `cpu_gc_count`. */
+ return;
eassert (HASH_TABLE_P (memory_log));
record_backtrace (XHASH_TABLE (memory_log), min (size,
MOST_POSITIVE_FIXNUM));
}
diff --git a/src/xdisp.c b/src/xdisp.c
index c5c4321af77..7a4f683c973 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4583,7 +4583,7 @@ face_at_pos (const struct it *it, enum
lface_attribute_index attr_filter)
&next_stop,
base_face_id, false,
attr_filter);
- } // !STRINGP (it->string))
+ } /* !STRINGP (it->string) */
}