516 |
;; The "abbrev" to expand is just the space. |
;; The "abbrev" to expand is just the space. |
517 |
(setq abbrev " ") |
(setq abbrev " ") |
518 |
(save-excursion |
(save-excursion |
519 |
(if dabbrev--last-buffer |
(save-restriction |
520 |
(set-buffer dabbrev--last-buffer)) |
(widen) |
521 |
;; Find the end of the last "expansion" word. |
(if dabbrev--last-buffer |
522 |
(if (or (eq dabbrev--last-direction 1) |
(set-buffer dabbrev--last-buffer)) |
523 |
(and (eq dabbrev--last-direction 0) |
;; Find the end of the last "expansion" word. |
524 |
(< dabbrev--last-expansion-location (point)))) |
(if (or (eq dabbrev--last-direction 1) |
525 |
(setq dabbrev--last-expansion-location |
(and (eq dabbrev--last-direction 0) |
526 |
(+ dabbrev--last-expansion-location |
(< dabbrev--last-expansion-location (point)))) |
527 |
(length dabbrev--last-expansion)))) |
(setq dabbrev--last-expansion-location |
528 |
(goto-char dabbrev--last-expansion-location) |
(+ dabbrev--last-expansion-location |
529 |
;; Take the following word, with intermediate separators, |
(length dabbrev--last-expansion)))) |
530 |
;; as our expansion this time. |
(goto-char dabbrev--last-expansion-location) |
531 |
(re-search-forward |
;; Take the following word, with intermediate separators, |
532 |
(concat "\\(?:" dabbrev--abbrev-char-regexp "\\)+")) |
;; as our expansion this time. |
533 |
(setq expansion (buffer-substring-no-properties |
(re-search-forward |
534 |
dabbrev--last-expansion-location (point))) |
(concat "\\(?:" dabbrev--abbrev-char-regexp "\\)+")) |
535 |
|
(setq expansion (buffer-substring-no-properties |
536 |
|
dabbrev--last-expansion-location (point))) |
537 |
|
|
538 |
;; Record the end of this expansion, in case we repeat this. |
;; Record the end of this expansion, in case we repeat this. |
539 |
(setq dabbrev--last-expansion-location (point))) |
(setq dabbrev--last-expansion-location (point)))) |
540 |
;; Indicate that dabbrev--last-expansion-location is |
;; Indicate that dabbrev--last-expansion-location is |
541 |
;; at the end of the expansion. |
;; at the end of the expansion. |
542 |
(setq dabbrev--last-direction -1)) |
(setq dabbrev--last-direction -1)) |