]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/picture.el
Fix the MSDOS build
[gnu-emacs] / lisp / textmodes / picture.el
index 201b85b2528823b6e0c6376de49db1552038b31f..b77f8e9717c975c8556ceb608b7a28cd23de11fc 100644 (file)
@@ -1,6 +1,6 @@
 ;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model
 
-;; Copyright (C) 1985, 1994, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1994, 2001-2016 Free Software Foundation, Inc.
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: emacs-devel@gnu.org
@@ -272,7 +272,11 @@ Use \"\\[command-apropos] picture-movement\" to see commands which control motio
        (or (eolp)
            (let ((pos (point)))
              (move-to-column col t)
-             (delete-region pos (point)))))
+             (let ((old-width (string-width (buffer-substring pos (point)))))
+               (delete-region pos (point))
+               (when (> old-width width)
+                 (insert-char ?  (- old-width width))
+                 (goto-char pos))))))
       (insert ch)
       (forward-char -1)
       (picture-move))))