bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58839: [Patch] Re: bug#58839: 29.0.50; project-kill-buffer fails whe


From: Dmitry Gutov
Subject: bug#58839: [Patch] Re: bug#58839: 29.0.50; project-kill-buffer fails when Eglot is running
Date: Fri, 28 Oct 2022 21:40:58 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

On 28.10.2022 21:20, Philip Kaludercic wrote:
Dmitry Gutov<dgutov@yandex.ru>  writes:

On 28.10.2022 20:28, Philip Kaludercic wrote:
I still don't agree that this is the right interpretation of the issue
or solution, but wouldn't it be better to add this to
`project-kill-buffer-conditions'?
I don't mind a new variable specifically, but
kill-buffer-query-functions seems to serve this purpose just fine.

And no extra "coupling between two packages" will be added.
How would you imagine it being used in this case?

(defun eglot-before-kill-special ()
  (eglot-shutdown)
  t)

;; somewhere inside that special buffer's setup:
(add-hook 'kill-buffer-query-functions #'eglot-before-kill-special nil t)

Or use kill-buffer-hook, no need to watch the return value then.

In either case, it will also cover the scenario of the user killing the background buffer some other way.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]