comparison lisp/coding.el @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3ecd8885ac67
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of 19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 ;; General Public License for more details. 21 ;; General Public License for more details.
22 22
23 ;; You should have received a copy of the GNU General Public License 23 ;; You should have received a copy of the GNU General Public License
24 ;; along with XEmacs; see the file COPYING. If not, write to the 24 ;; along with XEmacs; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA. 26 ;; Boston, MA 02111-1307, USA.
27 27
28 ;;; Commentary: 28 ;;; Commentary:
29 29
180 180
181 (defun coding-system-base (coding-system) 181 (defun coding-system-base (coding-system)
182 "Return the base coding system of CODING-SYSTEM." 182 "Return the base coding system of CODING-SYSTEM."
183 (if (not (coding-system-eol-type coding-system)) 183 (if (not (coding-system-eol-type coding-system))
184 coding-system 184 coding-system
185 (find-coding-system 185 (find-coding-system
186 (intern 186 (intern
187 (substring 187 (substring
188 (symbol-name (coding-system-name coding-system)) 188 (symbol-name (coding-system-name coding-system))
189 0 189 0
190 (string-match "-unix$\\|-dos$\\|-mac$" 190 (string-match "-unix$\\|-dos$\\|-mac$"
191 (symbol-name (coding-system-name coding-system)))))))) 191 (symbol-name (coding-system-name coding-system))))))))
192 192
195 (make-coding-system 195 (make-coding-system
196 'undecided 'undecided 196 'undecided 'undecided
197 "Automatic conversion." 197 "Automatic conversion."
198 '(mnemonic "Auto")) 198 '(mnemonic "Auto"))
199 199
200 ;; these are so that gnus and friends work when not mule 200 ;;; Make certain variables equivalent to coding-system aliases
201 (or (featurep 'mule) 201 (defun dontusethis-set-value-file-name-coding-system-handler (sym args fun harg handlers)
202 (progn 202 (define-coding-system-alias 'file-name (or (car args) 'binary)))
203 (copy-coding-system 'undecided 'iso-8859-1) 203
204 (copy-coding-system 'undecided 'iso-8859-2))) 204 (dontusethis-set-symbol-value-handler
205 'file-name-coding-system
206 'set-value
207 'dontusethis-set-value-file-name-coding-system-handler)
208
209 (defun dontusethis-set-value-terminal-coding-system-handler (sym args fun harg handlers)
210 (define-coding-system-alias 'terminal (or (car args) 'binary)))
211
212 (dontusethis-set-symbol-value-handler
213 'terminal-coding-system
214 'set-value
215 'dontusethis-set-value-terminal-coding-system-handler)
216
217 (defun dontusethis-set-value-keyboard-coding-system-handler (sym args fun harg handlers)
218 (define-coding-system-alias 'keyboard (or (car args) 'binary)))
219
220 (dontusethis-set-symbol-value-handler
221 'keyboard-coding-system
222 'set-value
223 'dontusethis-set-value-keyboard-coding-system-handler)
224
225 (unless (boundp 'file-name-coding-system)
226 (setq file-name-coding-system nil))
227
228 (when (not (featurep 'mule))
229 ;; these are so that gnus and friends work when not mule
230 (copy-coding-system 'undecided 'iso-8859-1)
231 (copy-coding-system 'undecided 'iso-8859-2)
232
233 (define-coding-system-alias 'ctext 'binary))
234
205 235
206 ;; compatibility for old XEmacsen (don't use it) 236 ;; compatibility for old XEmacsen (don't use it)
207 (copy-coding-system 'undecided 'automatic-conversion) 237 (copy-coding-system 'undecided 'automatic-conversion)
208 238
209 (make-compatible-variable 'enable-multibyte-characters "Unimplemented") 239 (make-compatible-variable 'enable-multibyte-characters "Unimplemented")