bongo-patches
[Top][All Lists]
Advanced

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

[bongo-patches] Fix copy commands so that hitting `c' consecutively keep


From: Daniel Brockman
Subject: [bongo-patches] Fix copy commands so that hitting `c' consecutively keeps appending to the same kill, meaning `y' will yank it all back at once (it used to behave this way but this feature was broken somewhere along the way)
Date: Sun, 29 Apr 2007 11:21:20 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

Fix copy commands so that hitting `c' consecutively keeps
appending to the same kill, meaning `y' will yank it all
back at once (it used to behave this way but this feature
was broken somewhere along the way).

diff -rN -u old-bongo/bongo.el new-bongo/bongo.el
--- old-bongo/bongo.el  2007-04-29 11:21:13.000000000 +0200
+++ new-bongo/bongo.el  2007-04-29 11:21:13.000000000 +0200
@@ -8678,7 +8678,9 @@
   (interactive "p")
   (or n (setq n 1))
   (if (< n 0)
-      (bongo-copy-line-backward (- n))
+      (progn (when (eq this-command 'bongo-copy-line-forward)
+               (setq this-command 'bongo-copy-line-backward))
+             (bongo-copy-line-backward (- n)))
     (when (> n 0)
       (when (eq last-command 'bongo-copy-line-forward)
         (append-next-kill))
@@ -8704,7 +8706,9 @@
   (interactive "p")
   (or n (setq n 1))
   (if (< n 0)
-      (bongo-copy-line-forward (- n))
+      (progn (when (eq this-command 'bongo-copy-line-backward)
+               (setq this-command 'bongo-copy-line-forward))
+             (bongo-copy-line-forward (- n)))
     (when (> n 0)
       (bongo-previous-object-or-line)
       (when (eq last-command 'bongo-copy-line-backward)
@@ -8740,13 +8744,15 @@
 Otherwise, just copy the track or section at point.
 Leave point after the copied text."
   (interactive "P")
-  (cond ((not (null n))
+  (cond (n
          (bongo-copy-line-forward (prefix-numeric-value n)))
         ((bongo-region-active-p)
          (bongo-copy-region (region-beginning) (region-end)))
         (bongo-marking
          (bongo-copy-marked))
         (t
+         (when (eq this-command 'bongo-copy-forward)
+           (setq this-command 'bongo-copy-line-forward))
          (bongo-copy-line-forward))))
 
 (defun bongo-copy-backward (&optional n)
@@ -8756,8 +8762,12 @@
 Otherwise, if there are any marked tracks, copy those.
 Otherwise, just copy the track or section at point.
 Leave point before the copied text."
-  (interactive "p")
-  (bongo-copy-forward (- n)))
+  (interactive "P")
+  (if n
+      (bongo-copy-forward (- (prefix-numeric-value n)))
+    (when (eq this-command 'bongo-copy-backward)
+      (setq this-command 'bongo-copy-forward))
+    (bongo-copy-forward)))
 
 (defun bongo-clean-up-after-insertion (beg end)
   (let ((end (move-marker (make-marker) end))
-- 
Daniel Brockman <address@hidden>

reply via email to

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