aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorMiles Bader2000-12-18 01:18:43 +0000
committerMiles Bader2000-12-18 01:18:43 +0000
commit5a04700221cb704ec8ebdce2ddf76c1f14ec3faa (patch)
tree9a5918b10b41aa9633319b4aaca8ba09fc0656ac /lisp/textmodes
parentdd97db06184ed309989a6c8d876cde653707e705 (diff)
downloademacs-5a04700221cb704ec8ebdce2ddf76c1f14ec3faa.tar.gz
emacs-5a04700221cb704ec8ebdce2ddf76c1f14ec3faa.zip
(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.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/artist.el9
1 files changed, 3 insertions, 6 deletions
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index c6da8051f24..918cdffadf8 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -1899,7 +1899,7 @@ Also updates the variables `artist-draw-min-y' and `artist-draw-max-y'."
1899(defun artist-replace-char (new-char) 1899(defun artist-replace-char (new-char)
1900 "Replace the character at point with NEW-CHAR." 1900 "Replace the character at point with NEW-CHAR."
1901 ;; Check that the variable exists first. The doc says it was added in 19.23. 1901 ;; Check that the variable exists first. The doc says it was added in 19.23.
1902 (if (and (and (boundp 'emacs-major-version) (>= emacs-major-version 20)) 1902 (if (and (and (boundp 'emacs-major-version) (= emacs-major-version 20))
1903 (and (boundp 'emacs-minor-version) (<= emacs-minor-version 3))) 1903 (and (boundp 'emacs-minor-version) (<= emacs-minor-version 3)))
1904 ;; This is a bug workaround for Emacs 20, versions up to 20.3: 1904 ;; This is a bug workaround for Emacs 20, versions up to 20.3:
1905 ;; The self-insert-command doesn't care about the overwrite-mode, 1905 ;; The self-insert-command doesn't care about the overwrite-mode,
@@ -1920,17 +1920,14 @@ Also updates the variables `artist-draw-min-y' and `artist-draw-max-y'."
1920(defun artist-replace-chars (new-char count) 1920(defun artist-replace-chars (new-char count)
1921 "Replace characters at point with NEW-CHAR. COUNT chars are replaced." 1921 "Replace characters at point with NEW-CHAR. COUNT chars are replaced."
1922 ;; Check that the variable exists first. The doc says it was added in 19.23. 1922 ;; Check that the variable exists first. The doc says it was added in 19.23.
1923 (if (and (and (boundp 'emacs-major-version) (>= emacs-major-version 20)) 1923 (if (and (and (boundp 'emacs-major-version) (= emacs-major-version 20))
1924 (and (boundp 'emacs-minor-version) (<= emacs-minor-version 3))) 1924 (and (boundp 'emacs-minor-version) (<= emacs-minor-version 3)))
1925 ;; This is a bug workaround for Emacs 20, versions up to 20.3: 1925 ;; This is a bug workaround for Emacs 20, versions up to 20.3:
1926 ;; The self-insert-command doesn't care about the overwrite-mode, 1926 ;; The self-insert-command doesn't care about the overwrite-mode,
1927 ;; so the insertion is done in the same way as in picture mode. 1927 ;; so the insertion is done in the same way as in picture mode.
1928 ;; This seems to be a little bit slower. 1928 ;; This seems to be a little bit slower.
1929 (let* ((replaced-c (aref artist-replacement-table new-char)) 1929 (let* ((replaced-c (aref artist-replacement-table new-char))
1930 (replaced-s (let ((tmp-s "") (i count)) 1930 (replaced-s (make-string count replaced-c)))
1931 (while (> i 0)
1932 (setq i (1- i))
1933 (setq tmp-s (concat tmp-s replaced-c))))))
1934 (artist-move-to-xy (+ (artist-current-column) count) 1931 (artist-move-to-xy (+ (artist-current-column) count)
1935 (artist-current-line)) 1932 (artist-current-line))
1936 (delete-char (- count)) 1933 (delete-char (- count))