Fix folding of non-ASCII lines when printing to Postscript

* lisp/ps-mule.el (ps-mule-plot-string): Fix folding of non-ASCII
Latin-1 lines (bug#17758).
This commit is contained in:
Lars Ingebrigtsen 2021-05-29 07:38:00 +02:00
parent 30c09a1674
commit 22520811e2

View file

@ -673,7 +673,7 @@ the sequence."
(not (vectorp (aref (nth 2 composition) 0)))) (not (vectorp (aref (nth 2 composition) 0))))
(car composition) (car composition)
to)) to))
(ascii-or-latin-1 "[\000-\377]+") (ascii-or-latin-1 "[\000-ÿ]+")
(run-width 0) (run-width 0)
(endpos nil) (endpos nil)
(font-spec-table (aref ps-mule-font-spec-tables (font-spec-table (aref ps-mule-font-spec-tables
@ -699,6 +699,7 @@ the sequence."
(setq composition (find-composition (point) to nil t)) (setq composition (find-composition (point) to nil t))
(setq stop (if composition (car composition) to))))) (setq stop (if composition (car composition) to)))))
;; We fold lines that contain ASCII or Latin-1.
((looking-at ascii-or-latin-1) ((looking-at ascii-or-latin-1)
(let ((nchars (- (min (match-end 0) stop) (point)))) (let ((nchars (- (min (match-end 0) stop) (point))))
(setq width (* average-width nchars)) (setq width (* average-width nchars))
@ -710,6 +711,7 @@ the sequence."
(setq run-width (+ run-width width)) (setq run-width (+ run-width width))
(forward-char nchars)))) (forward-char nchars))))
;; Don't fold other lines. (But why?)
(t (t
(while (and (< (point) stop) (not endpos)) (while (and (< (point) stop) (not endpos))
(setq width (char-width (following-char))) (setq width (char-width (following-char)))