(provide (quote dabbrevs)) (defvar dabbrevs-limit nil "\ *Limits region searched by dabbrevs-expand to that many chars away (local).") (make-variable-buffer-local (quote dabbrevs-limit)) (defvar dabbrevs-backward-only nil "\ *If non-NIL, dabbrevs-expand only looks backwards.") (defvar last-dabbrevs-table nil "\ Table of expansions seen so far. (local)") (make-variable-buffer-local (quote last-dabbrevs-table)) (defvar last-dabbrevs-abbreviation "" "\ Last string we tried to expand. Buffer-local.") (make-variable-buffer-local (quote last-dabbrevs-abbreviation)) (defvar last-dabbrevs-direction 0 "\ Direction of last dabbrevs search. (local)") (make-variable-buffer-local (quote last-dabbrevs-direction)) (defvar last-dabbrevs-abbrev-location nil "\ Location last abbreviation began (local).") (make-variable-buffer-local (quote last-dabbrevs-abbrev-location)) (defvar last-dabbrevs-expansion nil "\ Last expansion of an abbreviation. (local)") (make-variable-buffer-local (quote last-dabbrevs-expansion)) (defvar last-dabbrevs-expansion-location nil "\ Location the last expansion was found. (local)") (make-variable-buffer-local (quote last-dabbrevs-expansion-location)) (defun dabbrev-expand (arg) "\ Expand previous word \"dynamically\". Expands to the most recent, preceding word for which this is a prefix. If no suitable preceding word is found, words following point are considered. A positive prefix argument, N, says to take the Nth backward DISTINCT possibility. A negative argument says search forward. The variable dabbrev-backward-only may be used to limit the direction of search to backward if set non-nil. If the cursor has not moved from the end of the previous expansion and no argument is given, replace the previously-made expansion with the next possible expansion not yet tried." (interactive "*P") (byte-code "?OOOOOOO. ?.+ ?fR !%^`%^UU!^`% \"? G!^c^afF?c\"),*a ^e !^.ea *OOe *OO!\"SeOe#)^i!^efe !,E ?e#)^%^ %^ %.+" [abbrev expansion old which loc n pattern do-case case-fold-search case-replace arg last-command this-command last-dabbrevs-abbrev-location last-dabbrevs-abbreviation last-dabbrevs-expansion last-dabbrevs-direction dabbrevs-backward-only last-dabbrevs-expansion-location nil last-dabbrev-table t first 1 0 prefix-numeric-value forward-word -1 buffer-substring "\\b" regexp-quote "\\(\\sw\\|\\s_\\)+" dabbrevs-search point-marker string= undo-boundary delete-backward-char error "No dynamic expansion for \"%s\" found." "No further dynamic expansions for \"%s\" found." search-backward downcase replace-match literal search-forward] 23)) (defun dabbrevs-search (pattern reverse do-case) (byte-code "AA? . f fo .