# HG changeset patch # User Oleksandr Gavenko # Date 1575993928 -7200 # Node ID 09079d2df4af9bb5070cec8dda4fdeccc4b2c32e # Parent 69fb0b318f3c59c5718d6e4eea2796ec2f2605b1 It is better to select hole word (including dashes/underscores, depending on mode). diff -r 69fb0b318f3c -r 09079d2df4af 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))))