I want to force whitespace-mode highlight line after 99 character in rust-mode (cuz this length recommended by guidelines). For other modes i want to leave this variable with default value(80). How can i do this?
As erikstokes correctly points out, the variable that controls this behaviour is
whitespace-line-column. If you unconditionally set this variable in your
user-init-file, however, it will affect all modes.
The standard mechanism that Emacs provides for mode-specific customisations is hooks. So, to modify the variable in question for
rust-mode only, you can write something like the following:
(add-hook 'rust-mode-hook (lambda () (setq-local whitespace-line-column 99)))
or, in Emacs versions prior to 24.3:
(add-hook 'rust-mode-hook (lambda () (set (make-local-variable 'whitespace-line-column) 99)))
Rather than whitespace-mode, try
column-enforce-mode which can be installed from Emacs MELPA. See https://github.com/jordonbiondo/column-enforce-mode for more details.