On Fri, 22 Mar 2013 10:18:37 -0400 Stefan Monnier wrote: >> OK, but I can't think of any cases in CFEngine specifically where I >> don't want to skip over _ with M-f. It's always part of a word. >> The language itself is designed that way and has a pretty rigid syntax. SM> CFengine has no notion of words, it has a notion of identifiers, which SM> in Emacs are called symbols and can be skipped with C-M-f or SM> forward-symbol. >> Or are you saying users don't expect _ to be part of a >> word and it's unconventional to make it so? SM> Exactly. Many users actually like _ to be part of a word, but these are SM> user-preferences (and we should indeed define a words-are-symbols-mode SM> for those users since what they really want is for M-f, M-t, M-DEL to SM> move by symbols rather than by words). Yes! In particular, context expressions in CFEngine are things like "a_b_c.d_e" and it's a pain to skip over them with the usual `M-f' or CUA keybindings. It would be nice to be able to set this as a preference for all modes derived from `prog-mode', IIUC what you mean. SM> Basically, the definition of a word is something that major modes should SM> not touch, because it is a notion from human language, and not from the SM> programming language in use in a particular buffer. SM> The major mode should define the syntax of symbols (aka SM> "identifiers") instead. OK, I think I understand. You're saying "words" are not part of the syntax for a programming language, generally, and are more of a text-mode concept. Symbols usually are what I want if I'm parsing a programming language. I modified cfengine.el to use \_< and \_> for all the regular expressions; can you take a look at the attached patch and see if it's closer to the expected behavior? Thanks Ted