From 73f2dd2fce8069c4ac4f6ae2a8afdda40450a7e4 Mon Sep 17 00:00:00 2001 From: 45mg <45mm.cartridge421@slmail.me> Date: Fri, 6 Dec 2024 09:22:10 +0000 Subject: [PATCH] fix(meow-next-thing): allow no include-syntax (#689) With the addition of `meow-next-thing-include-syntax` (13733e1), `meow--fix-thing-selection-mark` expects to find an entry in this alist corresponding to `thing`. This means that when the user defines their own `thing` and sets `meow-word-thing` or `meow-symbol-thing` to use it, they also need to add a corresponding entry to this alist. I'll admit that I don't understand why the `include-syntax` option needed to be introduced in `meow--fix-thing-selection-mark` (c0878ac). However, my own definitions of `meow-word-thing` and `meow-symbol-thing` worked fine without it. Based on that, my logic in this commit is that users shouldn't have to add to `meow-next-thing-include-syntax` unless they explicitly need the `skip-syntax-*` shrinking that was added to `meow--fix-thing-selection-mark`. Co-authored-by: 45mg <45mg@no.mail> --- meow-command.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meow-command.el b/meow-command.el index 816eb97..e6d3539 100644 --- a/meow-command.el +++ b/meow-command.el @@ -887,7 +887,9 @@ If N is negative, select to the beginning of the previous Nth thing instead." (meow--cancel-selection)) (unless include-syntax (setq include-syntax - (let ((thing-include-syntax (alist-get thing meow-next-thing-include-syntax))) + (let ((thing-include-syntax + (or (alist-get thing meow-next-thing-include-syntax) + '("" "")))) (if (> n 0) (car thing-include-syntax) (cadr thing-include-syntax)))))