From 92ce9a30f1cfa8a974b9e40dec1126751aef1737 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sat, 1 Dec 2018 22:47:56 +0000 Subject: [PATCH] Don't break in indirect buffers Indirect buffers, such as the ones created by ediff-regions-wordwise, have eglot enabled but not buffer-file-name. Resort to the finding the file-name of the original buffer for these. * eglot.el (eglot--TextDocumentIdentifier): Work in indirect buffers. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/116 GitHub-reference: fix https://github.com/joaotavora/eglot/issues/150 --- lisp/progmodes/eglot.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 8d3977091d9..b240e0e860b 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1345,7 +1345,10 @@ THINGS are either registrations or unregisterations." (defun eglot--TextDocumentIdentifier () "Compute TextDocumentIdentifier object for current buffer." - `(:uri ,(eglot--path-to-uri buffer-file-name))) + `(:uri ,(eglot--path-to-uri (or buffer-file-name + (ignore-errors + (buffer-file-name + (buffer-base-buffer))))))) (defvar-local eglot--versioned-identifier 0) -- 2.39.2