X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fformat-spec.el;h=bf096bf7f5eb4340afa81be11bf643cb88eb3743;hb=a7fb7b68543f38dc4cfd80f56612d2399e349018;hp=a5de3496f81cd759517c84cdca55844da58cc98e;hpb=b4bc300f0dcddc2b17bb50a3501ed6e6db1ef12c;p=gnus diff --git a/lisp/format-spec.el b/lisp/format-spec.el index a5de3496f..bf096bf7f 100644 --- a/lisp/format-spec.el +++ b/lisp/format-spec.el @@ -1,6 +1,6 @@ ;;; format-spec.el --- functions for formatting arbitrary formatting strings -;; Copyright (C) 1999-2014 Free Software Foundation, Inc. +;; Copyright (C) 1999-2015 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Keywords: tools @@ -43,7 +43,9 @@ the text that it generates." ;; Valid format spec. ((looking-at "\\([-0-9.]*\\)\\([a-zA-Z]\\)") (let* ((num (match-string 1)) - (spec (string-to-char (match-string 2))) + (spec (if (featurep 'xemacs) + (char-to-int (string-to-char (match-string 2))) + (string-to-char (match-string 2)))) (val (assq spec specification))) (unless val (error "Invalid format character: `%%%c'" spec)) @@ -70,7 +72,13 @@ starting with a character." (while pairs (unless (cdr pairs) (error "Invalid list of pairs")) - (push (cons (car pairs) (cadr pairs)) alist) + (push (cons (if (featurep 'xemacs) + (if (characterp (car pairs)) + (char-to-int (car pairs)) + (car pairs)) + (car pairs)) + (cadr pairs)) + alist) (setq pairs (cddr pairs))) (nreverse alist)))