commit a798a29f7519244b47ffc3035fcd8bf7bafea4d5 (HEAD, refs/remotes/origin/master) Merge: 65e99fb08b8 59365f92856 Author: Stefan Kangas Date: Thu Mar 2 06:30:15 2023 +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 commit 65e99fb08b8f14a5381ad488ad2b1e2a6149f60f Merge: c9b0f1df0d3 db50545e3e9 Author: Stefan Kangas Date: Thu Mar 2 06:30:15 2023 +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. commit c9b0f1df0d372a0b10094146913f4c2657721c36 Merge: a1cb77771a2 07f3236133b Author: Stefan Kangas Date: Thu Mar 2 06:30:15 2023 +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 commit a1cb77771a29b97ac3a256322129d12368ec4e4b Author: Po Lu Date: Thu Mar 2 03:07:37 2023 +0000 ; * src/haikufont.c (haikufont_open): Remove unused variable. diff --git a/src/haikufont.c b/src/haikufont.c index a025dec58bb..b4c2e547247 100644 --- a/src/haikufont.c +++ b/src/haikufont.c @@ -760,7 +760,7 @@ haikufont_open (struct frame *f, Lisp_Object font_entity, int pixel_size) struct haiku_font_pattern ptn; struct font *font; void *be_font; - Lisp_Object font_object, tem, extra, indices, antialias; + Lisp_Object font_object, extra, indices, antialias; int px_size, min_width, max_width; int avg_width, height, space_width, ascent; int descent, underline_pos, underline_thickness; commit 59365f928565f1be551b1697b9246b00cb87a9b7 Author: Yuan Fu Date: Wed Mar 1 14:38:22 2023 -0800 * lisp/progmodes/go-ts-mode.el: Use treesit-language-available-p. treesit-ready-p does more checks than language grammar availability. diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 6043c86ac93..fbe085a2c6c 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -393,7 +393,7 @@ go-mod-ts-mode (treesit-major-mode-setup))) -(if (treesit-ready-p 'gomod t) +(if (treesit-language-available-p 'gomod) (add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode))) (provide 'go-ts-mode) commit 56cd810b9d1a4d537bee5a2fd954d6e0d346631a Author: Yuan Fu Date: Wed Mar 1 14:34:56 2023 -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. diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index e8f93d14744..6043c86ac93 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -393,7 +393,7 @@ go-mod-ts-mode (treesit-major-mode-setup))) -(if (treesit-ready-p 'gomod) +(if (treesit-ready-p 'gomod t) (add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode))) (provide 'go-ts-mode) commit b06d5519664b0f417be7f415964b0a4decc0f732 Author: Yuan Fu Date: Wed Mar 1 14:01:47 2023 -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. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index cc99b8e213e..259b96d342e 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -356,17 +356,17 @@ c-ts-mode--indent-styles ;; int[5] a = { 0, 0, 0, 0 }; ((match nil "initializer_list" nil 1 1) parent-bol c-ts-mode-indent-offset) - ((match nil "initializer_list" nil 2) c-ts-mode--anchor-prev-sibling 0) + ((parent-is "initializer_list") c-ts-mode--anchor-prev-sibling 0) ;; Statement in enum. ((match nil "enumerator_list" nil 1 1) standalone-parent c-ts-mode-indent-offset) - ((match nil "enumerator_list" nil 2) c-ts-mode--anchor-prev-sibling 0) + ((parent-is "enumerator_list") c-ts-mode--anchor-prev-sibling 0) ;; Statement in struct and union. ((match nil "field_declaration_list" nil 1 1) standalone-parent c-ts-mode-indent-offset) - ((match nil "field_declaration_list" nil 2) c-ts-mode--anchor-prev-sibling 0) + ((parent-is "field_declaration_list") c-ts-mode--anchor-prev-sibling 0) ;; Statement in {} blocks. ((match nil "compound_statement" nil 1 1) standalone-parent c-ts-mode-indent-offset) - ((match nil "compound_statement" nil 2) c-ts-mode--anchor-prev-sibling 0) + ((parent-is "compound_statement") c-ts-mode--anchor-prev-sibling 0) ;; Opening bracket. ((node-is "compound_statement") standalone-parent c-ts-mode-indent-offset) ;; Bug#61291. diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index 36d7af4faf1..904c6498cb5 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -84,14 +84,6 @@ int main() } =-=-= -Name: Empty Line -=-= -int main() -{ - | -} -=-=-= - Name: Concecutive blocks (GNU Style) (bug#60873) =-= @@ -385,3 +377,28 @@ namespace test { }; } =-=-= + +Code: + (lambda () + (c-ts-mode) + (setq-local indent-tabs-mode nil) + (setq-local c-ts-mode-indent-offset 2) + (c-ts-mode-set-style 'gnu) + (indent-for-tab-command)) + +Name: Empty Line +=-= +int main() +{ + | +} +=-=-= + +Name: Empty Line Previous Sibling +=-= +int main() +{ + int a = 1; + | +} +=-=-= commit 6b2720778dc9531c0157bc7e773d2011bdf905e3 Author: Yuan Fu Date: Wed Mar 1 13:55:53 2023 -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. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 53f7839e4af..cc99b8e213e 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -257,7 +257,7 @@ c-ts-mode--preproc-offset 0 c-ts-mode-indent-offset))) -(defun c-ts-mode--anchor-prev-sibling (node &rest _) +(defun c-ts-mode--anchor-prev-sibling (node parent bol &rest _) "Return the start of the previous named sibling of NODE. This anchor handles the special case where the previous sibling @@ -273,8 +273,14 @@ c-ts-mode--anchor-prev-sibling the labeled_statement. Return nil if a) there is no prev-sibling, or 2) prev-sibling -doesn't have a child." - (when-let ((prev-sibling (treesit-node-prev-sibling node t))) +doesn't have a child. + +PARENT and BOL are like other anchor functions." + (when-let ((prev-sibling + (or (treesit-node-prev-sibling node t) + (treesit-node-prev-sibling + (treesit-node-first-child-for-pos parent bol) t) + (treesit-node-child parent -1 t)))) (while (and prev-sibling (equal "labeled_statement" (treesit-node-type prev-sibling))) diff --git a/lisp/treesit.el b/lisp/treesit.el index fe9ed399773..dbd102d00b3 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1237,9 +1237,17 @@ treesit-simple-indent-presets (line-beginning-position)) (throw 'term (point))) (setq parent (treesit-node-parent parent))))))) - (cons 'prev-sibling (lambda (node &rest _) + (cons 'prev-sibling (lambda (node parent bol &rest _) (treesit-node-start - (treesit-node-prev-sibling node)))) + (or (treesit-node-prev-sibling node t) + ;; If node is nil (indenting empty + ;; line), we still try to guess the + ;; previous sibling. + (treesit-node-prev-sibling + (treesit-node-first-child-for-pos + parent bol) + t) + (treesit-node-child parent -1 t))))) (cons 'no-indent (lambda (_n _p bol &rest _) bol)) (cons 'prev-line (lambda (_n _p bol &rest _) (save-excursion commit db50545e3e9cd51dd8e6ad93034dc48d45b705e2 Author: João Távora Date: Mon Feb 27 20:40:48 2023 +0200 * lisp/icomplete.el (fido-mode): Enable in-buffer completion (bug#45763). Backport: (cherry picked from commit b5c13032538377b0037c745715613693a1580f81) diff --git a/lisp/icomplete.el b/lisp/icomplete.el index fd6a09e8702..0adb0e5afeb 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -443,9 +443,12 @@ fido-mode :global t (remove-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup) (remove-hook 'minibuffer-setup-hook #'icomplete--fido-mode-setup) + (remove-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup) (when fido-mode (icomplete-mode -1) (setq icomplete-mode t) + (when icomplete-in-buffer + (add-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup)) (add-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup) (add-hook 'minibuffer-setup-hook #'icomplete--fido-mode-setup))) commit ef72e99e867e76135644de6ba29c8d423c5a00ae Author: Juri Linkov Date: Mon Feb 27 20:32:53 2023 +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) diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 014f38b2024..fd6a09e8702 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -215,15 +215,29 @@ icomplete-force-complete-and-exit ;; calculated, This causes the first cached completion to ;; be taken (i.e. the one that the user sees highlighted) completion-all-sorted-completions) - (minibuffer-force-complete-and-exit) + (if (window-minibuffer-p) + (minibuffer-force-complete-and-exit) + (minibuffer-force-complete (icomplete--field-beg) + (icomplete--field-end) + 'dont-cycle) + (completion-in-region-mode -1)) ;; Otherwise take the faster route... - (minibuffer-complete-and-exit))) + (if (window-minibuffer-p) + (minibuffer-complete-and-exit) + (completion-complete-and-exit + (icomplete--field-beg) + (icomplete--field-end) + (lambda () (completion-in-region-mode -1)))))) (defun icomplete-force-complete () "Complete the icomplete minibuffer." (interactive) ;; We're not at all interested in cycling here (bug#34077). - (minibuffer-force-complete nil nil 'dont-cycle)) + (if (window-minibuffer-p) + (minibuffer-force-complete nil nil 'dont-cycle) + (minibuffer-force-complete (icomplete--field-beg) + (icomplete--field-end) + 'dont-cycle))) ;; Apropos `icomplete-scroll', we implement "scrolling icomplete" ;; within classic icomplete, which is "rotating", by contrast. commit 07f3236133b01cb65806eb1a6bf2ebaecbdd2d81 Author: Stefan Monnier Date: Wed Mar 1 12:36:58 2023 -0500 * src/profiler.c (malloc_probe): Make it safe for GC (bug#60237) 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 @@ DEFUN ("profiler-memory-log", 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)); } commit 1f1d36fa8080479083af8c69e8ea3756d51910fb Author: Stefan Monnier Date: Wed Mar 1 12:31:09 2023 -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. 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 @@ 'debug-early-backtrace (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 commit 4b99015e15a23bd5cbec021d53ef9fcca25b2441 Author: Michael Albinus Date: Wed Mar 1 17:07:59 2023 +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. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index b3d837f9514..ce443b558a3 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -631,7 +631,6 @@ tramp-perl-file-name-all-completions print \"$f\\n\"; } } -print \"ok\\n\" ' \"$1\" %n" "Perl script to produce output suitable for use with `file-name-all-completions' on the remote file system. @@ -1768,57 +1767,34 @@ tramp-sh-handle-file-name-all-completions ;; Get a list of directories and files, including reliably ;; tagging the directories with a trailing "/". Because I ;; rock. --daniel@danann.net - (tramp-send-command - v - (if (tramp-get-remote-perl v) - (progn - (tramp-maybe-send-script - v tramp-perl-file-name-all-completions - "tramp_perl_file_name_all_completions") - (format "tramp_perl_file_name_all_completions %s" - (tramp-shell-quote-argument localname))) - - (format (concat - "(cd %s 2>&1 && %s -a 2>%s" - " | while IFS= read f; do" - " if %s -d \"$f\" 2>%s;" - " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done" - " && \\echo ok) || \\echo fail") - (tramp-shell-quote-argument localname) - (tramp-get-ls-command v) - (tramp-get-remote-null-device v) - (tramp-get-test-command v) - (tramp-get-remote-null-device v)))) - - ;; Now grab the output. - (with-current-buffer (tramp-get-buffer v) - (goto-char (point-max)) - - ;; Check result code, found in last line of output. - (forward-line -1) - (if (looking-at-p (rx bol "fail" eol)) - (progn - ;; Grab error message from line before last line - ;; (it was put there by `cd 2>&1'). - (forward-line -1) - (tramp-error - v 'file-error - "tramp-sh-handle-file-name-all-completions: %s" - (buffer-substring (point) (line-end-position)))) - ;; For peace of mind, if buffer doesn't end in `fail' - ;; then it should end in `ok'. If neither are in the - ;; buffer something went seriously wrong on the remote - ;; side. - (unless (looking-at-p (rx bol "ok" eol)) - (tramp-error - v 'file-error - (concat "tramp-sh-handle-file-name-all-completions: " - "internal error accessing `%s': `%s'") - (tramp-shell-quote-argument localname) (buffer-string)))) - - (while (zerop (forward-line -1)) - (push (buffer-substring (point) (line-end-position)) result))) - result)))))) + (when (tramp-send-command-and-check + v + (if (tramp-get-remote-perl v) + (progn + (tramp-maybe-send-script + v tramp-perl-file-name-all-completions + "tramp_perl_file_name_all_completions") + (format "tramp_perl_file_name_all_completions %s" + (tramp-shell-quote-argument localname))) + + (format (concat + "cd %s 2>&1 && %s -a 2>%s" + " | while IFS= read f; do" + " if %s -d \"$f\" 2>%s;" + " then \\echo \"$f/\"; else \\echo \"$f\"; fi;" + " done") + (tramp-shell-quote-argument localname) + (tramp-get-ls-command v) + (tramp-get-remote-null-device v) + (tramp-get-test-command v) + (tramp-get-remote-null-device v)))) + + ;; Now grab the output. + (with-current-buffer (tramp-get-buffer v) + (goto-char (point-max)) + (while (zerop (forward-line -1)) + (push (buffer-substring (point) (line-end-position)) result))) + result))))))) ;; cp, mv and ln diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 69004bdbdf3..948bf0ab9e2 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2530,7 +2530,7 @@ tramp-test10-write-region (rx bos)) tramp--test-messages)))))) - ;; We do not test lockname here. See + ;; We do not test the lock file here. See ;; `tramp-test39-make-lock-file-name'. ;; Do not overwrite if excluded. @@ -4635,6 +4635,10 @@ tramp-test26-file-name-completion ;; Cleanup. (ignore-errors (delete-directory tmp-name 'recursive))))))) +(tramp--test-deftest-with-perl tramp-test26-file-name-completion) + +(tramp--test-deftest-with-ls tramp-test26-file-name-completion) + ;; This test is inspired by Bug#51386, Bug#52758, Bug#53513, Bug#54042 ;; and Bug#60505. (ert-deftest tramp-test26-interactive-file-name-completion () @@ -6561,7 +6565,7 @@ tramp-test39-make-lock-file-name (lambda (&rest _args) "yes"))) (kill-buffer))) ;; A new connection changes process id, and also the - ;; lockname contents. But the lock file still exists. + ;; lock file contents. But it still exists. (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) (should (stringp (with-no-warnings (file-locked-p tmp-name1)))) commit 99df815c153265706edc839b7467fb3ae3b6e1b1 Author: Eli Zaretskii Date: Wed Mar 1 17:35:51 2023 +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. 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 @@ eldoc-display-message-p (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. commit 0a4b1c0102d4062d24e19340f863b9df25e07ab3 Author: João Távora Date: Wed Mar 1 13:24:07 2023 +0000 ; Eglot: improve bug-reference-url-format/bug-reference-url-regexp * lisp/progmodes/eglot.el (eglot--debbugs-or-github-bug-uri): New helper. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 119b4f64c8d..36aafac8938 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3661,6 +3661,15 @@ eglot-inlay-hints-mode (with-eval-after-load 'desktop (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 ;;; @@ -3671,8 +3680,8 @@ eglot-inlay-hints-mode ;; 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: commit 42f46913884c5e431a0e6cc80b1808fc0ca636cf Author: Mattias Engdegård Date: Wed Mar 1 13:37:06 2023 +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. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 12aa8fb3982..0ae4c452c73 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -515,9 +515,7 @@ byte-optimize-form-code-walker form) nil))))) (byte-compile-log " %s called for effect; deleted" fn) - ;; appending a nil here might not be necessary, but it can't hurt. - (byte-optimize-form - (cons 'progn (append (cdr form) '(nil))) t)) + (byte-optimize-form (cons 'progn (cdr form)) t)) (_ ;; Otherwise, no args can be considered to be for-effect, commit 40c9fc8e3b3f55c9122b95e21660b5709109bd1a Author: João Távora Date: Wed Mar 1 11:12:51 2023 +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. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 40fc8f8a12f..119b4f64c8d 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 @@ eglot--connect (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)) commit 4a6db125b9ee5d681aa09d86c9283526f204b274 Author: Yuan Fu Date: Tue Feb 28 23:51:06 2023 -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. diff --git a/lisp/treesit.el b/lisp/treesit.el index 052f641abfd..fe9ed399773 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1532,14 +1532,24 @@ treesit-indent-region (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. commit 7ef9a8210c9b6c2adf6094d8e85a50edd91e54e3 Author: Po Lu Date: Wed Mar 1 14:28:04 2023 +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! diff --git a/src/alloc.c b/src/alloc.c index f7a0a4a80c8..05a19f0b7e9 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3542,7 +3542,8 @@ and (optional) INTERACTIVE-SPEC. && 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 @@ -5687,7 +5688,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 @@ #define DEFINE(name, value) [name] = &&insn_ ## name, 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/xdisp.c b/src/xdisp.c index b64f1d35cbc..6219bb9ec6e 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) */ }