From f3bd844d2aed3465f8e90417b53482ec70a83521 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Sun, 16 Nov 2014 21:42:57 -0600 Subject: [PATCH] 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. --- src/etc/emacs/rust-mode.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/etc/emacs/rust-mode.el b/src/etc/emacs/rust-mode.el index df14af4c887..0d0e4b35a0b 100644 --- a/src/etc/emacs/rust-mode.el +++ b/src/etc/emacs/rust-mode.el @@ -31,9 +31,6 @@ (modify-syntax-entry ?\" "\"" table) (modify-syntax-entry ?\\ "\\" table) - ;; _ is a word-char - (modify-syntax-entry ?_ "w" table) - ;; Comments (modify-syntax-entry ?/ ". 124b" table) (modify-syntax-entry ?* ". 23" table) @@ -397,7 +394,7 @@ This is written mainly to be used as `beginning-of-defun-function' for Rust. Don't move to the beginning of the line. `beginning-of-defun', which calls this, does that afterwards." (interactive "p") - (re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\b") + (re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\_>") nil 'move (or arg 1))) (defun rust-end-of-defun ()