Fixup fromcvs/togit conversion
[pkgsrcv2.git] / textproc / psgml-mode / patches / patch-psgml-edit.el
1 $NetBSD$
2
3 Fix build with emacs24. From FreeBSD ports.
4
5 --- psgml-edit.el.orig  2005-03-05 16:23:40.000000000 +0000
6 +++ psgml-edit.el
7 @@ -1870,24 +1870,28 @@ characters in the current coding system.
8     (invert
9      (or (looking-at "&#\\([0-9]+\\)[;\n]?")
10         (error "No character reference after point"))
11 -    (let ((c (string-to-int (buffer-substring (match-beginning 1)
12 +    (let ((c (string-to-number (buffer-substring (match-beginning 1)
13                                               (match-end 1)))))
14        (delete-region (match-beginning 0)
15                      (match-end 0))
16        (if (fboundp 'decode-char)       ; Emacs 21, Mule-UCS
17           (setq c (decode-char 'ucs c))
18 +       (if (fboundp 'ucs-to-char)
19 +           (setq c (ucs-to-char c))
20         ;; Else have to assume 8-bit character.
21 -       (if (fboundp 'unibyte-char-to-multibyte) ; Emacs 20
22 -           (setq c (unibyte-char-to-multibyte c))))
23 +         (if (fboundp 'unibyte-char-to-multibyte) ; Emacs 20
24 +             (setq c (unibyte-char-to-multibyte c)))))
25        (insert c)))
26     ;; Convert character to &#nn;
27     (t
28      (let ((c (following-char)))
29        (delete-char 1)
30 -      (if (fboundp 'encode-char)
31 -         (setq c (encode-char c 'ucs))
32 -       (if (fboundp 'multibyte-char-to-unibyte)
33 -           (setq c (multibyte-char-to-unibyte c))))
34 +      (if (fboundp 'char-to-ucs)
35 +         (setq c (char-to-ucs c))
36 +       (if (fboundp 'encode-char)
37 +           (setq c (encode-char c 'ucs))
38 +         (if (fboundp 'multibyte-char-to-unibyte)
39 +             (setq c (multibyte-char-to-unibyte c)))))
40        (insert (format "&#%d;" c))))))
41  
42  (defun sgml-expand-entity-reference ()