]> code.delx.au - gnu-emacs/commitdiff
Use the correct dabbrev expansion
authorAlan Third <alan@idiocy.org>
Wed, 2 Mar 2016 17:20:47 +0000 (17:20 +0000)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 2 Mar 2016 17:21:38 +0000 (17:21 +0000)
lisp/dabbrev.el (dabbrev--substitute-expansion): Return EXPANSION after
any processing.
lisp/dabbrev.el (dabbrev-expand): Set EXPANSION to the return value of
DABBREV--SUBSTITUTE-EXPANSION.
test/automated/dabbrev-tests.el (dabbrev-expand-test): Test for bug#1948.

lisp/dabbrev.el

index 3557041f51c76ad2bc9994ab6a8cd8c889c49e8b..d9f36b152905cf971da126a1d7c6d5969eb17cc1 100644 (file)
@@ -546,8 +546,8 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]."
                (copy-marker dabbrev--last-expansion-location)))
       ;; Success: stick it in and return.
       (setq buffer-undo-list (cons orig-point buffer-undo-list))
-      (dabbrev--substitute-expansion old abbrev expansion
-                                    record-case-pattern)
+      (setq expansion (dabbrev--substitute-expansion old abbrev expansion
+                                                     record-case-pattern))
 
       ;; Save state for re-expand.
       (setq dabbrev--last-expansion expansion)
@@ -902,7 +902,9 @@ to record whether we upcased the expansion, downcased it, or did neither."
     ;; and (2) the replacement itself is all lower case.
     (dabbrev--safe-replace-match expansion
                                 (not use-case-replace)
-                                t)))
+                                t))
+  ;; Return the expansion actually used.
+  expansion)
 
 
 ;;;----------------------------------------------------------------