]> git.eshelyaron.com Git - emacs.git/commitdiff
(picture-forward-column, picture-backward-column): Allow backward motion
authorKarl Heuer <kwzh@gnu.org>
Tue, 1 Mar 1994 06:19:22 +0000 (06:19 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 1 Mar 1994 06:19:22 +0000 (06:19 +0000)
across multi-column characters.

lisp/textmodes/picture.el

index 878161da481101fe8881ea534148d4f8097b2cf0..72c7125593d1535db405907662449d6b45b31dc9 100644 (file)
@@ -76,13 +76,19 @@ If scan reaches end of buffer, stop there without error."
   "Move cursor right, making whitespace if necessary.
 With argument, move that many columns."
   (interactive "p")
-  (move-to-column-force (+ (current-column) arg)))
+  (let ((target-column (+ (current-column) arg)))
+    (move-to-column-force target-column)
+    ;; Picture mode isn't really suited to multi-column characters,
+    ;; but we might as well let the user move across them.
+    (and (< arg 0)
+        (> (current-column) target-column)
+        (forward-char -1))))
 
 (defun picture-backward-column (arg)
   "Move cursor left, making whitespace if necessary.
 With argument, move that many columns."
   (interactive "p")
-  (move-to-column-force (- (current-column) arg)))
+  (picture-forward-column (- arg)))
 
 (defun picture-move-down (arg)
   "Move vertically down, making whitespace if necessary.