annotate lisp/international/ogonek.el @ 18266:fd7bd1ad0763

(byte-save-current-buffer): Change to code 114 (0162).
author Richard M. Stallman <rms@gnu.org>
date Sun, 15 Jun 1997 23:05:19 +0000
parents 85e7518aaf4a
children 31e4a16368c9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18264
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; ogonek.el --- basic editing commands for Emacs
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Author: W{\l}odek Bzyl, Ryszard Kubiak
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Maintainer: rysiek@ipipan.gda.pl (Ryszard Kubiak)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Keywords: i18n
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; any later version.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;;; Commentary:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; To use this library load it using
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; M-x load-library [enter] ogonek
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; Then, you may get a short info by calling one of
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; M-x ogonek-jak -- in Polish
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;; M-x ogonek-how -- in English "
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 (defconst ogonek-name-encoding-alist
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 '(("ascii" . (?A ?C ?E ?L ?N ?O ?S ?Z ?Z
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ?a ?c ?e ?l ?n ?o ?s ?z ?z))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ("iso8859-2" . (161 198 202 163 209 211 166 172 175
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 177 230 234 179 241 243 182 188 191))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 ("mazovia" . (143 149 144 156 165 163 152 160 161
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 134 141 145 146 164 162 158 166 167))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 ("windows-EE" . (165 198 202 163 209 211 140 143 175
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 185 230 234 179 241 243 156 159 191))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ("windows-PL" . (165 198 202 163 209 211 140 143 175
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 185 230 234 179 241 243 156 159 191))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 ("latin-2" . (164 143 168 157 227 224 151 141 189
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 165 134 169 136 228 162 152 171 190))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 ("CP852" . (164 143 168 157 227 224 151 141 189
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 165 134 169 136 228 162 152 171 190))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ("MeX" . (129 130 134 138 139 211 145 153 155
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 161 162 166 170 171 243 177 185 187))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 ("CorelDraw" . (197 242 201 163 209 211 255 225 237
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 229 236 230 198 241 243 165 170 186))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 ("Amiga" . (194 202 203 206 207 211 212 218 219
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 226 234 235 238 239 243 244 250 251))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 ("Mac" . (132 140 162 252 193 238 229 143 251
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 136 141 171 184 196 151 230 144 253))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 )
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 "The constant `ogonek-name-encoding-alist' is a list of (NAME.LIST) pairs.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 Each LIST contains codes for 18 Polish diacritic characters.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 The codes are given in the following order:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 Aogonek Cacute Eogonek Lslash Nacute Oacute Sacute Zacute Zdotaccent
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 aogonek cacute eogonek lslash nacute oacute sacute zacute zdotaccent.")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 ; ------ A Little Info in Polish ---------------
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 (defconst ogonek-informacja
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 " FUNKCJE INTERAKCYJNE UDOST/EPNIANE PRZEZ BIBLIOTEK/E `ogonek'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 Je/sli czytasz ten tekst, to albo przegl/adasz plik /zr/od/lowy
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 biblioteki `ogonek.el', albo wywo/la/le/s polecenie `ogonek-jak'.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 W drugim przypadku mo/zesz usun/a/c tekst z ekranu, stosuj/ac
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 polecenie `M-x kill-buffer'.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 Niniejsza bibliteka dostarcza funkcji do zmiany kodowania polskich
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 znak/ow diakrytycznych. Funkcje te mo/zna pogrupowa/c nast/epuj/aco.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 1. Funkcje `ogonek-recode-region' oraz `ogonek-recode-buffer'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 przekodowu/j/a zaznaczony fragment wzgl/ednie ca/ly buffor.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 Po wywo/laniu interakcyjnym funkcji zadawane s/a
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 pytania o parametry przekodowania, czyli o nazw/e kodowania
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 w tek/scie /zr/od/lowym i nazw/e kodowania docelowego.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 Poni/zsze przyk/lady pokazuj/a, jakich parametr/ow
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 oczekuj/a wymienione funkcje:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 (ogonek-recode-region (poczatek) (koniec)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 nazwa-kodowania-w-tekscie-zrodlowym nazwa-kodowania-docelowa)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 (ogonek-recode-buffer
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 nazwa-kodowania-w-tekscie-zrodlowym nazwa-kodowania-docelowa)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 2. Funkcje `ogonek-prefixify-region' oraz `ogonek-prefixify-buffer'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 do wprowadzania notacji prefiksowej.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 (ogonek-prefixify-region (poczatek) (koniec)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 nazwa-kodowania-w-tekscie-zrodlowym znak-prefiksu)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 (ogonek-prefixify-buffer
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 nazwa-kodowania-w-tekscie-zrodlowym znak-prefiksu)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 3. Funkcje `ogonek-deprefixify-region' oraz `ogonek-deprefixify-buffer'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 do usuwania notacji prefiksowej.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 (ogonek-deprefixify-region (poczatek) (koniec)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 znak-prefiksu nazwa-kodowania-docelowa)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 (ogonek-prefixify-buffer
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 znak-prefiksu nazwa-kodowania-docelowa)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 U/zycie klawisza TAB w trybie interakcyjnym powoduje wy/swietlenie
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 listy dopuszczalnych nazw kod/ow, odczytywanych ze sta/lej
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 `ogonek-name-encoding-alist'.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 Funkcje biblioteki odwo/luj/a si/e do pi/eciu zmiennych, kt/ore
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 przechowuj/a podpowiedzi do zadawanych pyta/n. Nazwy tych zmiennych
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 oraz ich warto/sci domy/slne s/a nast/epuj/ace:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 ogonek-from-encoding iso8859-2
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 ogonek-to-encoding mazovia
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 ogonek-prefix-char /
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 ogonek-prefix-from-encoding iso8859-2
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 ogonek-prefix-to-encoding iso8859-2
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 Powy/zsze warto/sci domy/slne mo/zna zmieni/c przez umieszczenie w pliku
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 konfiguracyjnym `~/.emacs' odpowiednich przypisa/n, na przyk/lad:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 (setq ogonek-prefix-char ?/)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 (setq ogonek-prefix-to-encoding \"iso8859-2\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 Zamiast wczytywania ca/lej biblioteki `ogonek.el' mo/zna w pliku
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 `~/.emacs' za/z/ada/c wczytania wybranych funkcji i to dopiero w
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 chwili ich wywo/lania:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 (autoload 'ogonek-jak \"ogonek\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 (autoload 'ogonek-recode-region \"ogonek\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 (autoload 'ogonek-prefixify-region \"ogonek\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 (autoload 'ogonek-deprefixify-region \"ogonek\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 Cz/esto wyst/epuj/ace kombinacje wywo/la/n funkcji mo/zna dla wygody
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 skr/oci/c i przypisa/c klawiszom. Oto praktyczne przyk/lady:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 (defun deprefixify-iso8859-2-region ()
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 (interactive \"*\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 (ogonek-deprefixify-region
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 (region-beginning) (region-end) ?/ \"iso8859-2\"))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 (global-set-key \"\\C-cd\" 'deprefixify-iso8859-2-region) ; ctrl-c d
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 (defun mazovia-to-iso8859-2 ()
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 (interactive \"*\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 (ogonek-recode-region \"mazovia\" \"iso8859-2\"))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 (global-set-key \"\\C-cr\" 'mazovia-to-iso8859-2) ; ctrl-c r
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 (defun prefixify-iso8859-2-region ()
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 (interactive \"*\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 (ogonek-prefixify-region
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 (region-beginning) (region-end) \"iso8859-2\" ?/))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 (global-set-key \"\\C-cp\" 'prefixify-iso8859-2-region) ; ctrl-c p
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 Ka/zd/a operacj/e przekodowania mo/zna w ca/lo/sci odwo/la/c
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 przez wykonanie polecenia `undo'.")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 (defun ogonek-jak ()
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 "Display the string constant `ogonek-informacja'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 by inserting it into an auxiliary *ogonek-jak* buffer."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 (interactive)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 (set-buffer (get-buffer-create " *ogonek-jak*"))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 (insert ogonek-informacja)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 (switch-to-buffer " *ogonek-jak*")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 (beginning-of-buffer))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 ; ------ A Little Info in English --------
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 (defconst ogonek-information
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 " INTERACTIVE FUNCTIONS PROVIDED BY THE LIBRARY `ogonek'.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 If you read this text then you are either looking at the library's
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 source text or you have called the `ogonek-howto' command. In the
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 latter case you may remove this text using `M-x kill-buffer'.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 The library provides functions for changing the encoding of Polish
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 diacritic characters, the ones with an `ogonek' below or above them.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 The functions come in the following gropus.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 1. Functions `ogonek-recode-region' and `ogonek-recode-buffer' to
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 change between one-character encodings, such as `iso-8859-2',
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 `mazovia', plain `ascii' or `TeX'. As the names suggest you may
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 recode either the entire current buffer or just a marked region
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 of it. You may use these functions interactively as commands. Once
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 you call a command you will be asked about the code used in
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 the source text and the target encoding, the one you want to get.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 The following examples show a non-interactive use of the functions
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 in a program. They also illustrtate what parameters the functions
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 expect:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 (ogonek-recode-region (region-beginning) (region-end)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 from-code-name to-code-name)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 (ogonek-recode-buffer from-code-name to-code-name)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 2. Functions `ogonek-prefixify-region' and `ogonek-prefixify-buffer'.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 for introducing prefix notation:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 (ogonek-prefixify-region (region-beginning) (region-end)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 from-code-name prefix-char)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 (ogonek-prefixify-buffer from-code-name prefix-char)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 3. Functions `ogonek-deprefixify-region' and `ogonek-deprefixify-buffer'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 for removing prefix notation:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 (ogonek-deprefixify-region (region-beginning) (region-end)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 prefix-char to-code-name)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 (ogonek-prefixify-buffer prefix-char to-code-name)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 The use of the TAB character in interactive makes `emacs' display
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 the list of encodings recognized by the library - the code names
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 are stored in the constant `ogonek-name-encoding-alist'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 The functions of the library refer to five variables that keep
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 hints to the questions asked. The names of those variables as well
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 as their default values are:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 ogonek-from-encoding iso8859-2
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 ogonek-to-encoding mazovia
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 ogonek-prefix-char /
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 ogonek-prefix-from-encoding iso8859-2
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 ogonek-prefix-to-encoding iso8859-2
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 The above default values can be changed by placing appropriate settings
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 in the '~/.emacs' file:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 (setq ogonek-prefix-char ?/)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 (setq ogonek-prefix-to-encoding \"iso8859-2\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 Instead of loading the whole library `ogonek.el' it may be better to
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 autoload chosen functions in `~/.emacs':
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 (autoload 'ogonek-jak \"ogonek\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 (autoload 'ogonek-recode-region \"ogonek\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 (autoload 'ogonek-prefixify-region \"ogonek\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 (autoload 'ogonek-deprefixify-region \"ogonek\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 The most frequent function calls can be abbreviated and assigned to
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 keyboard keys. Here are a few practical examples:
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 (setq ogonek-from-code-name \"iso8859-2\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 (setq ogonek-to-code-name \"mazovia\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242 (setq ogonek-prefix-char ?/)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 (setq ogonek-prefix-from-code-name \"iso8859-2\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 (setq ogonek-prefix-to-code-name \"iso8859-2\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 (defun deprefixify-iso8859-2-region ()
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247 (interactive \"*\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 (ogonek-deprefixify-region
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 (region-beginning) (region-end) ?/ \"iso8859-2\"))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 (global-set-key \"\\C-cd\" 'deprefixify-iso8859-2-region) ; ctrl-c d
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 (defun mazovia-to-iso8859-2 ()
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 (interactive \"*\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 (ogonek-recode-region \"mazovia\" \"iso8859-2\"))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 (global-set-key \"\\C-cr\" 'mazovia-to-iso8859-2) ; ctrl-c r
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 (defun prefixify-iso8859-2-region ()
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 (interactive \"*\")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 (ogonek-prefixify-region
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 (region-beginning) (region-end) \"iso8859-2\" ?/))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 (global-set-key \"\\C-cp\" 'prefixify-iso8859-2-region) ; ctrl-c p
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 Each recoding opertation can be called off by executing the `undo'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 command.")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 (defun ogonek-how ()
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 "Display the string constant `ogonek-information'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 by inserting it into an auxiliary *recode-help* buffer."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 (interactive "*")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 (set-buffer (get-buffer-create " *ogonek-help*"))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 (insert ogonek-information)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 (switch-to-buffer " *ogonek-help*")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 (beginning-of-buffer))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 ;; ------ Variables for keeping hints to the questions ---------
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 (defvar ogonek-from-encoding "iso8859-2"
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 "*Encoding in the source file of recoding.")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 (defvar ogonek-to-encoding "ascii"
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 "*Encoding in the target file of recoding.")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281 (defvar ogonek-prefix-char ?/
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 "*Prefix character for prefix encodings.")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 (defvar ogonek-prefix-from-encoding "iso8859-2"
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 "*Encoding in the source file subject to prefixifation.")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 (defvar ogonek-prefix-to-encoding "iso8859-2"
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 "*Encoding in the target file subject to deprefixifation.")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 ;; ------- Utilities for reading function parameters -------------
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 (defun ogonek-read-encoding (prompt default-name-var)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 "Change with completion based on alist `ogonek-name-encoding-alist'."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 (let ((encoding
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 (completing-read
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294 (format "%s (default %s): " prompt (eval default-name-var))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 ogonek-name-encoding-alist nil t)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 ; set the new default name to be the one just read
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 (set default-name-var
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298 (if (string= encoding "") (eval default-name-var) encoding))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 ; return the new default as the name you read
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300 (eval default-name-var)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 (defun ogonek-read-prefix (prompt default-prefix-var)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 "Change prefix."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 (let ((prefix-string
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 (read-string
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 (format "%s (default %s): " prompt
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307 (char-to-string (eval default-prefix-var))))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 (if (> (length prefix-string) 1)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 (error "! Only one character expected.")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 ; set the default prefix character to the one just read
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 (set default-prefix-var
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312 (if (string= prefix-string "")
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 (eval default-prefix-var)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314 (string-to-char prefix-string)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315 ; return the new default prefix as the code you read)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 (eval default-prefix-var))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 (defun ogonek-lookup-encoding (encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319 "Pick up an association for `encoding' in `ogonek-name-encoding-alist'.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 Before returning a result test whether it has been properly set
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 which should be true if the encoding is one of those in
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 `ogonek-name-encoding-alist'"
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 (let ((code-list (assoc encoding ogonek-name-encoding-alist)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324 (if (null code-list)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 (error "! Name `%s' not known in `ogonek-name-encoding-alist'."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 (cdr code-list))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329 ; ------- A utility for zipping two lists -----------
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331 (defun ogonek-zip-lists (xs ys)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 "Build a list of pairs with elements from lists `xs' and `ys'.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 We assume that `xs' and `ys' are of the same length."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 (let ((pairs nil))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 (while xs
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 (setq pairs (cons (cons (car xs) (car ys)) pairs))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337 (setq xs (cdr xs))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 (setq ys (cdr ys)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339 ; `pairs' are the function's result
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 pairs))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 ; -------- Dealing with one-character cencodings -------
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
344 (defun ogonek-build-table (recoding-pairs)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345 "Build a table nedeed by emacs's `translate-region' function.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 The `recoding-pairs' argument is a list of pairs of characters.
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 By using the built-in `translate-region' function
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348 we gain better performance compared to converting characters
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 by a hand-written routine as it is done for prefix encodings."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 (let ((table (make-string 256 0))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 (i 0))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352 (while (< i 256)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353 (aset table i i)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 (setq i (1+ i)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 ; make changes in `table' according to `recoding-pairs'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 (while recoding-pairs
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 (aset table (car (car recoding-pairs)) (cdr (car recoding-pairs)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 (setq recoding-pairs (cdr recoding-pairs)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 ; return the table just built
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360 table))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 (defun ogonek-recode-region (start end from-encoding to-encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363 "This function recodes text in a region delineated by the current-mark
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364 and the current point according to the defaults set by the variables
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365 `ogonek-from-encoding' and `ogonek-to-encoding'."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366 (interactive (progn (barf-if-buffer-read-only)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 (list
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368 (region-beginning)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369 (region-end)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370 (ogonek-read-encoding "From code" 'ogonek-from-encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
371 (ogonek-read-encoding "To code" 'ogonek-to-encoding))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372 (save-excursion
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 (translate-region
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374 start end
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 (ogonek-build-table
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 (ogonek-zip-lists
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 (ogonek-lookup-encoding from-encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 (ogonek-lookup-encoding to-encoding))))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 (defun ogonek-recode-buffer (from-encoding to-encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381 "Call `ogonek-region' on the entire buffer."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382 (interactive (progn (barf-if-buffer-read-only)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 (list
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 (ogonek-read-encoding "From code" 'ogonek-from-encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 (ogonek-read-encoding "To code" 'ogonek-to-encoding))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 (ogonek-recode-region
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 (point-min) (point-max) from-encoding to-encoding))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 ; --------------------------------
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390 ; Recoding with prefix notation
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 ; --------------------------------
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393 (defconst prefix-code '(?A ?C ?E ?L ?N ?O ?S ?X ?Z
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 ?a ?c ?e ?l ?n ?o ?s ?x ?z))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
395
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 (defun ogonek-prefixify-region (start end from-encoding prefix-char)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397 "Replace -- in the region delineated by the current-mark
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398 and the point -- each character from `ogonek-from-encoding'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
399 by two characters: `ogonek-prefix-char' and the corresponding
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
400 character from the `prefix' list. Double the character
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 `ogonek-prefix-char'"
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 (interactive (progn (barf-if-buffer-read-only)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403 (list
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404 (region-beginning)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405 (region-end)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
406 (ogonek-read-encoding "From code" 'ogonek-prefix-from-encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407 (ogonek-read-prefix "Prefix character" 'ogonek-prefix-char))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
408 (let*
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
409 ((from-code (ogonek-lookup-encoding from-encoding))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
410 (to-code prefix-code)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
411 (recoding-pairs ; we add `ogonek-prefix-char' for doubling
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
412 (ogonek-zip-lists
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 (cons prefix-char from-code)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414 (cons prefix-char to-code))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415 (save-excursion
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416 (goto-char start)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
417 (while (< (point) end)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418 (let ((pair (assoc (following-char) recoding-pairs)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 (if (null pair)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420 ; not a Polish character -- skip it
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
421 (forward-char 1)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422 ; Polish character -- replace it by a two characters
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 (delete-char 1)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
424 (insert ogonek-prefix-char)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
425 (insert (cdr pair))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
426 ; the region is now one character longer
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 (setq end (1+ end))))))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429 (defun ogonek-prefixify-buffer (from-encoding prefix-char)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
430 "Call `ogonek-prefixify-region' on the entire buffer."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431 (interactive (progn (barf-if-buffer-read-only)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
432 (list
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
433 (ogonek-read-encoding "From code" 'ogonek-prefix-from-encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 (ogonek-read-prefix "Prefix character" 'ogonek-prefix-char))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 (ogonek-prefixify-region
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436 (point-min) (point-max) from-encoding prefix-char))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
437
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 (defun ogonek-deprefixify-region (start end prefix-char to-encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 "Replace `ogonek-prefix-char' followed by a character from
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 the `prefix' list or another `ogonek-prefix-char' by
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 the corresponding character from `ogonek-from-encoding'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442 or by one `ogonek-prefix-char'."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 (interactive (progn (barf-if-buffer-read-only)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 (list (region-beginning)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445 (region-end)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446 (ogonek-read-prefix
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447 "Prefix character" 'ogonek-prefix-char)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 (ogonek-read-encoding
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 "To code" 'ogonek-prefix-to-encoding))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 (let*
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 ((from-code prefix-code)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 (to-code (ogonek-lookup-encoding to-encoding))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453 (recoding-pairs
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 (ogonek-zip-lists
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455 (cons prefix-char from-code)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 (cons prefix-char to-code))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 (save-excursion
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 (goto-char start)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 (while (< (point) end)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 (forward-char 1)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 (if (or (not (= (preceding-char) prefix-char)) (= (point) end))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462 ; non-prefix character or the end-of-region -- do nothing
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
463 ()
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464 ; now, we can check the next character
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
465 (let ((pair (assoc (following-char) recoding-pairs)))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
466 (if (null pair)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467 ; `following-char' is not a Polish character nor it is
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
468 ; `prefix-char' since the one is among `recoding-pairs'
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
469 (forward-char 1)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
470 ; else prefix followed by a Polish character has been found
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
471 ; replace it by the corresponding Polish character
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
472 (backward-char 1)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473 (delete-char 2)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 (insert (cdr pair))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475 ; the region got shorter by one character
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
476 (setq end (1- end)))))))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 (defun ogonek-deprefixify-buffer (prefix-char to-encoding)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 "Call `ogonek-deprefixify-region' on the entire buffer."
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 (interactive (progn (barf-if-buffer-read-only)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
481 (list
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482 (ogonek-read-prefix "Prefix character" 'ogonek-prefix-char)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 (ogonek-read-encoding "To code" 'ogonek-prefix-to-encoding))))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484 (ogonek-deprefixify-region
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485 (point-min) (point-max) prefix-char to-encoding))
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 (provide 'ogonek)
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
488
85e7518aaf4a Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489 ;;; ogonek.el ends here