ogonek.el 20 KB

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