[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master cc365ca: Remove usages of assoc-delete-all in project.el

From: Dmitry Gutov
Subject: master cc365ca: Remove usages of assoc-delete-all in project.el
Date: Thu, 6 Aug 2020 10:50:09 -0400 (EDT)

branch: master
commit cc365ca6d8ce24b882a39a062ce64f796693f974
Author: Philip K <philipk@posteo.net>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Remove usages of assoc-delete-all in project.el
    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 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 51b9347..b616135 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1166,7 +1166,9 @@ Save the result in `project-list-file' if the list of 
projects has changed."
   (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)
@@ -1176,8 +1178,8 @@ If the directory was in the list before the removal, save 
 result in `project-list-file'.  Announce the project's removal
 from the 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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]