From: Bob Nnamtrop Date: Sat, 9 Jul 2011 19:32:42 +0000 (-0400) Subject: Limit triggering of abbrev expansion in viper-mode (Bug#9038) X-Git-Tag: emacs-pretest-24.0.90~104^2~411^2~11 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c0a7f30097617435ab8520b78cb135e9255d8f51;p=emacs.git 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. --- 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