[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 8d00f8b 32/49: Per #602: speed up glob matching 2
From: |
Stefan Monnier |
Subject: |
[elpa] externals/eglot 8d00f8b 32/49: Per #602: speed up glob matching 2x |
Date: |
Wed, 17 Mar 2021 18:41:48 -0400 (EDT) |
branch: externals/eglot
commit 8d00f8b639cb15687440cb0c301bd700727e02d6
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Per #602: speed up glob matching 2x
with-temp-buffer was taking a lot of time, presumably because it kills
the buffer. Since emacs is single-threaded, we can safely reuse a
single buffer.
* eglot.el (eglot--glob-parse): Simplify grammar.
(eglot--glob-compile): Don't with-temp-buffer.
---
eglot.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/eglot.el b/eglot.el
index 44648ae..50fb695 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2672,10 +2672,9 @@ at point. With prefix argument, prompt for ACTION-KIND."
with grammar = '((:** "\\*\\*/?" eglot--glob-emit-**)
(:* "\\*" eglot--glob-emit-*)
(:? "\\?" eglot--glob-emit-?)
- (:/ "/" eglot--glob-emit-self)
(:{} "{[^][/*{}]+}" eglot--glob-emit-{})
(:range "\\[\\^?[^][/,*{}]+\\]" eglot--glob-emit-range)
- (:literal "[^][/,*?{}]+" eglot--glob-emit-self))
+ (:literal "[^][,*?{}]+" eglot--glob-emit-self))
until (eobp)
collect (cl-loop
for (_token regexp emitter) in grammar
@@ -2687,7 +2686,8 @@ at point. With prefix argument, prompt for ACTION-KIND."
"Convert GLOB into Elisp function. Maybe BYTE-COMPILE it.
If NOERROR, return predicate, else erroring function."
(let* ((states (eglot--glob-parse glob))
- (body `(with-temp-buffer
+ (body `(with-current-buffer (get-buffer-create "
*eglot-glob-matcher*")
+ (erase-buffer)
(save-excursion (insert string))
(cl-labels ,(cl-loop for (this that) on states
for (self emit text) = this
- [elpa] externals/eglot f9df418 06/49: Fix #584: Define a face for symbol highlight, (continued)
- [elpa] externals/eglot f9df418 06/49: Fix #584: Define a face for symbol highlight, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot cb58b72 15/49: Close #603: add fortls for Fotran (f90-mode), Stefan Monnier, 2021/03/17
- [elpa] externals/eglot 147f3b0 16/49: Close #411: offer shortcut commands to commonly invoked code actions, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot 99f8d7b 17/49: Per #604: mention common installation pitfalls in README.md, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot 2879b83 19/49: * README.md: Mention Google Open Source Peer Bonus, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot d5b840b 20/49: Fix #606, #Fix 608: fix bug in eglot-code-actions, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot eac5264 21/49: Fix #609: flush pending changes to server before code actions request, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot f68f829 26/49: Close #566: prefer typescript-language-server for JS&TS, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot c73f5ed 27/49: Fix #612: remove duplicate entry for "Registration" LSP type, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot 4ae5a44 28/49: Fix #568: update gopls URL in README.md, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot 8d00f8b 32/49: Per #602: speed up glob matching 2x,
Stefan Monnier <=
- [elpa] externals/eglot e57be55 36/49: Fix #502: silence messages while formatting markup, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot 398b81e 35/49: Per #602: simplify dir-watching strategy of w/didChangeWatchedFiles, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot a2d1fc9 37/49: Fix #625: handle null reply for textDocument/definition, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot 92b0c5d 41/49: Fix #610: protect against empty URIs on windows, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot ee980cf 39/49: Fixup last commit to fix #627, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot 47f8581 47/49: Per #605: indicate support for activeParameter, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot f0c770c 48/49: Fix #555: autoload eglot-workspace-configuration's safe-l-v spec, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot f63abe8 30/49: Fix #418: support phps-mode, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot d784d60 42/49: Fix #635: Correctly protect against zero-length completion items, Stefan Monnier, 2021/03/17
- [elpa] externals/eglot 39473f7 45/49: Fix #626: remove highlight overlays immediately when symbol edited, Stefan Monnier, 2021/03/17