]> git.eshelyaron.com Git - emacs.git/commitdiff
(project-switch-project): Fix the previous change
authorDmitry Gutov <dmitry@gutov.dev>
Wed, 1 Nov 2023 20:48:23 +0000 (22:48 +0200)
committerDmitry Gutov <dmitry@gutov.dev>
Wed, 1 Nov 2023 20:48:51 +0000 (22:48 +0200)
* lisp/progmodes/project.el (project-switch-project):
Clear the buffer-local value in the right buffer (bug#66317).

lisp/progmodes/project.el

index 5129dc98b82a26ce1623bd3d6496e79881add21b..57d9d8e99ab22481a1a41c561d327b199b94ff97 100644 (file)
@@ -2029,12 +2029,14 @@ to directory DIR."
   (interactive (list (funcall project-prompter)))
   (let ((command (if (symbolp project-switch-commands)
                      project-switch-commands
-                   (project--switch-project-command))))
+                   (project--switch-project-command)))
+        (buffer (current-buffer)))
     (unwind-protect
         (progn
           (setq-local project-current-directory-override dir)
           (call-interactively command))
-      (kill-local-variable 'project-current-directory-override))))
+      (with-current-buffer buffer
+        (kill-local-variable 'project-current-directory-override)))))
 
 ;;;###autoload
 (defun project-uniquify-dirname-transform (dirname)