emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] 137/352: Käytetään varmuuden vuoksi ei-destruktiivisia keinoja


From: Stefan Monnier
Subject: [elpa] 137/352: Käytetään varmuuden vuoksi ei-destruktiivisia keinoja
Date: Mon, 07 Jul 2014 14:03:17 +0000

monnier pushed a commit to branch master
in repository elpa.

commit 2085f9b717e3eea7b09fe280c90c352e2724ec6d
Author: Teemu Likonen <address@hidden>
Date:   Mon Jul 27 11:11:33 2009 +0000

    Käytetään varmuuden vuoksi ei-destruktiivisia keinoja
---
 wcheck-mode.el |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/wcheck-mode.el b/wcheck-mode.el
index 8352243..632811d 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -916,8 +916,9 @@ ALIST is a list of (A . B) items in which A and B are 
integers.
 Each item denote a buffer position range from A to B. This
 function returns a new list which has items in increasing order
 according to A's and all overlapping A B ranges are combined."
-  (let ((alist (sort alist #'(lambda (a b)
-                               (< (car a) (car b)))))
+  (let ((alist (sort (copy-tree alist)
+                     #'(lambda (a b)
+                         (< (car a) (car b)))))
         ready prev)
     (while alist
       (while (not (equal prev alist))
@@ -988,11 +989,11 @@ range BEG to END. Otherwise remove all overlays."
 
 (defun wcheck-delete-buffer-data (buffer)
   "Delete all data associated to BUFFER."
-  (mapc #'(lambda (item)
-            (when (eq buffer (plist-get item :buffer))
-              (setq wcheck-buffer-data (delq item wcheck-buffer-data))))
-        wcheck-buffer-data)
-  wcheck-buffer-data)
+  (setq wcheck-buffer-data
+        (remove nil (mapcar #'(lambda (item)
+                                (unless (eq buffer (plist-get item :buffer))
+                                  item))
+                            wcheck-buffer-data))))
 
 
 (defun wcheck-get-data (key value &optional target-key)
@@ -1007,9 +1008,9 @@ with the matching KEY VALUE."
 
 (defun wcheck-get-all-data (key)
   "Return every buffer's value for KEY."
-  (delq nil (mapcar #'(lambda (item)
-                        (plist-get item key))
-                    wcheck-buffer-data)))
+  (remove nil (mapcar #'(lambda (item)
+                          (plist-get item key))
+                      wcheck-buffer-data)))
 
 
 (defun wcheck-set-buffer-data (buffer key value)



reply via email to

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