+ ;; If the user inserts a space after expanding
+ ;; and then asks to expand again, always fetch the next word.
+ (if (and (eq (preceding-char) ?\ )
+ (markerp dabbrev--last-abbrev-location)
+ (marker-position dabbrev--last-abbrev-location)
+ (= (point) (1+ dabbrev--last-abbrev-location)))
+ (progn
+ ;; The "abbrev" to expand is just the space.
+ (setq abbrev " ")
+ (save-excursion
+ (if dabbrev--last-buffer
+ (set-buffer dabbrev--last-buffer))
+ ;; Find the end of the last "expansion" word.
+ (if (or (eq dabbrev--last-direction 1)
+ (and (eq dabbrev--last-direction 0)
+ (< dabbrev--last-expansion-location (point))))
+ (setq dabbrev--last-expansion-location
+ (+ dabbrev--last-expansion-location
+ (length dabbrev--last-expansion))))
+ (goto-char dabbrev--last-expansion-location)
+ ;; Take the following word, with intermediate separators,
+ ;; as our expansion this time.
+ (re-search-forward
+ (concat "\\(\\(" dabbrev--abbrev-char-regexp "\\)+\\)"))
+ (setq expansion (buffer-substring-no-properties
+ dabbrev--last-expansion-location (point)))
+ (if dabbrev--last-case-pattern
+ (setq expansion (upcase expansion)))
+
+ ;; Record the end of this expansion, in case we repeat this.
+ (setq dabbrev--last-expansion-location (point)))
+ ;; Indicate that dabbrev--last-expansion-location is
+ ;; at the end of the expansion.
+ (setq dabbrev--last-direction -1))
+
+ ;; We have a different abbrev to expand.
+ (dabbrev--reset-global-variables)
+ (setq direction (if (null arg)
+ (if dabbrev-backward-only 1 0)
+ (prefix-numeric-value arg)))
+ (setq abbrev (dabbrev--abbrev-at-point))
+ (setq record-case-pattern t)
+ (setq old nil)))