Make `checkout-model' apply to filesets.
[emacs.git] / lisp / obsolete / swedish.el
blob69823c9fac17d6f446a7a963a7c2e06b52b8e15c
1 ;;; swedish.el --- miscellaneous functions for dealing with Swedish
3 ;; Copyright (C) 1988, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 ;; Free Software Foundation, Inc.
6 ;; Author: Howard Gayle
7 ;; Maintainer: FSF
8 ;; Keywords: i18n
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
27 ;;; Commentary:
29 ;; This file has been obsolete since Emacs 22.1.
31 ;; Fixme: Is this actually used? if so, it should be in language,
32 ;; possibly as a feature property of Swedish, probably defining a
33 ;; `swascii' coding system.
35 ;;; Code:
37 ;; Written by Howard Gayle. See case-table.el for details.
39 ;; See iso-swed.el for a description of the character set.
41 (defvar mail-send-hook)
42 (defvar news-group-hook-alist)
43 (defvar news-inews-hook)
45 (defvar swedish-re
46 "[ \t\n]\\(och\\|att\\|en\\|{r\\|\\[R\\|p}\\|P\\]\\|som\\|det\\|av\\|den\\|f|r\\|F\\\\R\\)[ \t\n.,?!:;'\")}]"
47 "Regular expression for common Swedish words.")
49 (defvar swascii-to-8859-trans
50 (let ((string (make-string 256 ? ))
51 (i 0))
52 (while (< i 256)
53 (aset string i i)
54 (setq i (1+ i)))
55 (aset string ?\[ 196)
56 (aset string ?\] 197)
57 (aset string ?\\ 214)
58 (aset string ?^ 220)
59 (aset string ?\{ 228)
60 (aset string ?\} 229)
61 (aset string ?\` 233)
62 (aset string ?\| 246)
63 (aset string ?~ 252)
64 string)
65 "Trans table from SWASCII to 8859.")
67 ; $ is not converted because it almost always means US
68 ; dollars, not general currency sign. @ is not converted
69 ; because it is more likely to be an at sign in a mail address
70 ; than an E with acute accent.
72 (defun swascii-to-8859-buffer ()
73 "Convert characters in buffer from Swedish/Finnish-ascii to ISO 8859/1.
74 Works even on read-only buffers. `$' and `@' are not converted."
75 (interactive)
76 (let ((buffer-read-only nil))
77 (translate-region (point-min) (point-max) swascii-to-8859-trans)))
79 (defun swascii-to-8859-buffer-maybe ()
80 "Call swascii-to-8859-buffer if the buffer looks like Swedish-ascii.
81 Leaves point just after the word that looks Swedish."
82 (interactive)
83 (let ((case-fold-search t))
84 (if (re-search-forward swedish-re nil t)
85 (swascii-to-8859-buffer))))
87 (setq rmail-show-message-hook 'swascii-to-8859-buffer-maybe)
89 (setq news-group-hook-alist
90 (append '(("^swnet." . swascii-to-8859-buffer-maybe))
91 (bound-and-true-p news-group-hook-alist)))
93 (defvar 8859-to-swascii-trans
94 (let ((string (make-string 256 ? ))
95 (i 0))
96 (while (< i 256)
97 (aset string i i)
98 (setq i (1+ i)))
99 (aset string 164 ?$)
100 (aset string 196 ?\[)
101 (aset string 197 ?\])
102 (aset string 201 ?@)
103 (aset string 214 ?\\)
104 (aset string 220 ?^)
105 (aset string 228 ?\{)
106 (aset string 229 ?\})
107 (aset string 233 ?\`)
108 (aset string 246 ?\|)
109 (aset string 252 ?~)
110 string)
111 "8859 to SWASCII trans table.")
113 (defun 8859-to-swascii-buffer ()
114 "Convert characters in buffer from ISO 8859/1 to Swedish/Finnish-ascii."
115 (interactive "*")
116 (translate-region (point-min) (point-max) 8859-to-swascii-trans))
118 (setq mail-send-hook '8859-to-swascii-buffer)
119 (setq news-inews-hook '8859-to-swascii-buffer)
121 ;; It's not clear what purpose is served by a separate
122 ;; Swedish mode that differs from Text mode only in having
123 ;; a separate abbrev table. Nothing says that the abbrevs you
124 ;; define in Text mode have to be English!
126 ;(defvar swedish-mode-abbrev-table nil
127 ; "Abbrev table used while in swedish mode.")
128 ;(define-abbrev-table 'swedish-mode-abbrev-table ())
130 ;(defun swedish-mode ()
131 ; "Major mode for editing Swedish text intended for humans to
132 ;read. Special commands:\\{text-mode-map}
133 ;Turning on swedish-mode calls the value of the variable
134 ;text-mode-hook, if that value is non-nil."
135 ; (interactive)
136 ; (kill-all-local-variables)
137 ; (use-local-map text-mode-map)
138 ; (setq mode-name "Swedish")
139 ; (setq major-mode 'swedish-mode)
140 ; (setq local-abbrev-table swedish-mode-abbrev-table)
141 ; (set-syntax-table text-mode-syntax-table)
142 ; (run-mode-hooks 'text-mode-hook))
144 ;(defun indented-swedish-mode ()
145 ; "Major mode for editing indented Swedish text intended for
146 ;humans to read.\\{indented-text-mode-map}
147 ;Turning on indented-swedish-mode calls the value of the
148 ;variable text-mode-hook, if that value is non-nil."
149 ; (interactive)
150 ; (kill-all-local-variables)
151 ; (use-local-map text-mode-map)
152 ; (define-abbrev-table 'swedish-mode-abbrev-table ())
153 ; (setq local-abbrev-table swedish-mode-abbrev-table)
154 ; (set-syntax-table text-mode-syntax-table)
155 ; (make-local-variable 'indent-line-function)
156 ; (setq indent-line-function 'indent-relative-maybe)
157 ; (use-local-map indented-text-mode-map)
158 ; (setq mode-name "Indented Swedish")
159 ; (setq major-mode 'indented-swedish-mode)
160 ; (run-mode-hooks 'text-mode-hook))
162 (provide 'swedish)
164 ;; arch-tag: a117019d-acac-4ac4-8eac-0dbd49a41d32
165 ;;; swedish.el ends here