aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/abbrev.el18
2 files changed, 16 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d02dbadd9ca..3049fbea5f0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12009-11-25 Stefan Monnier <monnier@iro.umontreal.ca> 12009-11-25 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * abbrev.el (abbrev--before-point): Use word-motion functions
4 if :regexp is not specified (bug#5031).
5
3 * subr.el (string-prefix-p): New function. 6 * subr.el (string-prefix-p): New function.
4 7
5 * man.el (Man-completion-cache): New var. 8 * man.el (Man-completion-cache): New var.
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 88c87dafa77..91c510694b0 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -671,11 +671,19 @@ then ABBREV is looked up in that table only."
671 (setq tables (append (abbrev-table-get table :parents) tables)) 671 (setq tables (append (abbrev-table-get table :parents) tables))
672 (setq res 672 (setq res
673 (and (or (not enable-fun) (funcall enable-fun)) 673 (and (or (not enable-fun) (funcall enable-fun))
674 (looking-back (or (abbrev-table-get table :regexp) 674 (let ((re (abbrev-table-get table :regexp)))
675 "\\<\\(\\w+\\)\\W*") 675 (if (null re)
676 (line-beginning-position)) 676 ;; We used to default `re' to "\\<\\(\\w+\\)\\W*"
677 (setq start (match-beginning 1)) 677 ;; but when words-include-escapes is set, that
678 (setq end (match-end 1)) 678 ;; is not right and fixing it is boring.
679 (let ((lim (point)))
680 (backward-word 1)
681 (setq start (point))
682 (forward-word 1)
683 (setq end (min (point) lim)))
684 (when (looking-back re (line-beginning-position))
685 (setq start (match-beginning 1))
686 (setq end (match-end 1)))))
679 (setq name (buffer-substring start end)) 687 (setq name (buffer-substring start end))
680 (let ((abbrev (abbrev-symbol name table))) 688 (let ((abbrev (abbrev-symbol name table)))
681 (when abbrev 689 (when abbrev