X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/db4613576d3115aa320f0293d081ce98baa06acd..455700d69a1a6861dc8c9b2ba19733429727d3c3:/lisp/dabbrev.el diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index 50c52071b0..d9f36b1529 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -1,6 +1,6 @@ ;;; dabbrev.el --- dynamic abbreviation package -*- lexical-binding: t -*- -;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2015 Free +;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2016 Free ;; Software Foundation, Inc. ;; Author: Don Morrison @@ -120,7 +120,7 @@ Example: Set this to \"\\\\$\" for programming languages in which variable names may appear with or without a leading `$'. -\(For example, in Makefiles.\) +\(For example, in Makefiles.) Set this to nil if no characters should be skipped." :type '(choice regexp @@ -534,7 +534,7 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]." (if (not (or (eq dabbrev--last-buffer dabbrev--last-buffer-found) (minibuffer-window-active-p (selected-window)))) (progn - (message "Expansion found in '%s'" + (message "Expansion found in `%s'" (buffer-name dabbrev--last-buffer)) (setq dabbrev--last-buffer-found dabbrev--last-buffer)) (message nil)) @@ -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) ;;;----------------------------------------------------------------