Don't call expand-abbrev unless preceding character is a word char.
(defun insert-tab (&optional prefix-arg)
(let ((count (prefix-numeric-value prefix-arg)))
- (if abbrev-mode
+ (if (and abbrev-mode
+ (eq (char-syntax (preceding-char)) ?w))
(expand-abbrev))
(if indent-tabs-mode
(insert-char ?\t count)
If the previous nonblank line has no indent points beyond the
column point starts at, `tab-to-tab-stop' is done instead."
(interactive "P")
- (if abbrev-mode (expand-abbrev))
+ (if (and abbrev-mode
+ (eq (char-syntax (preceding-char)) ?w))
+ (expand-abbrev))
(let ((start-column (current-column))
indent)
(save-excursion