emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c221f17 1/2: Make some non-ASCII work in ebnf2ps


From: Lars Ingebrigtsen
Subject: master c221f17 1/2: Make some non-ASCII work in ebnf2ps
Date: Sun, 29 Aug 2021 22:54:22 -0400 (EDT)

branch: master
commit c221f17b1ce448ed52b37e9e380a99f22b30963c
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make some non-ASCII work in ebnf2ps
    
    * lisp/progmodes/ebnf2ps.el (ebnf-print-buffer): Make non-ASCII
    work slightly better (bug#39663).
---
 lisp/progmodes/ebnf2ps.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 884104a..3be3d70 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]