Skip to main content
added 67 characters in body
Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

Emacs should already use "the appropriate word boundaries for the syntax of the current language". If it does not then file a bug for the major mode for that language.

But maybe you don't really mean words. Maybe you mean symbol syntax, not word syntax. Emacs distinguishes the two.

For symbol syntax, use symbol commands, not word commands: forward-symbol, transpose-symbol, etc. From your description, this is what you really want. Just use C-M-f and C-M-t instead of M-f and M-t, etc.

If you feel you really want to use a word function on a symbol, you can change the syntax category of particular symbols to have word-constituent syntax instead of symbol-constituent syntax.change the syntax category of particular characters to have word-constituent syntax instead of symbol-constituent syntax. But generally this is not what you want to do and you should not need to do it.

See the Elisp manual for info about character syntax. And see the Emacs manual and the Elisp manual for commands and other functions that operate on symbols (not Lisp symbols, but text with symbol syntax, in whatever language).

And keep in mind that operations on sexps are often useful also for acting on symbols: C-M-f (forward-sexp), C-M-t (transpose-sexps), etc.

Emacs should already use "the appropriate word boundaries for the syntax of the current language". If it does not then file a bug for the major mode for that language.

But maybe you don't really mean words. Maybe you mean symbol syntax, not word syntax. Emacs distinguishes the two.

For symbol syntax, use symbol commands, not word commands: forward-symbol, transpose-symbol, etc. From your description, this is what you really want. Just use C-M-f and C-M-t instead of M-f and M-t, etc.

If you feel you really want to use a word function on a symbol, you can change the syntax category of particular symbols to have word-constituent syntax instead of symbol-constituent syntax. But generally this is not what you want to do and you should not need to do it.

See the Elisp manual for info about character syntax. And see the Emacs manual and the Elisp manual for commands and other functions that operate on symbols (not Lisp symbols, but text with symbol syntax, in whatever language).

Emacs should already use "the appropriate word boundaries for the syntax of the current language". If it does not then file a bug for the major mode for that language.

But maybe you don't really mean words. Maybe you mean symbol syntax, not word syntax. Emacs distinguishes the two.

For symbol syntax, use symbol commands, not word commands: forward-symbol, etc. From your description, this is what you really want.

If you feel you really want to use a word function on a symbol, you can change the syntax category of particular characters to have word-constituent syntax instead of symbol-constituent syntax. But generally this is not what you want to do and you should not need to do it.

See the Elisp manual for info about character syntax. And see the Emacs manual and the Elisp manual for commands and other functions that operate on symbols (not Lisp symbols, but text with symbol syntax, in whatever language).

And keep in mind that operations on sexps are often useful also for acting on symbols: C-M-f (forward-sexp), C-M-t (transpose-sexps), etc.

Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

Emacs should already use "the appropriate word boundaries for the syntax of the current language". If it does not then file a bug for the major mode for that language.

But maybe you don't really mean words. Maybe you mean symbol syntax, not word syntax. Emacs distinguishes the two.

For symbol syntax, use symbol commands, not word commands: forward-symbol, transpose-symbol, etc. From your description, this is what you really want. Just use C-M-f and C-M-t instead of M-f and M-t, etc.

If you feel you really want to use a word function on a symbol, you can change the syntax category of particular symbols to have word-constituent syntax instead of symbol-constituent syntax. But generally this is not what you want to do and you should not need to do it.

See the Elisp manual for info about character syntax. And see the Emacs manual and the Elisp manual for commands and other functions that operate on symbols (not Lisp symbols, but text with symbol syntax, in whatever language).