Skip to content

Commit f3bd844

Browse files
author
Roy Crihfield
committed
rust-mode.el: Tweak syntax table
"_" should keep the default syntax class (symbol, not word). This allows, e.g., `forward-word' to behave in the familiar way, jumping to underscores within a function or variable name.
1 parent 0b7b4f0 commit f3bd844

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/etc/emacs/rust-mode.el

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
(modify-syntax-entry ?\" "\"" table)
3232
(modify-syntax-entry ?\\ "\\" table)
3333

34-
;; _ is a word-char
35-
(modify-syntax-entry ?_ "w" table)
36-
3734
;; Comments
3835
(modify-syntax-entry ?/ ". 124b" table)
3936
(modify-syntax-entry ?* ". 23" table)
@@ -397,7 +394,7 @@ This is written mainly to be used as `beginning-of-defun-function' for Rust.
397394
Don't move to the beginning of the line. `beginning-of-defun',
398395
which calls this, does that afterwards."
399396
(interactive "p")
400-
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\b")
397+
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\_>")
401398
nil 'move (or arg 1)))
402399

403400
(defun rust-end-of-defun ()

0 commit comments

Comments
 (0)