changeset 34648:e787281bcf24

(artist-replace-chars, artist-replace-char): Check that emacs-major-version is `=' to 20, not `>='. (artist-replace-chars): Use `make-string' instead of a loop.
author Miles Bader <miles@gnu.org>
date Mon, 18 Dec 2000 01:18:33 +0000
parents 1898b3c996ff
children 7140dfffb7b6
files lisp/textmodes/artist.el
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/artist.el	Mon Dec 18 00:39:59 2000 +0000
+++ b/lisp/textmodes/artist.el	Mon Dec 18 01:18:33 2000 +0000
@@ -1899,7 +1899,7 @@
 (defun artist-replace-char (new-char)
   "Replace the character at point with NEW-CHAR."
   ;; Check that the variable exists first. The doc says it was added in 19.23.
-  (if (and (and (boundp 'emacs-major-version) (>= emacs-major-version 20))
+  (if (and (and (boundp 'emacs-major-version) (= emacs-major-version 20))
 	   (and (boundp 'emacs-minor-version) (<= emacs-minor-version 3)))
       ;; This is a bug workaround for Emacs 20, versions up to 20.3:
       ;; The self-insert-command doesn't care about the overwrite-mode,
@@ -1920,17 +1920,14 @@
 (defun artist-replace-chars (new-char count)
   "Replace characters at point with NEW-CHAR.  COUNT chars are replaced."
   ;; Check that the variable exists first. The doc says it was added in 19.23.
-  (if (and (and (boundp 'emacs-major-version) (>= emacs-major-version 20))
+  (if (and (and (boundp 'emacs-major-version) (= emacs-major-version 20))
 	   (and (boundp 'emacs-minor-version) (<= emacs-minor-version 3)))
       ;; This is a bug workaround for Emacs 20, versions up to 20.3:
       ;; The self-insert-command doesn't care about the overwrite-mode,
       ;; so the insertion is done in the same way as in picture mode.
       ;; This seems to be a little bit slower.
       (let* ((replaced-c (aref artist-replacement-table new-char))
-	     (replaced-s (let ((tmp-s "") (i count))
-			   (while (> i 0)
-			     (setq i (1- i))
-			     (setq tmp-s (concat tmp-s replaced-c))))))
+	     (replaced-s (make-string count replaced-c)))
 	(artist-move-to-xy (+ (artist-current-column) count)
 			   (artist-current-line))
 	(delete-char (- count))