]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove usages of assoc-delete-all in project.el
authorPhilip K <philipk@posteo.net>
Wed, 5 Aug 2020 20:57:01 +0000 (22:57 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 6 Aug 2020 14:49:53 +0000 (17:49 +0300)
assoc-delete-all is not available for users who have installed
project.el via ELPA on older Emacs versions (bug#42668).

* lisp/progmodes/project.el
(project-remember-project, project--remove-from-project-list):
Replace assoc-delete-all with equivalent alternatives.

lisp/progmodes/project.el

index 51b9347bb9335a6eddf8cb58a67d3d6a149fb9e9..b6161351f0bf1e814e26add316fe2a0d61db7aa0 100644 (file)
@@ -1166,7 +1166,9 @@ Save the result in `project-list-file' if the list of projects has changed."
   (project--ensure-read-project-list)
   (let ((dir (project-root pr)))
     (unless (equal (caar project--list) dir)
-      (setq project--list (assoc-delete-all dir project--list))
+      (dolist (ent project--list)
+        (when (equal dir (car ent))
+          (setq project--list (delq ent project--list))))
       (push (list dir) project--list)
       (project--write-project-list))))
 
@@ -1176,8 +1178,8 @@ If the directory was in the list before the removal, save the
 result in `project-list-file'.  Announce the project's removal
 from the list."
   (project--ensure-read-project-list)
-  (when (assoc pr-dir project--list)
-    (setq project--list (assoc-delete-all pr-dir project--list))
+  (when-let ((ent (assoc pr-dir project--list)))
+    (setq project--list (delq ent project--list))
     (message "Project `%s' not found; removed from list" pr-dir)
     (project--write-project-list)))