From: João Távora Date: Tue, 1 Jan 2019 14:56:46 +0000 (+0000) Subject: Allow read-only modes for markup rendering X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~350 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=355c9c4a656719a94e0a25a04eb913470d46b7dc;p=emacs.git 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 --- 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.