Subject: Re: bug#60379: [PATCH] Eglot: don't use "nil" as minibuffer initial input

From: Eli Zaretskii <[email-masked]>
Date: Sat, 14 Jan 2023 10:16:03 +0200

> From: João Távora <[email-masked]>
> Cc: Eshel Yaron <[email-masked]>,  [email-masked]
> Date: Thu, 12 Jan 2023 10:20:27 +0000
> 
> The idea looks sane, but I think 'format-prompt' can't be used if Eglot
> is to continue supporting Emacs 26 and 27.  Also I'd prefer if the patch
> is slightly less disruptive to whitespace, like this:
> 
> diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
> index 15cb1b6fad..eb3b51ed8b 100644
> --- a/lisp/progmodes/eglot.el
> +++ b/lisp/progmodes/eglot.el
> @@ -991,6 +991,7 @@ eglot--guess-contact
>  non-nil, maybe prompt user, else error as soon as something can't
>  be guessed."
>    (let* ((guessed-mode (if buffer-file-name major-mode))
> +         (guessed-mode-name (and guessed-mode (symbol-name guessed-mode)))
>           (main-mode
>            (cond
>             ((and interactive
> @@ -1000,7 +1001,7 @@ eglot--guess-contact
>               (completing-read
>                "[eglot] Start a server to manage buffers of what major mode? "
>                (mapcar #'symbol-name (eglot--all-major-modes)) nil t
> -              (symbol-name guessed-mode) nil (symbol-name guessed-mode) nil)))
> +              guessed-mode-name nil guessed-mode-name nil)))
>             ((not guessed-mode)
>              (eglot--error "Can't guess mode to manage for `%s'" (current-buffer)))
>             (t guessed-mode)))
> 
> Other than that, it's fine to commit.

OK, done, and closing the bug.

Yaron, this change was small enough to accept without copyright
assignment, but if you intend to continue contributing to Emacs (and
we hope you do), I recommend to start your copyright assignment
paperwork rolling at this time.  If you agree, I will send you the
form to fill and the instructions to email it.

Thanks.