From d6b8a0a24f617f639e91712acf093eb3a7e1ac84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sat, 1 Dec 2018 22:47:56 +0000 Subject: [PATCH] Fix https://github.com/joaotavora/eglot/issues/116, https://github.com/joaotavora/eglot/issues/150: 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. --- eglot.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index 8d3977091d..b240e0e860 100644 --- a/eglot.el +++ b/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)