summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2023-02-01 06:30:39 +0100
committerStefan Kangas <stefankangas@gmail.com>2023-02-01 06:30:39 +0100
commitcfde8a1490072f43297af8f85b50f3b18db892ef (patch)
treefeb63038f0d204b1a86c698ba62b8442e17ed47d
parentf724fca732a61536c684d07f21ef34c0f7ca335e (diff)
parent66aa9cb450ae3f313e836eed27de553df736e0f3 (diff)
downloademacs-cfde8a1490072f43297af8f85b50f3b18db892ef.tar.gz
Merge from origin/emacs-29
66aa9cb450a ; (Ftreesit_query_capture): Fix typo f711f4e99f7 (Ftreesit_query_capture): Cache list of predicates for gi... 47ab9ba55d7 * lisp/keymap.el (keymap-global-unset): Correct prompt 49b61405582 Fix cursor-in-echo-area on TTY frames
-rw-r--r--lisp/keymap.el2
-rw-r--r--src/dispnew.c4
-rw-r--r--src/treesit.c12
3 files changed, 14 insertions, 4 deletions
diff --git a/lisp/keymap.el b/lisp/keymap.el
index caabedd5aec..de90b03ba64 100644
--- a/lisp/keymap.el
+++ b/lisp/keymap.el
@@ -107,7 +107,7 @@ If REMOVE (interactively, the prefix arg), remove the binding
instead of unsetting it. See `keymap-unset' for details."
(declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))
(interactive
- (list (key-description (read-key-sequence "Set key locally: "))
+ (list (key-description (read-key-sequence "Unset key globally: "))
current-prefix-arg))
(keymap-unset (current-global-map) key remove))
diff --git a/src/dispnew.c b/src/dispnew.c
index 8fde522f77d..43306043a0c 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5009,6 +5009,10 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p,
}
while (row > top && col == 0);
+ /* We exit the loop with COL at the glyph _after_ the last one. */
+ if (col > 0)
+ col--;
+
/* Make sure COL is not out of range. */
if (col >= FRAME_CURSOR_X_LIMIT (f))
{
diff --git a/src/treesit.c b/src/treesit.c
index b210ec0923a..b163685419f 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -2720,8 +2720,10 @@ the query. */)
every for loop and nconc it to RESULT every time. That is indeed
the initial implementation in which Yoav found nconc being the
bottleneck (98.4% of the running time spent on nconc). */
+ uint32_t patterns_count = ts_query_pattern_count (treesit_query);
Lisp_Object result = Qnil;
Lisp_Object prev_result = result;
+ Lisp_Object predicates_table = make_vector (patterns_count, Qt);
while (ts_query_cursor_next_match (cursor, &match))
{
/* Record the checkpoint that we may roll back to. */
@@ -2750,9 +2752,13 @@ the query. */)
result = Fcons (cap, result);
}
/* Get predicates. */
- Lisp_Object predicates
- = treesit_predicates_for_pattern (treesit_query,
- match.pattern_index);
+ Lisp_Object predicates = AREF (predicates_table, match.pattern_index);
+ if (EQ (predicates, Qt))
+ {
+ predicates = treesit_predicates_for_pattern (treesit_query,
+ match.pattern_index);
+ ASET (predicates_table, match.pattern_index, predicates);
+ }
/* captures_lisp = Fnreverse (captures_lisp); */
struct capture_range captures_range = { result, prev_result };