It is better to select hole word (including dashes/underscores, depending on mode).
authorOleksandr Gavenko <gavenkoa@gmail.com>
Tue, 10 Dec 2019 18:05:28 +0200
changeset 1598 09079d2df4af
parent 1597 69fb0b318f3c
child 1599 665bd30beaae
It is better to select hole word (including dashes/underscores, depending on mode).
autobm.el
--- a/autobm.el	Tue Dec 10 18:04:16 2019 +0200
+++ b/autobm.el	Tue Dec 10 18:05:28 2019 +0200
@@ -8,7 +8,7 @@
 (defvar autobm-mode-handlers
   '((emacs-lisp-mode . (autobm-try-semantic))
     (semantic-decoration-mode . (autobm-try-semantic))
-    (rst-mode . (autobm-try-thingatpt))
+    (rst-mode . (autobm-try-word))
     (t . (autobm-try-which-func autobm-try-thingatpt)))
   "Alist of handlers by mode. Key is a mojor or minor mode name, or `t' as fallback.
 Value is a no-argument function or a list of such functions,
@@ -23,6 +23,9 @@
 (defun autobm-try-thingatpt ()
   (cl-some #'thing-at-point autobm-try-thingatpt-things))
 
+(defun autobm-try-word ()
+  (thing-at-point 'word))
+
 (defun autobm-try-line ()
   (let ( (line (thing-at-point 'line)) )
     (substring line 0 (min (1- (length line)) 30))))