;;; iso-cvt.el --- translate ISO 8859-1 from/to various encodings -*- coding: iso-latin-1 -*-
;; This file was formerly called gm-lingo.el.
-;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
-;; 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1998, 2000-2011 Free Software Foundation, Inc.
;; Author: Michael Gschwind <mike@vlsivie.tuwien.ac.at>
;; Keywords: tex, iso, latin, i18n
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This lisp code is a general framework for translating various
"Spanish translation table.")
(defun iso-translate-conventions (from to trans-tab)
- "Use the translation table TRANS-TAB to translate the current buffer."
+ "Translate between FROM and TO using the translation table TRANS-TAB."
(save-excursion
(save-restriction
(narrow-to-region from to)
;;;###autoload
(defun iso-spanish (from to &optional buffer)
"Translate net conventions for Spanish to ISO 8859-1.
-The region between FROM and TO is translated using the table TRANS-TAB.
+Translate the region between FROM and TO using the table
+`iso-spanish-trans-tab'.
Optional arg BUFFER is ignored (for use in `format-alist')."
(interactive "*r")
(iso-translate-conventions from to iso-spanish-trans-tab))
("\\\\3" "ß")
)
"German translation table.
-This table uses an aggressive translation approach and may erroneously
-translate too much.")
+This table uses an aggressive translation approach
+and may erroneously translate too much.")
(defvar iso-conservative-german-trans-tab
'(
("\\([-a-zA-Z\"`]\\)\\\\3" "\\1ß")
)
"German translation table.
-This table uses a conservative translation approach and may translate too
-little.")
+This table uses a conservative translation approach
+and may translate too little.")
(defvar iso-german-trans-tab iso-aggressive-german-trans-tab
"Currently active translation table for German.")
;;;###autoload
(defun iso-german (from to &optional buffer)
"Translate net conventions for German to ISO 8859-1.
-The region between FROM and TO is translated using the table TRANS-TAB.
+Translate the region FROM and TO using the table
+`iso-german-trans-tab'.
Optional arg BUFFER is ignored (for use in `format-alist')."
(interactive "*r")
(iso-translate-conventions from to iso-german-trans-tab))
;;;###autoload
(defun iso-iso2tex (from to &optional buffer)
"Translate ISO 8859-1 characters to TeX sequences.
-The region between FROM and TO is translated using the table TRANS-TAB.
+Translate the region between FROM and TO using the table
+`iso-iso2tex-trans-tab'.
Optional arg BUFFER is ignored (for use in `format-alist')."
(interactive "*r")
(iso-translate-conventions from to iso-iso2tex-trans-tab))
("!`" "¡")
)
"Translation table for translating TeX sequences to ISO 8859-1 characters.
-This table is not exhaustive (and due to TeX's power can never be). It only
-contains commonly used sequences.")
+This table is not exhaustive (and due to TeX's power can never be).
+It only contains commonly used sequences.")
;;;###autoload
(defun iso-tex2iso (from to &optional buffer)
"Translate TeX sequences to ISO 8859-1 characters.
-The region between FROM and TO is translated using the table TRANS-TAB.
+Translate the region between FROM and TO using the table
+`iso-tex2iso-trans-tab'.
Optional arg BUFFER is ignored (for use in `format-alist')."
(interactive "*r")
(iso-translate-conventions from to iso-tex2iso-trans-tab))
("\\\\3" "ß")
)
"Translation table for translating German TeX sequences to ISO 8859-1.
-This table is not exhaustive (and due to TeX's power can never be). It only
-contains commonly used sequences.")
+This table is not exhaustive (and due to TeX's power can never be).
+It only contains commonly used sequences.")
(defvar iso-iso2gtex-trans-tab
'(
;;;###autoload
(defun iso-gtex2iso (from to &optional buffer)
"Translate German TeX sequences to ISO 8859-1 characters.
-The region between FROM and TO is translated using the table TRANS-TAB.
+Translate the region between FROM and TO using the table
+`iso-gtex2iso-trans-tab'.
Optional arg BUFFER is ignored (for use in `format-alist')."
(interactive "*r")
(iso-translate-conventions from to iso-gtex2iso-trans-tab))
;;;###autoload
(defun iso-iso2gtex (from to &optional buffer)
"Translate ISO 8859-1 characters to German TeX sequences.
-The region between FROM and TO is translated using the table TRANS-TAB.
+Translate the region between FROM and TO using the table
+`iso-iso2gtex-trans-tab'.
Optional arg BUFFER is ignored (for use in `format-alist')."
(interactive "*r")
(iso-translate-conventions from to iso-iso2gtex-trans-tab))
("Ö" "Oe")
("ü" "ue")
("Ü" "Ue")
- ("ß" "ss")))
+ ("ß" "ss"))
+ "Translation table for translating ISO 8859-1 characters to Duden sequences.")
;;;###autoload
(defun iso-iso2duden (from to &optional buffer)
- "Translate ISO 8859-1 characters to German TeX sequences.
-The region between FROM and TO is translated using the table TRANS-TAB.
+ "Translate ISO 8859-1 characters to Duden sequences.
+Translate the region between FROM and TO using the table
+`iso-iso2duden-trans-tab'.
Optional arg BUFFER is ignored (for use in `format-alist')."
(interactive "*r")
(iso-translate-conventions from to iso-iso2duden-trans-tab))
;;;###autoload
(defun iso-iso2sgml (from to &optional buffer)
"Translate ISO 8859-1 characters in the region to SGML entities.
-The entities used are from \"ISO 8879:1986//ENTITIES Added Latin 1//EN\".
+Use entities from \"ISO 8879:1986//ENTITIES Added Latin 1//EN\".
Optional arg BUFFER is ignored (for use in `format-alist')."
(interactive "*r")
(iso-translate-conventions from to iso-iso2sgml-trans-tab))
;;;###autoload
(defun iso-sgml2iso (from to &optional buffer)
"Translate SGML entities in the region to ISO 8859-1 characters.
-The entities used are from \"ISO 8879:1986//ENTITIES Added Latin 1//EN\".
+Use entities from \"ISO 8879:1986//ENTITIES Added Latin 1//EN\".
Optional arg BUFFER is ignored (for use in `format-alist')."
(interactive "*r")
(iso-translate-conventions from to iso-sgml2iso-trans-tab))
;;;###autoload
-(defun iso-cvt-read-only ()
+(defun iso-cvt-read-only (&rest ignore)
"Warn that format is read-only."
(interactive)
(error "This format is read-only; specify another format for writing"))
;;;###autoload
-(defun iso-cvt-write-only ()
+(defun iso-cvt-write-only (&rest ignore)
"Warn that format is write-only."
(interactive)
(error "This format is write-only"))
(translate-to-menu-map (make-sparse-keymap "Translate to..."))
(translate-from-menu-map (make-sparse-keymap "Translate from..."))
(menu menu-bar-file-menu))
-
+
(define-key menu [load-as-separator] '("--"))
(define-key menu [load-as] '("Load As..." . iso-cvt-load-as))
(provide 'iso-cvt)
-;; arch-tag: 64ae843f-ed0e-43e1-ba50-ffd581b90840
;;; iso-cvt.el ends here