emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116815: lisp/emacs-lisp/cl-extra.el (cl--map-overla


From: Juanma Barranquero
Subject: [Emacs-diffs] trunk r116815: lisp/emacs-lisp/cl-extra.el (cl--map-overlays): Remove obsolete code.
Date: Thu, 20 Mar 2014 18:16:57 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116815
revision-id: address@hidden
parent: address@hidden
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Thu 2014-03-20 19:16:47 +0100
message:
  lisp/emacs-lisp/cl-extra.el (cl--map-overlays): Remove obsolete code.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emacs-lisp/cl-extra.el    clextra.el-20091113204419-o5vbwnq5f7feedwu-611
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-03-20 18:13:16 +0000
+++ b/lisp/ChangeLog    2014-03-20 18:16:47 +0000
@@ -1,5 +1,7 @@
 2014-03-20  Juanma Barranquero  <address@hidden>
 
+       * emacs-lisp/cl-extra.el (cl--map-overlays): Remove obsolete code.
+
        * skeleton.el (skeleton-autowrap): Mark as obsolete.  Doc fix.
 
 2014-03-20  Stefan Monnier  <address@hidden>

=== modified file 'lisp/emacs-lisp/cl-extra.el'
--- a/lisp/emacs-lisp/cl-extra.el       2014-01-01 07:43:34 +0000
+++ b/lisp/emacs-lisp/cl-extra.el       2014-03-20 18:16:47 +0000
@@ -269,43 +269,20 @@
 ;;;###autoload
 (defun cl--map-overlays (cl-func &optional cl-buffer cl-start cl-end cl-arg)
   (or cl-buffer (setq cl-buffer (current-buffer)))
-  (if (fboundp 'overlay-lists)
-
-      ;; This is the preferred algorithm, though overlay-lists is undocumented.
-      (let (cl-ovl)
-       (with-current-buffer cl-buffer
-         (setq cl-ovl (overlay-lists))
-         (if cl-start (setq cl-start (copy-marker cl-start)))
-         (if cl-end (setq cl-end (copy-marker cl-end))))
-       (setq cl-ovl (nconc (car cl-ovl) (cdr cl-ovl)))
-       (while (and cl-ovl
-                   (or (not (overlay-start (car cl-ovl)))
-                       (and cl-end (>= (overlay-start (car cl-ovl)) cl-end))
-                       (and cl-start (<= (overlay-end (car cl-ovl)) cl-start))
-                       (not (funcall cl-func (car cl-ovl) cl-arg))))
-         (setq cl-ovl (cdr cl-ovl)))
-       (if cl-start (set-marker cl-start nil))
-       (if cl-end (set-marker cl-end nil)))
-
-    ;; This alternate algorithm fails to find zero-length overlays.
-    (let ((cl-mark (with-current-buffer cl-buffer
-                    (copy-marker (or cl-start (point-min)))))
-         (cl-mark2 (and cl-end (with-current-buffer cl-buffer
-                                 (copy-marker cl-end))))
-         cl-pos cl-ovl)
-      (while (save-excursion
-              (and (setq cl-pos (marker-position cl-mark))
-                   (< cl-pos (or cl-mark2 (point-max)))
-                   (progn
-                     (set-buffer cl-buffer)
-                     (setq cl-ovl (overlays-at cl-pos))
-                     (set-marker cl-mark (next-overlay-change cl-pos)))))
-       (while (and cl-ovl
-                   (or (/= (overlay-start (car cl-ovl)) cl-pos)
-                       (not (and (funcall cl-func (car cl-ovl) cl-arg)
-                                 (set-marker cl-mark nil)))))
-         (setq cl-ovl (cdr cl-ovl))))
-      (set-marker cl-mark nil) (if cl-mark2 (set-marker cl-mark2 nil)))))
+  (let (cl-ovl)
+    (with-current-buffer cl-buffer
+      (setq cl-ovl (overlay-lists))
+      (if cl-start (setq cl-start (copy-marker cl-start)))
+      (if cl-end (setq cl-end (copy-marker cl-end))))
+    (setq cl-ovl (nconc (car cl-ovl) (cdr cl-ovl)))
+    (while (and cl-ovl
+               (or (not (overlay-start (car cl-ovl)))
+                   (and cl-end (>= (overlay-start (car cl-ovl)) cl-end))
+                   (and cl-start (<= (overlay-end (car cl-ovl)) cl-start))
+                   (not (funcall cl-func (car cl-ovl) cl-arg))))
+      (setq cl-ovl (cdr cl-ovl)))
+    (if cl-start (set-marker cl-start nil))
+    (if cl-end (set-marker cl-end nil))))
 
 ;;; Support for `setf'.
 ;;;###autoload


reply via email to

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