dabbrev.elc 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. (provide (quote dabbrevs))
  2. (defvar dabbrevs-limit nil "\
  3. *Limits region searched by dabbrevs-expand to that many chars away (local).")
  4. (make-variable-buffer-local (quote dabbrevs-limit))
  5. (defvar dabbrevs-backward-only nil "\
  6. *If non-NIL, dabbrevs-expand only looks backwards.")
  7. (defvar last-dabbrevs-table nil "\
  8. Table of expansions seen so far. (local)")
  9. (make-variable-buffer-local (quote last-dabbrevs-table))
  10. (defvar last-dabbrevs-abbreviation "" "\
  11. Last string we tried to expand. Buffer-local.")
  12. (make-variable-buffer-local (quote last-dabbrevs-abbreviation))
  13. (defvar last-dabbrevs-direction 0 "\
  14. Direction of last dabbrevs search. (local)")
  15. (make-variable-buffer-local (quote last-dabbrevs-direction))
  16. (defvar last-dabbrevs-abbrev-location nil "\
  17. Location last abbreviation began (local).")
  18. (make-variable-buffer-local (quote last-dabbrevs-abbrev-location))
  19. (defvar last-dabbrevs-expansion nil "\
  20. Last expansion of an abbreviation. (local)")
  21. (make-variable-buffer-local (quote last-dabbrevs-expansion))
  22. (defvar last-dabbrevs-expansion-location nil "\
  23. Location the last expansion was found. (local)")
  24. (make-variable-buffer-local (quote last-dabbrevs-expansion-location))
  25. (defun dabbrev-expand (arg) "\
  26. Expand previous word \"dynamically\".
  27. Expands to the most recent, preceding word for which this is a prefix.
  28. If no suitable preceding word is found, words following point are considered.
  29. A positive prefix argument, N, says to take the Nth backward DISTINCT
  30. possibility. A negative argument says search forward. The variable
  31. dabbrev-backward-only may be used to limit the direction of search to
  32. backward if set non-nil.
  33. If the cursor has not moved from the end of the previous expansion and
  34. no argument is given, replace the previously-made expansion
  35. with the next possible expansion not yet tried." (interactive "*P") (byte-code "ЈÔÕ!ˆÐÐÐÐÐÐЊ?…& =…&
  36. ƒ: ‰ˆ ‰ˆ ‰‚u?ƒMƒIÖ‚JׂQØ!‰ˆ`‰ˆÙÚ!ˆ`‰
  37. ˆÛ` \"‰ˆ‰ˆÐ‰ˆÐ‰ˆÜÝ!ÞQ‰ˆ ×Y…ÊÖ ]‰ˆ…”bˆ ×V…¢ßÒ\"‰…ºà ‰ˆ B‰ˆ S‰ˆ‚•ˆ †ÃЉˆÖ ^‰ ˆ ×X…Ó ?…Ö []‰ˆ…åbˆ ×V…óßÐ\"‰… à ‰ˆ B‰ˆ S‰ˆ‚æˆÚ‰ )ˆÔá!ˆ ?ƒHâ
  38. \"Љ
  39. ˆ?…6ã ˆä
  40. G!ˆcˆåƒAæ‚Bç\")‚aã ˆä
  41. G!ˆ cˆ‰ ˆ ‰ ˆ ‰.‡" [abbrev expansion old which loc n pattern 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 message "Searching for dynamic expansion..." 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."] 18))
  42. (defun dabbrevs-search (pattern reverse) (byte-code "ÅÅŒ
  43. …Ê `Ë
  44. ƒÌ‚Í\"\\\"ˆÅ‰ˆÅ‰ˆ ?…*?… ƒ:ÎÅÇ#‚@ÏÅÇ#?‰ˆ?…{ÐÑÒ!ÓÒ!\"‰ˆ …dÔ@ \"?…qA‰ˆ‚Xˆ…zʼn)ˆ‚#ˆ )*‡" [missing result dabbrevs-limit last-dabbrevs-abbrev-location reverse nil pattern t test last-dabbrev-table narrow-to-region * -1 1 re-search-backward re-search-forward buffer-substring match-beginning 0 match-end string=] 12))