diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-08-30 03:14:08 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-08-30 03:14:08 +0200 |
commit | c221f17b1ce448ed52b37e9e380a99f22b30963c (patch) | |
tree | 99987f5b2430a09f51f3a751ee4b25be55f0c06c /lisp/progmodes/ebnf2ps.el | |
parent | 6885c62a104dcf52378860d8f951dbdce52b73c5 (diff) | |
download | emacs-c221f17b1ce448ed52b37e9e380a99f22b30963c.tar.gz |
Make some non-ASCII work in ebnf2ps
* lisp/progmodes/ebnf2ps.el (ebnf-print-buffer): Make non-ASCII
work slightly better (bug#39663).
Diffstat (limited to 'lisp/progmodes/ebnf2ps.el')
-rw-r--r-- | lisp/progmodes/ebnf2ps.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index 884104a16f7..3be3d7032db 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -2244,8 +2244,14 @@ the PostScript image in a file with that name. If FILENAME is a number, prompt the user for the name of the file to save in." (interactive (list (ps-print-preprint current-prefix-arg))) (ebnf-log-header "(ebnf-print-buffer %S)" filename) - (ebnf-print-region (point-min) (point-max) filename)) - + (cl-letf (((symbol-function 'ps-output-string) + ;; Make non-ASCII work (sort of). + (lambda (string) + (ps-output t (and string + (encode-coding-string + (decode-coding-string string 'utf-8) + 'iso-8859-1)))))) + (ebnf-print-region (point-min) (point-max) filename))) ;;;###autoload (defun ebnf-print-region (from to &optional filename) |