Convert consecutive FSF copyright years to ranges.
[bpt/emacs.git] / lisp / international / iso-cvt.el
index d7baabb..6ccd1c2 100644 (file)
@@ -1,18 +1,17 @@
 ;;; 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, 1998, 2000, 2003, 2004
-;;           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
@@ -20,9 +19,7 @@
 ;; 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., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 ;; This lisp code is a general framework for translating various
@@ -65,7 +62,7 @@
   "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)
@@ -84,7 +81,8 @@
 ;;;###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))
@@ -101,8 +99,8 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
     ("\\\\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
   '(
@@ -116,8 +114,8 @@ translate too much.")
     ("\\([-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.")
@@ -125,7 +123,8 @@ little.")
 ;;;###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))
@@ -197,7 +196,8 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
 ;;;###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))
@@ -265,10 +265,16 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
     ("\\\\`e" "è")
     ("\\\\'e" "é")
     ("\\\\^e" "ê")
-    ("\\\\\"\\\\i" "ï")
-    ("\\\\`\\\\i" "ì")
-    ("\\\\'\\\\i" "í")
-    ("\\\\^\\\\i" "î")
+    ;; Discard spaces and/or one EOF after macro \i.
+    ;; Converting it back will use braces.
+    ("\\\\\"\\\\i *\n\n" "ï\n\n")
+    ("\\\\\"\\\\i *\n?" "ï")
+    ("\\\\`\\\\i *\n\n" "ì\n\n")
+    ("\\\\`\\\\i *\n?" "ì")
+    ("\\\\'\\\\i *\n\n" "í\n\n")
+    ("\\\\'\\\\i *\n?" "í")
+    ("\\\\^\\\\i *\n\n" "î\n\n")
+    ("\\\\^\\\\i *\n?" "î")
     ("\\\\\"i" "ï")
     ("\\\\`i" "ì")
     ("\\\\'i" "í")
@@ -377,13 +383,14 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
     ("!`" "¡")
     )
   "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))
@@ -571,8 +578,8 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
     ("\\\\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
   '(
@@ -641,7 +648,8 @@ contains commonly used sequences.")
 ;;;###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))
@@ -649,7 +657,8 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
 ;;;###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))
@@ -661,12 +670,14 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
     ("Ö" "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))
@@ -785,6 +796,7 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
     ("&iuml;" "ï")
     ("&eth;" "ð")
     ("&ntilde;" "ñ")
+    ("&nbsp;" " ")
     ("&ograve;" "ò")
     ("&oacute;" "ó")
     ("&ocirc;" "ô")
@@ -802,7 +814,7 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
 ;;;###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))
@@ -810,19 +822,19 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
 ;;;###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"))
@@ -838,7 +850,7 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
        (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))
@@ -891,5 +903,4 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
 
 (provide 'iso-cvt)
 
-;; arch-tag: 64ae843f-ed0e-43e1-ba50-ffd581b90840
 ;;; iso-cvt.el ends here