emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 1af5e6e: Encode header strings before printing


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] emacs-25 1af5e6e: Encode header strings before printing
Date: Tue, 23 Feb 2016 03:56:31 +0000

branch: emacs-25
commit 1af5e6e0ac236d535561a3d7e063313b523a1d42
Author: Ɓukasz Stelmach <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Encode header strings before printing
    
    * lisp/ps-print.el (ps-generate-header-line): Encode the
    header strings to avoid problems with non-ASCII headers
    (bug#22611).
    
    Backport:
    
    (cherry picked from commit 3cedbdcc71ebefc12bd20ec84f74251fe99ee7d0)
---
 lisp/ps-print.el |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 965e675..1167b9c 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -4759,7 +4759,11 @@ page-height == ((floor print-height ((th + ls) * zh)) * 
((th + ls) * zh)) - th
    ;; Literal strings should be output as is -- the string must contain its own
    ;; PS string delimiters, '(' and ')', if necessary.
    ((stringp content)
-    (ps-output content))
+    (if (functionp ps-encode-header-string-function)
+        (dolist (elem (funcall ps-encode-header-string-function
+                               content fonttag))
+         (ps-output elem))
+      (ps-output content)))
 
    ;; Functions are called -- they should return strings; they will be inserted
    ;; as strings and the PS string delimiters added.
@@ -4775,7 +4779,7 @@ page-height == ((floor print-height ((th + ls) * zh)) * 
((th + ls) * zh)) - th
    ((and (symbolp content) (boundp content))
     (if (fboundp ps-encode-header-string-function)
        (dolist (l (funcall ps-encode-header-string-function
-                            (symbol-value content) fonttag))
+                            (symbol-value content) fonttag))
          (ps-output-string l))
       (ps-output-string (symbol-value content))))
 



reply via email to

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