From c0a7f30097617435ab8520b78cb135e9255d8f51 Mon Sep 17 00:00:00 2001 From: Bob Nnamtrop Date: Sat, 9 Jul 2011 15:32:42 -0400 Subject: [PATCH] Limit triggering of abbrev expansion in viper-mode (Bug#9038) * lisp/emulation/viper-cmd.el (viper-change-state-to-vi): Limit triggering of abbrev expansion. --- lisp/ChangeLog | 5 +++++ lisp/emulation/viper-cmd.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 95fae9252d1..6cdc0d38810 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-07-09 Bob Nnamtrop (tiny change) + + * emulation/viper-cmd.el (viper-change-state-to-vi): Limit + triggering of abbrev expansion (Bug#9038). + 2011-07-09 Martin Rudalics * window.el (display-buffer-default-specifiers): Remove. diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index f06428d81eb..9d0eb6c0d14 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -617,7 +617,10 @@ (or (viper-overlay-p viper-replace-overlay) (viper-set-replace-overlay (point-min) (point-min))) (viper-hide-replace-overlay) - (if abbrev-mode (expand-abbrev)) + ;; Expand abbrevs iff the previous character has word syntax. + (and abbrev-mode + (eq (char-syntax (preceding-char)) ?w) + (expand-abbrev)) (if (and auto-fill-function (> (current-column) fill-column)) (funcall auto-fill-function)) ;; don't leave whitespace lines around