[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 328c7ae 025/139: Auto update mode-line after sett
From: |
João Távora |
Subject: |
[elpa] externals/eglot 328c7ae 025/139: Auto update mode-line after setting some process properties |
Date: |
Mon, 14 May 2018 09:54:47 -0400 (EDT) |
branch: externals/eglot
commit 328c7aeb9dc0ede8334be6b520545abeb0db308a
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Auto update mode-line after setting some process properties
* eglot.el (eglot--define-process-var): Rework.
(eglot--short-name, eglot--spinner, eglot--status): Update mode-line
after setting it.
---
eglot.el | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/eglot.el b/eglot.el
index ff71a2f..1a82cc5 100644
--- a/eglot.el
+++ b/eglot.el
@@ -55,7 +55,12 @@
(if (project-current) ""
" (Also no current project)"))))
-(defmacro eglot--define-process-var (var-sym initval &optional doc)
+(defmacro eglot--define-process-var
+ (var-sym initval &optional doc mode-line-update-p)
+ "Define VAR-SYM as a generalized process-local variable.
+INITVAL is the default value. DOC is the documentation.
+MODE-LINE-UPDATE-P says to also force a mode line update
+after setting it."
(declare (indent 2))
`(progn
(put ',var-sym 'function-documentation ,doc)
@@ -67,12 +72,15 @@
(process-put proc ',var-sym def)
def))))
(gv-define-setter ,var-sym (to-store &optional process)
- (let ((prop ',var-sym))
- `(let ((proc (or ,process (eglot--current-process-or-lose))))
- (process-put proc ',prop ,to-store))))))
+ (let* ((prop ',var-sym))
+ ,(let ((form '(let ((proc (or ,process
(eglot--current-process-or-lose))))
+ (process-put proc ',prop ,to-store))))
+ (if mode-line-update-p
+ `(backquote (prog1 ,form (force-mode-line-update t)))
+ `(backquote ,form)))))))
(eglot--define-process-var eglot--short-name nil
- "A short name for the process")
+ "A short name for the process" t)
(eglot--define-process-var eglot--expected-bytes nil
"How many bytes declared by server")
@@ -91,11 +99,11 @@
(eglot--define-process-var eglot--spinner `(nil nil t)
"\"Spinner\" used by some servers.
-A list (ID WHAT DONE-P).")
+A list (ID WHAT DONE-P)." t)
(eglot--define-process-var eglot--status `(:unknown nil)
"Status as declared by the server.
-A list (WHAT SERIOUS-P).")
+A list (WHAT SERIOUS-P)." t)
(defun eglot--command (&optional errorp)
(let ((probe (cdr (assoc major-mode eglot-executables))))
- [elpa] externals/eglot 3403f86 027/139: Correctly report what we currently are capable of, (continued)
- [elpa] externals/eglot 3403f86 027/139: Correctly report what we currently are capable of, João Távora, 2018/05/14
- [elpa] externals/eglot 7c82a03 024/139: Start experimenting with python, João Távora, 2018/05/14
- [elpa] externals/eglot 8e6488f 023/139: Don't switch to possibly dead buffer in sentinel, João Távora, 2018/05/14
- [elpa] externals/eglot e1d36d2 014/139: Fix some byte-compilation warnings, João Távora, 2018/05/14
- [elpa] externals/eglot 6f6f01d 018/139: Doc fixes, João Távora, 2018/05/14
- [elpa] externals/eglot 7ec0dcf 029/139: Events buffer uses eglot-mode, source buffers use eglot-editing-mode, João Távora, 2018/05/14
- [elpa] externals/eglot 22dc2f7 034/139: Ready to start fixing flymake integration, João Távora, 2018/05/14
- [elpa] externals/eglot e8f859e 031/139: Rework commands for connecting and reconnecting, João Távora, 2018/05/14
- [elpa] externals/eglot 92bf3a0 038/139: Signal textDocument/didClose, João Távora, 2018/05/14
- [elpa] externals/eglot b511b7d 036/139: Redesign and simplify parser, João Távora, 2018/05/14
- [elpa] externals/eglot 328c7ae 025/139: Auto update mode-line after setting some process properties,
João Távora <=
- [elpa] externals/eglot 2b61a3b 048/139: Delete two useless forward declarations, João Távora, 2018/05/14
- [elpa] externals/eglot 88e3655 040/139: Appease checkdoc.el, João Távora, 2018/05/14
- [elpa] externals/eglot c948713 035/139: Auto-reconnect on unexpected connection loss, João Távora, 2018/05/14
- [elpa] externals/eglot 1dc2a9f 021/139: Implement spinners and RLS's window/progress, João Távora, 2018/05/14
- [elpa] externals/eglot 931093e 032/139: Don't clutter UI with warnings, João Távora, 2018/05/14
- [elpa] externals/eglot 95983c9 028/139: Change status to error everytime an error is found, João Távora, 2018/05/14
- [elpa] externals/eglot be52e1e 037/139: Rework connection restarting again, João Távora, 2018/05/14
- [elpa] externals/eglot d2eca65 045/139: Fix another Flymake sync bug, João Távora, 2018/05/14
- [elpa] externals/eglot f7f77e1 044/139: Make M-x eglot the main entry point, João Távora, 2018/05/14
- [elpa] externals/eglot d90efdf 001/139: Initial commit, João Távora, 2018/05/14