[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot f89f859 114/139: Simplify mode-line updating logi
From: |
João Távora |
Subject: |
[elpa] externals/eglot f89f859 114/139: Simplify mode-line updating logic |
Date: |
Mon, 14 May 2018 09:55:04 -0400 (EDT) |
branch: externals/eglot
commit f89f859eb71597f4ba7327d8758c2e9c7afb67fe
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Simplify mode-line updating logic
* eglot.el (eglot--define-process-var): Simplify.
(eglot--short-name, eglot--spinner, eglot--status): Don't
auto-update mode-line.
(eglot--process-receive): Update it here.
---
eglot.el | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/eglot.el b/eglot.el
index 1ba5324..bf0b9e9 100644
--- a/eglot.el
+++ b/eglot.el
@@ -78,11 +78,9 @@
(if (project-current) "" " (Also no current project)"))))
(defmacro eglot--define-process-var
- (var-sym initval &optional doc mode-line-update-p)
+ (var-sym initval &optional doc)
"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."
+INITVAL is the default value. DOC is the documentation."
(declare (indent 2))
`(progn
(put ',var-sym 'function-documentation ,doc)
@@ -94,16 +92,11 @@ after setting it."
(let ((def ,initval))
(process-put proc ',var-sym def)
def))))
- (gv-define-setter ,var-sym (to-store &optional process)
- (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)))))))
+ (gv-define-setter ,var-sym (to-store process)
+ `(let ((once ,to-store)) (process-put ,process ',',var-sym once)
once))))
(eglot--define-process-var eglot--short-name nil
- "A short name for the process" t)
+ "A short name for the process")
(eglot--define-process-var eglot--major-mode nil
"The major-mode this server is managing.")
@@ -128,11 +121,11 @@ after setting it."
(eglot--define-process-var eglot--spinner `(nil nil t)
"\"Spinner\" used by some servers.
-A list (ID WHAT DONE-P)." t)
+A list (ID WHAT DONE-P).")
(eglot--define-process-var eglot--status `(:unknown nil)
"Status as declared by the server.
-A list (WHAT SERIOUS-P)." t)
+A list (WHAT SERIOUS-P).")
(eglot--define-process-var eglot--contact nil
"Method used to contact a server.
@@ -531,7 +524,8 @@ is a symbol saying if this is a client or server
originated."
(apply (cl-first continuations) res)
(funcall (cl-first continuations) res)))))
(id
- (eglot--warn "Ooops no continuation for id %s" id)))))
+ (eglot--warn "Ooops no continuation for id %s" id)))
+ (force-mode-line-update t)))
(defvar eglot--expect-carriage-return nil)
- [elpa] externals/eglot 23b79e0 111/139: Shorten summary line to appease package-lint.el, (continued)
- [elpa] externals/eglot 23b79e0 111/139: Shorten summary line to appease package-lint.el, João Távora, 2018/05/14
- [elpa] externals/eglot 37b7329 098/139: Reasonable textDocument/documentHighlight support, João Távora, 2018/05/14
- [elpa] externals/eglot d1cdcf1 119/139: Friendlier M-x eglot, João Távora, 2018/05/14
- [elpa] externals/eglot 764347d 128/139: New command eglot-help-at-point and a README update, João Távora, 2018/05/14
- [elpa] externals/eglot 9bf3166 136/139: Don't define a menu if nothing to show there for now, João Távora, 2018/05/14
- [elpa] externals/eglot 54fc885 113/139: More RLS-specifics: update Flymake diags when indexing done, João Távora, 2018/05/14
- [elpa] externals/eglot 56c2e1d 104/139: Get rid of eglot-mode, João Távora, 2018/05/14
- [elpa] externals/eglot 9577dfc 125/139: Duh, json.el is in Emacs, and json-mode.el is useless here, João Távora, 2018/05/14
- [elpa] externals/eglot d33a9b5 103/139: Simplify eglot--signal-textDocument/didChange, João Távora, 2018/05/14
- [elpa] externals/eglot ef80455 121/139: Support :completionItem/resolve, João Távora, 2018/05/14
- [elpa] externals/eglot f89f859 114/139: Simplify mode-line updating logic,
João Távora <=
- [elpa] externals/eglot 3a6c637 099/139: Support textDocument/rename, João Távora, 2018/05/14
- [elpa] externals/eglot 581608f 115/139: Resist server failure during synchronous requests, João Távora, 2018/05/14
- [elpa] externals/eglot 56cf02d 126/139: Rework autoreconnection logic, João Távora, 2018/05/14
- [elpa] externals/eglot 4c0bfc3 139/139: Support didChangeWatchedFiles with dynamic registration, João Távora, 2018/05/14
- [elpa] externals/eglot 42177d0 107/139: New "deferred requests" that wait until server is ready, João Távora, 2018/05/14
- [elpa] externals/eglot 29f6b4c 129/139: Tweak README.md, João Távora, 2018/05/14
- [elpa] externals/eglot 1fb2bcb 132/139: Ask server for textDocument/signatureHelp if it supports it, João Távora, 2018/05/14
- [elpa] externals/eglot e63dad0 092/139: Simplify mode-line code with a helper., João Távora, 2018/05/14
- [elpa] externals/eglot ab575d2 120/139: Rename functions. eglot--request is now the synchronous one, João Távora, 2018/05/14
- [elpa] externals/eglot 41f5922 137/139: Now send willSaveWaitUntil, João Távora, 2018/05/14