Merge from origin/emacs-29

97a83ff31f Eglot: fix M-x eglot-show-workspace-configuration (bug#61...
48a0804d10 ruby-mode: Fix method call indentation in rhs of multiple...
16d012cf3b * lisp/net/tramp.el (tramp-remote-path): Improve docstring.
b371697cdc Minor change in 'dired--find-possibly-alternative-file'
c2b5c6acc5 Implement prefix arg for 'c-ts-mode-toggle-comment-style'
eb2ab52fb0 Defaults to zero for image-dired--number-of-thumbnails
5dc163f592 ; Add a doc string for 'ediff-window-display-p' obsolescence
This commit is contained in:
Stefan Kangas 2023-03-01 06:30:20 +01:00
commit 4a5335158d
8 changed files with 67 additions and 53 deletions

View file

@ -2728,7 +2728,8 @@ directory in another window."
(defun dired--find-possibly-alternative-file (file)
"Find FILE, but respect `dired-kill-when-opening-new-dired-buffer'."
(if (and dired-kill-when-opening-new-dired-buffer
(file-directory-p file))
(file-directory-p file)
(< (length (get-buffer-window-list)) 2))
(progn
(set-buffer-modified-p nil)
(dired--find-file #'find-alternate-file file))

View file

@ -546,7 +546,7 @@ Restore any changes to the window configuration made by calling
(t
(image-dired-line-up-dynamic))))
(defvar-local image-dired--number-of-thumbnails nil)
(defvar-local image-dired--number-of-thumbnails 0)
;;;###autoload
(defun image-dired-display-thumbs (&optional arg append do-not-pop)

View file

@ -1370,7 +1370,9 @@ special value `tramp-default-remote-path'.
`Private Directories' are the settings of the $PATH environment,
as given in your `~/.profile'. This entry is represented in
the list by the special value `tramp-own-remote-path'."
the list by the special value `tramp-own-remote-path'.
For a full discussion, see Info node `(tramp) Remote programs'."
:group 'tramp
:type '(repeat (choice
(const :tag "Default Directories" tramp-default-remote-path)

View file

@ -88,19 +88,23 @@
:safe 'integerp
:group 'c)
(defun c-ts-mode-toggle-comment-style ()
(defun c-ts-mode-toggle-comment-style (&optional arg)
"Toggle the comment style between block and line comments.
Optional numeric ARG, if supplied, switches to block comment
style when positive, to line comment style when negative, and
just toggles it when zero or left out."
(interactive)
(pcase-let ((`(,starter . ,ender)
(if (string= comment-start "// ")
(cons "/* " " */")
(cons "// " ""))))
(setq-local comment-start starter
comment-end ender))
(c-ts-mode-set-modeline))
(interactive "P")
(let ((prevstate-line (string= comment-start "// ")))
(when (or (not arg)
(zerop (setq arg (prefix-numeric-value arg)))
(xor (> 0 arg) prevstate-line))
(pcase-let ((`(,starter . ,ender)
(if prevstate-line
(cons "/* " " */")
(cons "// " ""))))
(setq-local comment-start starter
comment-end ender))
(c-ts-mode-set-modeline))))
(defun c-ts-mode-set-modeline ()
(setq mode-name

View file

@ -961,7 +961,7 @@ PRESERVE-BUFFERS as in `eglot-shutdown', which see."
"Lookup `eglot-server-programs' for MODE.
Return (MANAGED-MODES LANGUAGE-ID CONTACT-PROXY).
MANAGED-MODES is a list with MODE as its first elements.
MANAGED-MODES is a list with MODE as its first element.
Subsequent elements are other major modes also potentially
managed by the server that is to manage MODE.
@ -1335,10 +1335,7 @@ This docstring appeases checkdoc, that's all."
(lambda ()
(setf (eglot--inhibit-autoreconnect server)
(null eglot-autoreconnect)))))))
(let ((default-directory (project-root project))
(major-mode (car managed-modes)))
(hack-dir-local-variables-non-file-buffer)
(run-hook-with-args 'eglot-connect-hook server))
(run-hook-with-args 'eglot-connect-hook server)
(eglot--message
"Connected! Server `%s' now managing `%s' buffers \
in project `%s'."
@ -2444,9 +2441,7 @@ format described above.")
(defun eglot-show-workspace-configuration (&optional server)
"Dump `eglot-workspace-configuration' as JSON for debugging."
(interactive (list (and (eglot-current-server)
(eglot--read-server "Server configuration"
(eglot-current-server)))))
(interactive (list (eglot--read-server "Show workspace configuration for" t)))
(let ((conf (eglot--workspace-configuration-plist server)))
(with-current-buffer (get-buffer-create "*EGLOT workspace configuration*")
(erase-buffer)
@ -2457,14 +2452,23 @@ format described above.")
(json-pretty-print-buffer))
(pop-to-buffer (current-buffer)))))
(defun eglot--workspace-configuration (server)
(if (functionp eglot-workspace-configuration)
(funcall eglot-workspace-configuration server)
eglot-workspace-configuration))
(defun eglot--workspace-configuration-plist (server)
"Returns `eglot-workspace-configuration' suitable for serialization."
(let ((val (eglot--workspace-configuration server)))
(defun eglot--workspace-configuration-plist (server &optional path)
"Returns SERVER's workspace configuration as a plist.
If PATH consider that file's `file-name-directory' to get the
local value of the `eglot-workspace-configuration' variable, else
use the root of SERVER's `eglot--project'."
(let ((val (with-temp-buffer
(setq default-directory
(if path
(file-name-directory path)
(project-root (eglot--project server))))
;; Set the major mode to be the first of the managed
;; modes. This is the one the user started eglot in.
(setq major-mode (car (eglot--major-modes server)))
(hack-dir-local-variables-non-file-buffer)()
(if (functionp eglot-workspace-configuration)
(funcall eglot-workspace-configuration server)
eglot-workspace-configuration))))
(or (and (consp (car val))
(cl-loop for (section . v) in val
collect (if (keywordp section) section
@ -2489,25 +2493,17 @@ When called interactively, use the currently active server"
(apply #'vector
(mapcar
(eglot--lambda ((ConfigurationItem) scopeUri section)
(with-temp-buffer
(let* ((uri-path (eglot--uri-to-path scopeUri))
(default-directory
(if (and uri-path
(not (string-empty-p uri-path))
(file-directory-p uri-path))
(file-name-as-directory uri-path)
(project-root (eglot--project server)))))
(setq-local major-mode (car (eglot--major-modes server)))
(hack-dir-local-variables-non-file-buffer)
(cl-loop for (wsection o)
on (eglot--workspace-configuration-plist server)
by #'cddr
when (string=
(if (keywordp wsection)
(substring (symbol-name wsection) 1)
wsection)
section)
return o))))
(cl-loop
with scope-uri-path = (and scopeUri (eglot--uri-to-path scopeUri))
for (wsection o)
on (eglot--workspace-configuration-plist server scope-uri-path)
by #'cddr
when (string=
(if (keywordp wsection)
(substring (symbol-name wsection) 1)
wsection)
section)
return o))
items)))
(defun eglot--signal-textDocument/didChange ()

View file

@ -916,11 +916,14 @@ This only affects the output of the command `ruby-toggle-block'."
(smie-indent--hanging-p))
ruby-indent-level)))
(`(:before . "=")
(save-excursion
(and (smie-rule-parent-p " @ ")
(goto-char (nth 1 (smie-indent--parent)))
(smie-rule-prev-p "def=")
(cons 'column (+ (current-column) ruby-indent-level -3)))))
(or
(save-excursion
(and (smie-rule-parent-p " @ ")
(goto-char (nth 1 (smie-indent--parent)))
(smie-rule-prev-p "def=")
(cons 'column (+ (current-column) ruby-indent-level -3))))
(and (smie-rule-parent-p ",")
(smie-rule-parent))))
(`(:after . ,(or "?" ":"))
(if ruby-after-operator-indent
ruby-indent-level

View file

@ -1527,7 +1527,10 @@ This default should work without changes."
(define-obsolete-function-alias 'ediff-convert-standard-filename #'convert-standard-filename "28.1")
(define-obsolete-function-alias 'ediff-hide-face #'ignore "28.1")
(define-obsolete-function-alias 'ediff-file-remote-p #'file-remote-p "29.1")
(define-obsolete-function-alias 'ediff-window-display-p #'display-graphic-p "29.1")
(define-obsolete-function-alias 'ediff-window-display-p #'display-graphic-p "29.1"
"To prevent Ediff from creating frames, see `ediff-window-setup-function'.
Set it to `ediff-setup-windows-plain' to do everything in a single frame,
even on GUI terminal.")
(define-obsolete-function-alias 'ediff-mouse-event-p #'mouse-event-p "29.1")
(provide 'ediff-init)

View file

@ -163,6 +163,11 @@ def test2 (arg)
)
end
# Bug#61871
foo, bar = baz.(
some_arg
)
# Bug#17097
if x == :!=
something