]> git.eshelyaron.com Git - emacs.git/commitdiff
(choose-completion-string): Set buffer before running
authorKim F. Storm <storm@cua.dk>
Sun, 12 Sep 2004 18:52:03 +0000 (18:52 +0000)
committerKim F. Storm <storm@cua.dk>
Sun, 12 Sep 2004 18:52:03 +0000 (18:52 +0000)
choose-completion-string-functions hook so it can be buffer-local.

lisp/simple.el

index 75d2cef8499e5430c369d1fa04fdaf7eef9a54db..e7498d67789f91c0851956b729414e0bef345aaf 100644 (file)
@@ -4297,11 +4297,12 @@ to decide what to delete."
                 (not (equal buffer
                             (window-buffer (active-minibuffer-window))))))
        (error "Minibuffer is not active for completion")
+      ;; Set buffer so buffer-local choose-completion-string-functions works.
+      (set-buffer buffer)
       (unless (run-hook-with-args-until-success
               'choose-completion-string-functions
               choice buffer mini-p base-size)
        ;; Insert the completion into the buffer where it was requested.
-       (set-buffer buffer)
        (if base-size
            (delete-region (+ base-size (if mini-p
                                            (minibuffer-prompt-end)