commit 8678708ad10b17a4609c950a02cf39ab9ff86317 (HEAD, refs/remotes/origin/master) Author: Wilhelm H Kirschbaum Date: Sun Apr 2 11:28:27 2023 +0200 Improve sigil fontification for elixir-ts-mode * lisp/progmodes/elixir-ts-mode.el: (elixir-ts--font-lock-settings): Update sigil queries. diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index e0335fe15ed..6d7420b63dc 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -455,16 +455,13 @@ elixir-ts--font-lock-settings :override t `((sigil (sigil_name) @elixir-ts-font-sigil-name-face - quoted_start: _ @font-lock-string-face - quoted_end: _ @font-lock-string-face - (:match "^[sSwWpP]$" @elixir-ts-font-sigil-name-face)) + (:match "^[sSwWpPUD]$" @elixir-ts-font-sigil-name-face)) @font-lock-string-face (sigil + "~" @font-lock-string-face (sigil_name) @elixir-ts-font-sigil-name-face - quoted_start: _ @font-lock-regex-face - quoted_end: _ @font-lock-regex-face (:match "^[rR]$" @elixir-ts-font-sigil-name-face)) - @font-lock-regex-face + @font-lock-regexp-face (sigil "~" @font-lock-string-face (sigil_name) @elixir-ts-font-sigil-name-face commit eb0a9e463347b0191a07befcc3138db37f77b402 Author: Wilhelm H Kirschbaum Date: Sun Apr 2 11:26:02 2023 +0200 Improve list indentation for elixir-ts-mode * lisp/progmodes/elixir-ts-mode.el: (elixir-ts--argument-indent-offset): Add empty line check. (elixir-ts--argument-indent-anchor): Change ERROR offset. * test/lisp/progmodes/elixir-ts-mode-resources/indent.erts: Add test. diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 286f3e39f43..e0335fe15ed 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -169,7 +169,13 @@ elixir-ts--syntax-table (defun elixir-ts--argument-indent-offset (node _parent &rest _) "Return the argument offset position for NODE." - (if (treesit-node-prev-sibling node t) 0 elixir-ts-indent-offset)) + (if (or (treesit-node-prev-sibling node t) + ;; Don't indent if this is the first node or + ;; if the line is empty. + (save-excursion + (beginning-of-line) + (looking-at-p "[[:blank:]]*$"))) + 0 elixir-ts-indent-offset)) (defun elixir-ts--argument-indent-anchor (node parent &rest _) "Return the argument anchor position for NODE and PARENT." @@ -264,7 +270,7 @@ elixir-ts--indent-rules ;; Handle incomplete maps when parent is ERROR. ((n-p-gp "^binary_operator$" "ERROR" nil) parent-bol 0) ;; When there is an ERROR, just indent to prev-line. - ((parent-is "ERROR") prev-line 0) + ((parent-is "ERROR") prev-line ,offset) ((node-is "^binary_operator$") (lambda (node parent &rest _) (let ((top-level diff --git a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts index ea5d9e62240..9ad604e5198 100644 --- a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts @@ -1,6 +1,5 @@ Code: (lambda () - (setq indent-tabs-mode nil) (elixir-ts-mode) (indent-region (point-min) (point-max))) @@ -330,3 +329,22 @@ defmodule Foo do end end =-=-= + +Code: + (lambda () + (elixir-ts-mode) + (newline) + (indent-for-tab-command)) + +Name: New list item + +=-= +[ + :foo,$ +] +=-= +[ + :foo, + $ +] +=-=-= commit 830bf66dadbb4b9b9393ade53b890b5497bdf479 Author: Dmitry Gutov Date: Wed Apr 5 03:00:57 2023 +0300 ruby-ts-mode: Add more constructs to treesit-sexp-type-regexp * lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): Add more constructs to treesit-sexp-type-regexp (bug#62086). diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index 6a7326af61d..ddf2ee98c3b 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -1121,9 +1121,13 @@ ruby-ts-mode "array" "hash" "parenthesized_statements" + "method_parameters" + "array_pattern" + "hash_pattern" "if" "unless" "case" + "case_match" "when" "block" "do_block" @@ -1132,8 +1136,8 @@ ruby-ts-mode "identifier" "constant" "simple_symbol" - "symbol_array" "hash_key_symbol" + "symbol_array" "string" "string_array" "heredoc_body" commit 30692f16b1527b364f2b5a242c67e54c0fa83328 Author: Michael Albinus Date: Tue Apr 4 13:37:18 2023 +0200 Improve Tramp robustness * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Check for `tramp-string-empty-or-nil-p'. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 2ef97d540a0..2df3006c1d9 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4496,7 +4496,7 @@ tramp-open-connection-setup-interactive-shell ;; Set `remote-tty' process property. (let ((tty (tramp-send-command-and-read vec "echo \\\"`tty`\\\"" 'noerror))) - (unless (string-empty-p tty) + (unless (tramp-string-empty-or-nil-p tty) (process-put proc 'remote-tty tty) (tramp-set-connection-property proc "remote-tty" tty))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index eb4cb9ce082..3420bb76d14 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4793,7 +4793,7 @@ tramp-handle-unlock-file (signal 'file-error `("Cannot remove lock file for" ,file))) ;; `userlock--handle-unlock-error' exists since Emacs 28.1. It ;; checks for `create-lockfiles' since Emacs 30.1, we don't need - ;; this chweck here, then. + ;; this check here, then. (error (unless (or (not create-lockfiles) (bound-and-true-p remote-file-name-inhibit-locks)) (tramp-compat-funcall 'userlock--handle-unlock-error err))))) commit b3046c6c1f29281e7437d5b6685e230c1cef631c Author: Michael Albinus Date: Tue Apr 4 09:43:09 2023 +0200 Display unlock-file warning only when file locks are enabled * lisp/files.el (remote-file-name-inhibit-locks): Fix docstring. * lisp/userlock.el (userlock--handle-unlock-error): Display warning only when `create-lockfiles' is non-nil. (Bug#62614) * lisp/net/tramp.el (tramp-handle-unlock-file): Raise a warning only when `create-lockfiles' is non-nil or `remote-file-name-inhibit-locks' is nil. diff --git a/lisp/files.el b/lisp/files.el index 6f02aac33d3..c6f53e5eaf8 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -555,7 +555,7 @@ lock-file-name-transforms :version "28.1") (defcustom remote-file-name-inhibit-locks nil - "Whether to use file locks for remote files." + "Whether to create file locks for remote files." :group 'files :version "28.1" :type 'boolean) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b1bd93410bc..eb4cb9ce082 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4791,10 +4791,12 @@ tramp-handle-unlock-file (delete-file lockname) ;; Trigger the unlock error. (signal 'file-error `("Cannot remove lock file for" ,file))) - ;; `userlock--handle-unlock-error' exists since Emacs 28.1. - (error - (when create-lockfiles - (tramp-compat-funcall 'userlock--handle-unlock-error err))))) + ;; `userlock--handle-unlock-error' exists since Emacs 28.1. It + ;; checks for `create-lockfiles' since Emacs 30.1, we don't need + ;; this chweck here, then. + (error (unless (or (not create-lockfiles) + (bound-and-true-p remote-file-name-inhibit-locks)) + (tramp-compat-funcall 'userlock--handle-unlock-error err))))) (defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix) "Like `load' for Tramp files." diff --git a/lisp/userlock.el b/lisp/userlock.el index 61f061d3e54..562bc0a0a9f 100644 --- a/lisp/userlock.el +++ b/lisp/userlock.el @@ -206,11 +206,12 @@ ask-user-about-supersession-help ;;;###autoload (defun userlock--handle-unlock-error (error) "Report an ERROR that occurred while unlocking a file." - (display-warning - '(unlock-file) - ;; There is no need to explain that this is an unlock error because - ;; ERROR is a `file-error' condition, which explains this. - (message "%s, ignored" (error-message-string error)) - :warning)) + (when create-lockfiles + (display-warning + '(unlock-file) + ;; There is no need to explain that this is an unlock error because + ;; ERROR is a `file-error' condition, which explains this. + (message "%s, ignored" (error-message-string error)) + :warning))) ;;; userlock.el ends here