unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Thomas Voss" <mail@thomasvoss.com>,
	"João Távora" <joaotavora@gmail.com>
Cc: 73472@debbugs.gnu.org
Subject: bug#73472: [PATCH] Substitute quotation marks in Eglot messages
Date: Wed, 25 Sep 2024 19:01:32 +0300	[thread overview]
Message-ID: <86setnbu3n.fsf@gnu.org> (raw)
In-Reply-To: <D4FF6JKKR5J9.3FQPLNQ9B4BS7@thomasvoss.com> (bug-gnu-emacs@gnu.org)

> Date: Wed, 25 Sep 2024 16:03:32 +0200
> From:  "Thomas Voss" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Another quick patch from myself.  This patch makes it so that the
> diagnostics and interactive prompts from Eglot (such as the prompt you
> iteract with when renaming a symbol) properly respect
> ‘text-quoting-style’.

Thanks.

> --- a/lisp/progmodes/eglot.el
> +++ b/lisp/progmodes/eglot.el
> @@ -1698,11 +1698,11 @@ eglot--connect
>  ;;;
>  (defun eglot--error (format &rest args)
>    "Error out with FORMAT with ARGS."
> -  (error "[eglot] %s" (apply #'format format args)))
> +  (error "[eglot] %s" (substitute-quotes (apply #'format format args))))
>  
>  (defun eglot--message (format &rest args)
>    "Message out with FORMAT with ARGS."
> -  (message "[eglot] %s" (apply #'format format args)))
> +  (message "[eglot] %s" (substitute-quotes (apply #'format format args))))
>  
>  (defun eglot--warn (format &rest args)
>    "Warning message with FORMAT and ARGS."
> @@ -3704,8 +3704,8 @@ eglot-rename
>    "Rename the current symbol to NEWNAME."
>    (interactive
>     (list (read-from-minibuffer
> -          (format "Rename `%s' to: " (or (thing-at-point 'symbol t)
> -                                         "unknown symbol"))
> +          (format-prompt "Rename `%s' to" nil (or (thing-at-point 'symbol t)
> +                                                  "unknown symbol"))
>            nil nil nil nil
>            (symbol-name (symbol-at-point)))))
>    (eglot-server-capable-or-lose :renameProvider)

Hmm... in the first two changes, how do we know that the quote
characters are indeed quoting stuff in the context where we substitute
quotes according to quoting-style?  Those functions get strings they
know nothing about, so it looks a bit risky to blindly convert any
quoting characters there.  Or what am I missing?





  reply	other threads:[~2024-09-25 16:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 14:03 bug#73472: [PATCH] Substitute quotation marks in Eglot messages Thomas Voss via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-25 16:01 ` Eli Zaretskii [this message]
2024-09-25 18:03   ` Thomas Voss via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-26  5:52     ` Eli Zaretskii
2024-09-26  6:11       ` João Távora
2024-10-05 10:14         ` Eli Zaretskii
2024-10-05 12:48           ` João Távora
2024-10-07  8:12             ` Thomas Voss via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-07 11:32               ` Eli Zaretskii
2024-10-19  7:07                 ` Eli Zaretskii
2024-10-19  8:33                   ` Thomas Voss via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-21 21:58                     ` Thomas Voss via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-09  9:09                       ` Eli Zaretskii
2024-11-09  9:20                         ` Thomas Voss via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86setnbu3n.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=73472@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=mail@thomasvoss.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).