;;; latin1-disp.el --- display tables for other ISO 8859 on Latin-1 terminals -*-coding: iso-2022-7bit;-*-
-;; Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;; Free Software Foundation, Inc.
;; Author: Dave Love <fx@gnu.org>
;; Keywords: i18n
;; 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)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
See option `latin1-display' for the method. The members of the list
must be in `latin1-display-sets'. With no arguments, reset the
display for all of `latin1-display-sets'. See also
-`latin1-display-setup'. As well as iso-8859 characters, this treats
-some characters in the `mule-unicode-...' charsets if you don't have
-a Unicode font with which to display them."
+`latin1-display-setup'."
(if sets
(progn
(mapc #'latin1-display-setup sets)
(unless (char-displayable-p
(make-char 'mule-unicode-0100-24ff 32 33))
- ;; It doesn't look as though we have a Unicode font.
- (map-char-table
- (lambda (c uc)
- (when (and (char-valid-p c)
- (char-valid-p uc)
- (not (aref standard-display-table uc)))
- (aset standard-display-table uc
- (or (aref standard-display-table c)
- (vector c)))))
- ucs-mule-8859-to-mule-unicode)
;; Extra stuff for windows-1252, in particular.
(mapc
(lambda (l)
)))
(setq latin1-display t))
(mapc #'latin1-display-reset latin1-display-sets)
- (aset standard-display-table
- (make-char 'mule-unicode-0100-24ff) nil)
- (aset standard-display-table
- (make-char 'mule-unicode-2500-33ff) nil)
- (aset standard-display-table
- (make-char 'mule-unicode-e000-ffff) nil)
+ (set-char-table-range standard-display-table '(#x0100 #x33FF) nil)
+ (set-char-table-range standard-display-table '(#xE000 #xFFFF) nil)
(setq latin1-display nil)
(redraw-display)))
(if (eq 'default latin1-display-face)
(standard-display-ascii char (format latin1-display-format display))
(aset standard-display-table char
- (vconcat (mapcar (lambda (c)
- (logior c (lsh (face-id latin1-display-face)
- 19)))
+ (vconcat (mapcar (lambda (c) (make-glyph-code c latin1-display-face))
display))))
(aset standard-display-table char
- (if (eq 'default latin1-display-face)
- display
- (logior display (lsh (face-id latin1-display-face) 19))))))
+ (make-glyph-code display latin1-display-face))))
(defun latin1-display-identities (charset)
"Display each character in CHARSET as the corresponding Latin-1 character.
(let ((i 32)
(set (car (remq 'ascii (get-language-info charset 'charset)))))
(while (<= i 127)
- (aset standard-display-table
- (make-char set i)
- (vector (make-char 'latin-iso8859-1 i)))
+ (let ((ch (decode-char set (+ i 128))))
+ (if ch
+ (aset standard-display-table ch
+ (vector (make-char 'latin-iso8859-1 i)))))
(setq i (1+ i)))))
(defun latin1-display-reset (language)
"Set up Latin-1/ASCII display for Unicode characters.
This uses the transliterations of the Lynx browser.
-With argument ARG, turn such display on iff ARG is positive, otherwise
+With argument ARG, turn such display on if ARG is positive, otherwise
turn it off and display Unicode characters literally. The display
-is't changed if the display can render Unicode characters."
+isn't changed if the display can render Unicode characters."
(interactive "p")
(if (> arg 0)
(unless (char-displayable-p