From 355c9c4a656719a94e0a25a04eb913470d46b7dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 1 Jan 2019 14:56:46 +0000 Subject: [PATCH] Allow read-only modes for markup rendering gfm-mode is read-only, so it must be set after the string has been inserted in the temporary buffer. * eglot.el (eglot--format-markup): Insert string before setting mode. GitHub-reference: close https://github.com/joaotavora/eglot/issues/197 --- lisp/progmodes/eglot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 2411c6a89c9..4416e52c705 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1030,8 +1030,8 @@ Doubles as an indicator of snippet support." (list (plist-get markup :value) major-mode)))) (with-temp-buffer - (ignore-errors (funcall mode)) - (insert string) (font-lock-ensure) (buffer-string)))) + (insert string) + (ignore-errors (funcall mode)) (font-lock-ensure) (buffer-string)))) (defcustom eglot-ignored-server-capabilites (list) "LSP server capabilities that Eglot could use, but won't. -- 2.39.2