I'm unsure of how to properly describe this question, but here goes:
In emacs with I double-click to select a word, something determines which characters to select -- what is this called? (In Terminal profile preference, this is called select-by-word characters, so I'll use that phrase.)
Without web-mode, for example, if I double click the word title
in image_title
, it highlights only title
-- that is, the underscore is recognized as a select-by-word delimiter.
Once I enabled web-mode, the behavior of select-by-word changes, and underscore is no longer a word delimiter. In the previous example, double-clicking now highlights the entire image_title
. This irritates me, as I commonly want to select portions of an underscore-delimited-identifier. (In general, I'd prefer any mode not to change the default selection behavior.)
What is the option to change this behavior of web-mode?
Edit to add: in my preferred mode, if I double-click on the _
character, it does select the entire word including underscores. I like this subtle but precise control of the selection behavior.
@lawlist - thanks for your suggestions! I wasn't able to follow the functions through entirely, but it did lead me along the correct path:
double-mouse-1
, searched googlesyntax-table
, you mentionsyntax-table
, and what do we have here web-mode.el contains asyntax-table
(and a reference to bug #377.)web-mode's syntax table contains, roughly line 1969 in v 11.2.2:
I assume the
?_ "w"
means it's treating_
as a word character. I changed the"w"
to"."
and underscore is now being treated as a word boundary like I wanted!Hooray for stack overflow, google, and github.
Also, now that I've got some correct keywords, Stack Overflow suggests this potentially helpful related answer: Changing Emacs Forward-Word Behaviour