diff src/select.c @ 5338:8608eadee6ba

Move #'delq, #'delete to Lisp, adding support for sequences. src/ChangeLog addition: 2011-01-11 Aidan Kehoe <kehoea@parhasard.net> * device-msw.c (Fmswindows_printer_list): Remove a Fdelete () call here, remove the necessity for it. * fns.c (Fdelete, Fdelq): * lisp.h: Move #'delete, #'delq to Lisp, implemented in terms of #'delete* * select.c (Fown_selection_internal): * select.c (handle_selection_clear): Use delq_no_quit() in these functions, don't reimplement it or use Fdelq(), which is now gone. lisp/ChangeLog addition: 2011-01-11 Aidan Kehoe <kehoea@parhasard.net> * subr.el (delete, delq, remove, remq): Move #'remove, #'remq here, they don't belong in cl-seq.el; move #'delete, #'delq here from fns.c, implement them in terms of #'delete*, allowing support for sequences generally. * update-elc.el (do-autoload-commands): Use #'delete*, not #'delq here, now the latter's no longer dumped. * cl-macs.el (delete, delq): Add compiler macros transforming #'delete and #'delq to #'delete* calls.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 14 Jan 2011 23:35:29 +0000
parents 8b2f75cecb89
children a9094f28f9a9
line wrap: on
line diff
--- a/src/select.c	Fri Jan 14 23:23:30 2011 +0000
+++ b/src/select.c	Fri Jan 14 23:35:29 2011 +0000
@@ -183,19 +183,8 @@
       if (!NILP (local_selection_data))
 	{
 	  owned_p = 1;
-	  /* Don't use Fdelq() as that may QUIT;. */
-	  if (EQ (local_selection_data, Fcar (Vselection_alist)))
-	    Vselection_alist = Fcdr (Vselection_alist);
-	  else
-	    {
-	      Lisp_Object rest;
-	      for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
-		if (EQ (local_selection_data, Fcar (XCDR (rest))))
-		  {
-		    XCDR (rest) = Fcdr (XCDR (rest));
-		    break;
-		  }
-	    }
+	  Vselection_alist
+		  = delq_no_quit (local_selection_data, Vselection_alist);
 	}
     }
   else
@@ -412,21 +401,8 @@
   /* Well, we already believe that we don't own it, so that's just fine. */
   if (NILP (local_selection_data)) return;
 
-  /* Otherwise, we're really honest and truly being told to drop it.
-     Don't use Fdelq() as that may QUIT;.
-   */
-  if (EQ (local_selection_data, Fcar (Vselection_alist)))
-    Vselection_alist = Fcdr (Vselection_alist);
-  else
-    {
-      Lisp_Object rest;
-      for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
-	if (EQ (local_selection_data, Fcar (XCDR (rest))))
-	  {
-	    XCDR (rest) = Fcdr (XCDR (rest));
-	    break;
-	  }
-    }
+  /* Otherwise, we're really honest and truly being told to drop it. */
+  Vselection_alist = delq_no_quit (local_selection_data, Vselection_alist);
 
   /* Let random lisp code notice that the selection has been stolen.
    */