[implementations-list] [PATCH] Remove unused undo-list-munging code.

=?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bm =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bm
Fri May 21 14:45:11 CEST 2010


---

While looking at the code, I noticed that all of this is currently
unused. Is that just an oversight, or are you actually planning to use
it in the future? If the former, this patch could safely be applied,
unless I'm missing something.

 vimpulse-dependencies.el |    6 ------
 vimpulse-visual-mode.el  |   31 +------------------------------
 2 files changed, 1 insertions(+), 36 deletions(-)

diff --git a/vimpulse-dependencies.el b/vimpulse-dependencies.el
index 7b12562..57754e7 100644
--- a/vimpulse-dependencies.el
+++ b/vimpulse-dependencies.el
@@ -337,12 +337,6 @@ (viper-deflocalvar vimpulse-visual-whitespace-overlay nil
   "Overlay encompassing text inserted into the buffer
 to make Block selection at least one column wide.")
 
-(viper-deflocalvar vimpulse-undo-needs-adjust nil
-  "If true, several commands in the undo-list should be connected.")
-
-(defconst vimpulse-buffer-undo-list-mark 'vimpulse
-  "Everything up to this mark is united in the undo-list.")
-
 (defvar vimpulse-visual-height nil
   "Height of last Visual selection.")
 
diff --git a/vimpulse-visual-mode.el b/vimpulse-visual-mode.el
index c3adea4..955c209 100644
--- a/vimpulse-visual-mode.el
+++ b/vimpulse-visual-mode.el
@@ -859,33 +859,6 @@ (defun vimpulse-visual-remap (from to)
   "Remap FROM to TO in Visual mode."
   (vimpulse-remap vimpulse-visual-basic-map from to))
 
-(defun vimpulse-filter-undos (undo-list)
-  "Filters all `nil' marks from `undo-list' until the first
-occurrence of `vimpulse-buffer-undo-list-mark'."
-  (cond
-   ((null undo-list)
-    nil)
-   ((eq (car undo-list) 'vimpulse)
-    (cdr undo-list))
-   ((null (car undo-list))
-    (vimpulse-filter-undos (cdr undo-list)))
-   (t
-    (cons (car undo-list)
-          (vimpulse-filter-undos (cdr undo-list))))))
-
-(defun vimpulse-connect-undos ()
-  "Connects all undo-steps from `buffer-undo-list' up to the
-first occurrence of `vimpulse-buffer-undo-list-mark'."
-  (when (and vimpulse-undo-needs-adjust
-             (listp buffer-undo-list))
-    (setq buffer-undo-list
-          (vimpulse-filter-undos buffer-undo-list)))
-  (setq vimpulse-undo-needs-adjust nil))
-
-(defun vimpulse-push-buffer-undo-list-mark ()
-  (setq vimpulse-undo-needs-adjust t)
-  (push vimpulse-buffer-undo-list-mark buffer-undo-list))
-
 ;;; Ex
 
 (defun vimpulse-visual-ex (arg)
@@ -1232,9 +1205,7 @@ (defun vimpulse-exit-insert-state ()
                        (move-to-column (1+ col) t) ; append spaces
                        (viper-repeat nil)))
               (viper-repeat nil)))))
-      (setq vimpulse-visual-insert-coords nil)))
-  ;; Update undo-list
-  (vimpulse-connect-undos))
+      (setq vimpulse-visual-insert-coords nil))))
 
 (fset 'viper-exit-insert-state 'vimpulse-exit-insert-state)
 
-- 
1.7.1




More information about the implementations-list mailing list