From: Dmitry Gutov Date: Tue, 2 Jun 2020 21:33:14 +0000 (+0300) Subject: Small cleanup X-Git-Tag: emacs-28.0.90~7226 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1fe1c84b188336e5a94b77f64d5906beac3446f2;p=emacs.git Small cleanup * lisp/progmodes/project.el (project--add-to-project-list-front): Small simplification. (project--remove-from-project-list): Remove oudated comment. --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1c4dc7e7617..bd99d5b725f 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -787,9 +787,9 @@ Save the result to disk if the project list was changed." (project--ensure-read-project-list) (let* ((dir (project-root pr)) (do-write (not (equal (car project--list) dir)))) - (setq project--list (delete dir project--list)) - (push dir project--list) (when do-write + (setq project--list (delete dir project--list)) + (push dir project--list) (project--write-project-list)))) (defun project--remove-from-project-list (pr-dir) @@ -797,8 +797,6 @@ Save the result to disk if the project list was changed." If the directory was in the list before the removal, save the result to disk." (project--ensure-read-project-list) - ;; XXX: This hardcodes that the number of roots = 1. - ;; It's fine, though. (when (member pr-dir project--list) (setq project--list (delete pr-dir project--list)) (message "Project `%s' not found; removed from list" pr-dir)