mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-19 19:37:58 +00:00
Merged from miles@gnu.org--gnu-2005 (patch 279-280)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-279 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-280 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-335
This commit is contained in:
commit
030cd69ff1
20 changed files with 904 additions and 594 deletions
|
|
@ -1,3 +1,14 @@
|
|||
2005-04-25 Dan Nicolaescu <dann@ics.uci.edu>
|
||||
|
||||
* NEWS: Mention xterm key bindings.
|
||||
|
||||
* e/eterm.ti: Add a comment.
|
||||
* e/eterm: Regenerate.
|
||||
|
||||
2005-04-25 Alex Ott <ott@jet.msk.su>
|
||||
|
||||
* TUTORIAL.ru: Update.
|
||||
|
||||
2005-04-13 Pavel Jan,Am(Bk <Pavel@Janik.cz>
|
||||
|
||||
* TUTORIAL.sk: Updated header.
|
||||
|
|
@ -16,7 +27,7 @@
|
|||
|
||||
2005-04-10 Masatake YAMATO <jet@gyve.org>
|
||||
|
||||
* compilation.txt (symbol): Added gcov-file
|
||||
* compilation.txt (symbol): Added gcov-file
|
||||
gcov-bb-file gcov-never-called-line gcov-called-line .
|
||||
|
||||
2005-04-08 Kenichi Handa <handa@m17n.org>
|
||||
|
|
|
|||
7
etc/NEWS
7
etc/NEWS
|
|
@ -107,6 +107,13 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types.
|
|||
|
||||
* Changes in Emacs 22.1
|
||||
|
||||
** Improved key bindings support when running in an xterm.
|
||||
When emacs is running in an xterm more key bindings are available. The
|
||||
following should work:
|
||||
{C,S,C-S,A}-{right,left,up,down,prior,next,delete,insert,F1-12}.
|
||||
These key bindings work on xterm from X.org 6.8, they might not work on
|
||||
some older versions of xterm, or on some proprietary versions.
|
||||
|
||||
** Improved Thai support. A new minor mode `thai-word-mode' (which is
|
||||
automatically activated if you select Thai as a language
|
||||
environment) changes key bindings of most word-oriented commands to
|
||||
|
|
|
|||
1143
etc/TUTORIAL.ru
1143
etc/TUTORIAL.ru
File diff suppressed because it is too large
Load diff
BIN
etc/e/eterm
BIN
etc/e/eterm
Binary file not shown.
|
|
@ -1,4 +1,4 @@
|
|||
eterm,
|
||||
eterm|Emacs term.el terminal emulator term-protocol-version 0.96,
|
||||
colors#8,
|
||||
cols#80,
|
||||
lines#24,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,35 @@
|
|||
2005-04-25 Dan Nicolaescu <dann@ics.uci.edu>
|
||||
|
||||
* term/xterm.el (function-key-map): Fix strings for
|
||||
{C,S,A,C-S}-f[1-4]. Use substitute-key-definition to bind
|
||||
{C,S,A,C-S}-{f1-f12}.
|
||||
|
||||
2005-04-26 Kenichi Handa <handa@m17n.org>
|
||||
|
||||
* international/mule-cmds.el (select-safe-coding-system): Fix
|
||||
previous change.
|
||||
|
||||
2005-04-26 Lute Kamstra <lute@gnu.org>
|
||||
|
||||
* calc/calc.el (calc-trail-mode): Don't set font-lock-defaults.
|
||||
|
||||
2005-04-25 Jay Belanger <belanger@truman.edu>
|
||||
|
||||
* calc/calc-help.el (calc-view-news): Let-bind inhibit-read-only
|
||||
to t while inserting information; use help-mode.
|
||||
|
||||
2005-04-25 Dan Nicolaescu <dann@ics.uci.edu>
|
||||
|
||||
* term.el (ansi-term-color-vector): Use the xterm colors.
|
||||
(term-raw-map): Don't add mappings for \eO and \e[. Map
|
||||
deletechar.
|
||||
|
||||
2005-04-25 Lute Kamstra <lute@gnu.org>
|
||||
|
||||
* font-core.el (font-lock-defaults): Fix docstring.
|
||||
|
||||
* font-lock.el (font-lock-syntactic-face-function): Fix docstring.
|
||||
|
||||
2005-04-25 Kenichi Handa <handa@m17n.org>
|
||||
|
||||
* international/mule-cmds.el (select-safe-coding-system): Don't
|
||||
|
|
|
|||
|
|
@ -393,12 +393,14 @@ C-w Describe how there is no warranty for Calc."
|
|||
(error "Can't locate Calc sources"))
|
||||
(calc-quit)
|
||||
(switch-to-buffer "*Help*")
|
||||
(erase-buffer)
|
||||
(insert-file-contents (expand-file-name "README" (car path)))
|
||||
(search-forward "Summary of changes")
|
||||
(forward-line -1)
|
||||
(delete-region (point-min) (point))
|
||||
(goto-char (point-min))))
|
||||
(let ((inhibit-read-only t))
|
||||
(erase-buffer)
|
||||
(insert-file-contents (expand-file-name "README" (car path)))
|
||||
(search-forward "Summary of changes")
|
||||
(forward-line -1)
|
||||
(delete-region (point-min) (point))
|
||||
(goto-char (point-min)))
|
||||
(help-mode)))
|
||||
|
||||
(defvar calc-help-long-names '((?b . "binary/business")
|
||||
(?g . "graphics")
|
||||
|
|
|
|||
|
|
@ -1174,8 +1174,6 @@ commands given here will actually operate on the *Calculator* stack."
|
|||
(setq buffer-read-only t)
|
||||
(make-local-variable 'overlay-arrow-position)
|
||||
(make-local-variable 'overlay-arrow-string)
|
||||
(set (make-local-variable 'font-lock-defaults)
|
||||
'(nil t nil nil nil (font-lock-core-only . t)))
|
||||
(when buf
|
||||
(set (make-local-variable 'calc-main-buffer) buf))
|
||||
(when (= (buffer-size) 0)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
"Defaults for Font Lock mode specified by the major mode.
|
||||
Defaults should be of the form:
|
||||
|
||||
(KEYWORDS KEYWORDS-ONLY CASE-FOLD SYNTAX-ALIST SYNTAX-BEGIN ...)
|
||||
(KEYWORDS [KEYWORDS-ONLY [CASE-FOLD [SYNTAX-ALIST [SYNTAX-BEGIN ...]]]])
|
||||
|
||||
KEYWORDS may be a symbol (a variable or function whose value is the keywords to
|
||||
use for fontification) or a list of symbols. If KEYWORDS-ONLY is non-nil,
|
||||
|
|
@ -66,11 +66,10 @@ textual modes (i.e., the mode-dependent function is known to put point and mark
|
|||
around a text block relevant to that mode).
|
||||
|
||||
Other variables include that for syntactic keyword fontification,
|
||||
`font-lock-syntactic-keywords'
|
||||
and those for buffer-specialized fontification functions,
|
||||
`font-lock-fontify-buffer-function', `font-lock-unfontify-buffer-function',
|
||||
`font-lock-fontify-region-function', `font-lock-unfontify-region-function',
|
||||
`font-lock-inhibit-thing-lock' and `font-lock-maximum-size'.")
|
||||
`font-lock-syntactic-keywords' and those for buffer-specialized fontification
|
||||
functions, `font-lock-fontify-buffer-function',
|
||||
`font-lock-unfontify-buffer-function', `font-lock-fontify-region-function',
|
||||
`font-lock-unfontify-region-function', and `font-lock-inhibit-thing-lock'.")
|
||||
(make-variable-buffer-local 'font-lock-defaults)
|
||||
|
||||
(defvar font-lock-defaults-alist nil
|
||||
|
|
|
|||
|
|
@ -496,7 +496,7 @@ sometimes be slightly incorrect.")
|
|||
"Function to determine which face to use when fontifying syntactically.
|
||||
The function is called with a single parameter (the state as returned by
|
||||
`parse-partial-sexp' at the beginning of the region to highlight) and
|
||||
should return a face.")
|
||||
should return a face. This is normally set via `font-lock-defaults'.")
|
||||
|
||||
(defvar font-lock-syntactic-keywords nil
|
||||
"A list of the syntactic keywords to highlight.
|
||||
|
|
@ -646,6 +646,7 @@ Major/minor modes can set this variable if they know which option applies.")
|
|||
;;;###autoload
|
||||
(defun font-lock-add-keywords (mode keywords &optional append)
|
||||
"Add highlighting KEYWORDS for MODE.
|
||||
|
||||
MODE should be a symbol, the major mode command name, such as `c-mode'
|
||||
or nil. If nil, highlighting keywords are added for the current buffer.
|
||||
KEYWORDS should be a list; see the variable `font-lock-keywords'.
|
||||
|
|
|
|||
|
|
@ -929,7 +929,8 @@ and TO is ignored."
|
|||
;; by using `find-file-literally'.
|
||||
(unless (or (stringp from)
|
||||
find-file-literally
|
||||
(memq (coding-system-type coding-system) '(0 5)))
|
||||
(and coding-system
|
||||
(memq (coding-system-type coding-system) '(0 5))))
|
||||
(let ((auto-cs (save-excursion
|
||||
(save-restriction
|
||||
(widen)
|
||||
|
|
|
|||
10
lisp/term.el
10
lisp/term.el
|
|
@ -711,9 +711,10 @@ Buffer local variable.")
|
|||
:group 'term
|
||||
:type 'string)
|
||||
|
||||
;;; Use the same colors that xterm uses, see `xterm-standard-colors'.
|
||||
(defvar ansi-term-color-vector
|
||||
[unspecified "black" "red" "green" "yellow" "blue"
|
||||
"magenta" "cyan" "white"])
|
||||
[unspecified "black" "red3" "green3" "yellow3" "blue2"
|
||||
"magenta3" "cyan3" "white"])
|
||||
|
||||
;;; Inspiration came from comint.el -mm
|
||||
(defvar term-buffer-maximum-size 2048
|
||||
|
|
@ -886,7 +887,9 @@ is buffer-local.")
|
|||
(i 0))
|
||||
(while (< i 128)
|
||||
(define-key map (make-string 1 i) 'term-send-raw)
|
||||
(define-key esc-map (make-string 1 i) 'term-send-raw-meta)
|
||||
;; Avoid O and [. They are used in escape sequences for various keys.
|
||||
(unless (or (eq i ?O) (eq i 91))
|
||||
(define-key esc-map (make-string 1 i) 'term-send-raw-meta))
|
||||
(setq i (1+ i)))
|
||||
(dolist (elm (generic-character-list))
|
||||
(define-key map (vector elm) 'term-send-raw))
|
||||
|
|
@ -909,6 +912,7 @@ is buffer-local.")
|
|||
(define-key term-raw-map [right] 'term-send-right)
|
||||
(define-key term-raw-map [left] 'term-send-left)
|
||||
(define-key term-raw-map [delete] 'term-send-del)
|
||||
(define-key term-raw-map [deletechar] 'term-send-del)
|
||||
(define-key term-raw-map [backspace] 'term-send-backspace)
|
||||
(define-key term-raw-map [home] 'term-send-home)
|
||||
(define-key term-raw-map [end] 'term-send-end)
|
||||
|
|
|
|||
|
|
@ -53,10 +53,15 @@
|
|||
(define-key map "\e[24~" [f12])
|
||||
(define-key map "\e[29~" [print])
|
||||
|
||||
(define-key map "\e[11;2~" [S-f1])
|
||||
(define-key map "\e[12;2~" [S-f2])
|
||||
(define-key map "\e[13;2~" [S-f3])
|
||||
(define-key map "\e[14;2~" [S-f4])
|
||||
(define-key map "\eOP" [f1])
|
||||
(define-key map "\eOQ" [f2])
|
||||
(define-key map "\eOR" [f3])
|
||||
(define-key map "\eOS" [f4])
|
||||
|
||||
(define-key map "\eO2P" [S-f1])
|
||||
(define-key map "\eO2Q" [S-f2])
|
||||
(define-key map "\eO2R" [S-f3])
|
||||
(define-key map "\eO2S" [S-f4])
|
||||
(define-key map "\e[15;2~" [S-f5])
|
||||
(define-key map "\e[17;2~" [S-f6])
|
||||
(define-key map "\e[18;2~" [S-f7])
|
||||
|
|
@ -66,10 +71,10 @@
|
|||
(define-key map "\e[23;2~" [S-f11])
|
||||
(define-key map "\e[24;2~" [S-f12])
|
||||
|
||||
(define-key map "\e[11;5~" [C-f1])
|
||||
(define-key map "\e[12;5~" [C-f2])
|
||||
(define-key map "\e[13;5~" [C-f3])
|
||||
(define-key map "\e[14;5~" [C-f4])
|
||||
(define-key map "\eO5P" [C-f1])
|
||||
(define-key map "\eO5Q" [C-f2])
|
||||
(define-key map "\eO5R" [C-f3])
|
||||
(define-key map "\eO5S" [C-f4])
|
||||
(define-key map "\e[15;5~" [C-f5])
|
||||
(define-key map "\e[17;5~" [C-f6])
|
||||
(define-key map "\e[18;5~" [C-f7])
|
||||
|
|
@ -79,10 +84,10 @@
|
|||
(define-key map "\e[23;5~" [C-f11])
|
||||
(define-key map "\e[24;5~" [C-f12])
|
||||
|
||||
(define-key map "\e[11;6~" [C-S-f1])
|
||||
(define-key map "\e[12;6~" [C-S-f2])
|
||||
(define-key map "\e[13;6~" [C-S-f3])
|
||||
(define-key map "\e[14;6~" [C-S-f4])
|
||||
(define-key map "\eO6P" [C-S-f1])
|
||||
(define-key map "\eO6Q" [C-S-f2])
|
||||
(define-key map "\eO6R" [C-S-f3])
|
||||
(define-key map "\eO6S" [C-S-f4])
|
||||
(define-key map "\e[15;6~" [C-S-f5])
|
||||
(define-key map "\e[17;6~" [C-S-f6])
|
||||
(define-key map "\e[18;6~" [C-S-f7])
|
||||
|
|
@ -92,10 +97,10 @@
|
|||
(define-key map "\e[23;6~" [C-S-f11])
|
||||
(define-key map "\e[24;6~" [C-S-f12])
|
||||
|
||||
(define-key map "\e[11;3~" [A-f1])
|
||||
(define-key map "\e[12;3~" [A-f2])
|
||||
(define-key map "\e[13;3~" [A-f3])
|
||||
(define-key map "\e[14;3~" [A-f4])
|
||||
(define-key map "\eO3P" [A-f1])
|
||||
(define-key map "\eO3Q" [A-f2])
|
||||
(define-key map "\eO3R" [A-f3])
|
||||
(define-key map "\eO3S" [A-f4])
|
||||
(define-key map "\e[15;3~" [A-f5])
|
||||
(define-key map "\e[17;3~" [A-f6])
|
||||
(define-key map "\e[18;3~" [A-f7])
|
||||
|
|
@ -180,6 +185,66 @@
|
|||
(set-keymap-parent map (keymap-parent function-key-map))
|
||||
(set-keymap-parent function-key-map map))
|
||||
|
||||
;;; The terminal intialization C code file might have initialized
|
||||
;;; function keys F13->F60 from the termcap/terminfo information. On
|
||||
;;; a PC-style keyboard these keys correspond to
|
||||
;;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The
|
||||
;;; code here subsitutes the corresponding defintions in
|
||||
;;; function-key-map. This substitution is needed because if a key
|
||||
;;; definition if found in function-key-map, there are no further
|
||||
;;; lookups in other keymaps.
|
||||
(substitute-key-definition [f13] [S-f1] function-key-map)
|
||||
(substitute-key-definition [f14] [S-f2] function-key-map)
|
||||
(substitute-key-definition [f15] [S-f3] function-key-map)
|
||||
(substitute-key-definition [f16] [S-f4] function-key-map)
|
||||
(substitute-key-definition [f17] [S-f5] function-key-map)
|
||||
(substitute-key-definition [f18] [S-f6] function-key-map)
|
||||
(substitute-key-definition [f19] [S-f7] function-key-map)
|
||||
(substitute-key-definition [f20] [S-f8] function-key-map)
|
||||
(substitute-key-definition [f21] [S-f9] function-key-map)
|
||||
(substitute-key-definition [f22] [S-f10] function-key-map)
|
||||
(substitute-key-definition [f23] [S-f11] function-key-map)
|
||||
(substitute-key-definition [f24] [S-f12] function-key-map)
|
||||
|
||||
(substitute-key-definition [f25] [C-f1] function-key-map)
|
||||
(substitute-key-definition [f26] [C-f2] function-key-map)
|
||||
(substitute-key-definition [f27] [C-f3] function-key-map)
|
||||
(substitute-key-definition [f28] [C-f4] function-key-map)
|
||||
(substitute-key-definition [f29] [C-f5] function-key-map)
|
||||
(substitute-key-definition [f30] [C-f6] function-key-map)
|
||||
(substitute-key-definition [f31] [C-f7] function-key-map)
|
||||
(substitute-key-definition [f32] [C-f8] function-key-map)
|
||||
(substitute-key-definition [f33] [C-f9] function-key-map)
|
||||
(substitute-key-definition [f34] [C-f10] function-key-map)
|
||||
(substitute-key-definition [f35] [C-f11] function-key-map)
|
||||
(substitute-key-definition [f36] [C-f12] function-key-map)
|
||||
|
||||
(substitute-key-definition [f37] [C-S-f1] function-key-map)
|
||||
(substitute-key-definition [f38] [C-S-f2] function-key-map)
|
||||
(substitute-key-definition [f39] [C-S-f3] function-key-map)
|
||||
(substitute-key-definition [f40] [C-S-f4] function-key-map)
|
||||
(substitute-key-definition [f41] [C-S-f5] function-key-map)
|
||||
(substitute-key-definition [f42] [C-S-f6] function-key-map)
|
||||
(substitute-key-definition [f43] [C-S-f7] function-key-map)
|
||||
(substitute-key-definition [f44] [C-S-f8] function-key-map)
|
||||
(substitute-key-definition [f45] [C-S-f9] function-key-map)
|
||||
(substitute-key-definition [f46] [C-S-f10] function-key-map)
|
||||
(substitute-key-definition [f47] [C-S-f11] function-key-map)
|
||||
(substitute-key-definition [f48] [C-S-f12] function-key-map)
|
||||
|
||||
(substitute-key-definition [f49] [A-f1] function-key-map)
|
||||
(substitute-key-definition [f50] [A-f2] function-key-map)
|
||||
(substitute-key-definition [f51] [A-f3] function-key-map)
|
||||
(substitute-key-definition [f52] [A-f4] function-key-map)
|
||||
(substitute-key-definition [f53] [A-f5] function-key-map)
|
||||
(substitute-key-definition [f54] [A-f6] function-key-map)
|
||||
(substitute-key-definition [f55] [A-f7] function-key-map)
|
||||
(substitute-key-definition [f56] [A-f8] function-key-map)
|
||||
(substitute-key-definition [f57] [A-f9] function-key-map)
|
||||
(substitute-key-definition [f58] [A-f10] function-key-map)
|
||||
(substitute-key-definition [f59] [A-f11] function-key-map)
|
||||
(substitute-key-definition [f60] [A-f12] function-key-map)
|
||||
|
||||
;; Set up colors, for those versions of xterm that support it.
|
||||
(defvar xterm-standard-colors
|
||||
;; The names in the comments taken from XTerm-col.ad in the xterm
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
2005-04-25 Luc Teirlinck <teirllm@auburn.edu>
|
||||
|
||||
* hooks.texi (Standard Hooks): Most minor modes have mode hooks too.
|
||||
|
||||
2005-04-24 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* syntax.texi (Syntax Table Internals): Elaborate documentation of
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ to put a new function on such a hook is to call @code{add-hook}.
|
|||
Every major mode defines a mode hook named
|
||||
@samp{@var{modename}-mode-hook}. The major mode command runs this
|
||||
normal hook with @code{run-mode-hooks} as the very last thing it does.
|
||||
@xref{Mode Hooks}. Mode hooks are omitted in the list below.
|
||||
@xref{Mode Hooks}. Most minor modes have mode hooks too. Mode hooks
|
||||
are omitted in the list below.
|
||||
|
||||
The variables whose names end in @samp{-hooks} or @samp{-functions} are
|
||||
usually @dfn{abnormal hooks}; their values are lists of functions, but
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
2005-04-25 Luc Teirlinck <teirllm@auburn.edu>
|
||||
|
||||
* frames.texi (Tooltips): Tooltip mode is enabled by default.
|
||||
Delete redundant reference to tooltip Custom group. It is
|
||||
referred too again in the next paragraph.
|
||||
|
||||
2005-04-24 Richard M. Stallman <rms@gnu.org>
|
||||
|
||||
* ack.texi: Delete info about lazy-lock.el and fast-lock.el.
|
||||
|
|
|
|||
|
|
@ -973,10 +973,9 @@ sometimes known as @dfn{balloon help}.) Help text may be available for
|
|||
menu items too.
|
||||
|
||||
@findex tooltip-mode
|
||||
To use tooltips, enable Tooltip mode with the command @kbd{M-x
|
||||
tooltip-mode}. The customization group @code{tooltip} controls
|
||||
various aspects of how tooltips work. When Tooltip mode is disabled,
|
||||
the help text is displayed in the echo area instead.
|
||||
You can toggle Tooltip mode with the command @kbd{M-x tooltip-mode}.
|
||||
When Tooltip mode is disabled, the help text is displayed in the echo
|
||||
area instead.
|
||||
|
||||
@vindex tooltip-delay
|
||||
The variables @code{tooltip-delay} specifies how long Emacs should
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
2005-04-26 Kenichi Handa <handa@m17n.org>
|
||||
|
||||
* fns.c (char_table_range): New function.
|
||||
(Fchar_table_range): Signal an error if characters in the range
|
||||
have inconsistent values. Don't check the parent.
|
||||
|
||||
2005-04-25 Kenichi Handa <handa@m17n.org>
|
||||
|
||||
* fontset.c (fontset_set): Fix previous change.
|
||||
|
||||
2005-04-24 Richard M. Stallman <rms@gnu.org>
|
||||
|
||||
* indent.c (Fvertical_motion): Bind fontification-functions to nil.
|
||||
|
|
|
|||
129
src/fns.c
129
src/fns.c
|
|
@ -2508,50 +2508,143 @@ DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot,
|
|||
return XCHAR_TABLE (char_table)->extras[XINT (n)] = value;
|
||||
}
|
||||
|
||||
static Lisp_Object
|
||||
char_table_range (table, from, to, defalt)
|
||||
Lisp_Object table;
|
||||
int from, to;
|
||||
Lisp_Object defalt;
|
||||
{
|
||||
Lisp_Object val;
|
||||
|
||||
if (! NILP (XCHAR_TABLE (table)->defalt))
|
||||
defalt = XCHAR_TABLE (table)->defalt;
|
||||
val = XCHAR_TABLE (table)->contents[from];
|
||||
if (SUB_CHAR_TABLE_P (val))
|
||||
val = char_table_range (val, 32, 127, defalt);
|
||||
else if (NILP (val))
|
||||
val = defalt;
|
||||
for (from++; from <= to; from++)
|
||||
{
|
||||
Lisp_Object this_val;
|
||||
|
||||
this_val = XCHAR_TABLE (table)->contents[from];
|
||||
if (SUB_CHAR_TABLE_P (this_val))
|
||||
this_val = char_table_range (this_val, 32, 127, defalt);
|
||||
else if (NILP (this_val))
|
||||
this_val = defalt;
|
||||
if (! EQ (val, this_val))
|
||||
error ("Characters in the range have inconsistent values");
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
DEFUN ("char-table-range", Fchar_table_range, Schar_table_range,
|
||||
2, 2, 0,
|
||||
doc: /* Return the value in CHAR-TABLE for a range of characters RANGE.
|
||||
RANGE should be nil (for the default value)
|
||||
a vector which identifies a character set or a row of a character set,
|
||||
a character set name, or a character code. */)
|
||||
a character set name, or a character code.
|
||||
If the characters in the specified range have different values,
|
||||
an error is signalled.
|
||||
|
||||
Note that this function doesn't check the parent of CHAR_TABLE. */)
|
||||
(char_table, range)
|
||||
Lisp_Object char_table, range;
|
||||
{
|
||||
int charset_id, c1 = 0, c2 = 0;
|
||||
int size, i;
|
||||
Lisp_Object ch, val, current_default;
|
||||
|
||||
CHECK_CHAR_TABLE (char_table);
|
||||
|
||||
if (EQ (range, Qnil))
|
||||
return XCHAR_TABLE (char_table)->defalt;
|
||||
else if (INTEGERP (range))
|
||||
return Faref (char_table, range);
|
||||
if (INTEGERP (range))
|
||||
{
|
||||
int c = XINT (range);
|
||||
if (! CHAR_VALID_P (c, 0))
|
||||
error ("Invalid character code: %d", c);
|
||||
ch = range;
|
||||
SPLIT_CHAR (c, charset_id, c1, c2);
|
||||
}
|
||||
else if (SYMBOLP (range))
|
||||
{
|
||||
Lisp_Object charset_info;
|
||||
|
||||
charset_info = Fget (range, Qcharset);
|
||||
CHECK_VECTOR (charset_info);
|
||||
|
||||
return Faref (char_table,
|
||||
make_number (XINT (XVECTOR (charset_info)->contents[0])
|
||||
+ 128));
|
||||
charset_id = XINT (XVECTOR (charset_info)->contents[0]);
|
||||
ch = Fmake_char_internal (make_number (charset_id),
|
||||
make_number (0), make_number (0));
|
||||
}
|
||||
else if (VECTORP (range))
|
||||
{
|
||||
if (XVECTOR (range)->size == 1)
|
||||
return Faref (char_table,
|
||||
make_number (XINT (XVECTOR (range)->contents[0]) + 128));
|
||||
else
|
||||
size = ASIZE (range);
|
||||
if (size == 0)
|
||||
args_out_of_range (range, 0);
|
||||
CHECK_NUMBER (AREF (range, 0));
|
||||
charset_id = XINT (AREF (range, 0));
|
||||
if (size > 1)
|
||||
{
|
||||
int size = XVECTOR (range)->size;
|
||||
Lisp_Object *val = XVECTOR (range)->contents;
|
||||
Lisp_Object ch = Fmake_char_internal (size <= 0 ? Qnil : val[0],
|
||||
size <= 1 ? Qnil : val[1],
|
||||
size <= 2 ? Qnil : val[2]);
|
||||
return Faref (char_table, ch);
|
||||
CHECK_NUMBER (AREF (range, 1));
|
||||
c1 = XINT (AREF (range, 1));
|
||||
if (size > 2)
|
||||
{
|
||||
CHECK_NUMBER (AREF (range, 2));
|
||||
c2 = XINT (AREF (range, 2));
|
||||
}
|
||||
}
|
||||
|
||||
/* This checks if charset_id, c0, and c1 are all valid or not. */
|
||||
ch = Fmake_char_internal (make_number (charset_id),
|
||||
make_number (c1), make_number (c2));
|
||||
}
|
||||
else
|
||||
error ("Invalid RANGE argument to `char-table-range'");
|
||||
return Qt;
|
||||
|
||||
if (c1 > 0 && (CHARSET_DIMENSION (charset_id) == 1 || c2 > 0))
|
||||
{
|
||||
/* Fully specified character. */
|
||||
Lisp_Object parent = XCHAR_TABLE (char_table)->parent;
|
||||
|
||||
XCHAR_TABLE (char_table)->parent = Qnil;
|
||||
val = Faref (char_table, ch);
|
||||
XCHAR_TABLE (char_table)->parent = parent;
|
||||
return val;
|
||||
}
|
||||
|
||||
current_default = XCHAR_TABLE (char_table)->defalt;
|
||||
if (charset_id == CHARSET_ASCII
|
||||
|| charset_id == CHARSET_8_BIT_CONTROL
|
||||
|| charset_id == CHARSET_8_BIT_GRAPHIC)
|
||||
{
|
||||
int from, to, defalt;
|
||||
|
||||
if (charset_id == CHARSET_ASCII)
|
||||
from = 0, to = 127, defalt = CHAR_TABLE_DEFAULT_SLOT_ASCII;
|
||||
else if (charset_id == CHARSET_8_BIT_CONTROL)
|
||||
from = 128, to = 159, defalt = CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL;
|
||||
else
|
||||
from = 160, to = 255, defalt = CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC;
|
||||
if (! NILP (XCHAR_TABLE (char_table)->contents[defalt]))
|
||||
current_default = XCHAR_TABLE (char_table)->contents[defalt];
|
||||
return char_table_range (char_table, from, to, current_default);
|
||||
}
|
||||
|
||||
val = XCHAR_TABLE (char_table)->contents[128 + charset_id];
|
||||
if (! SUB_CHAR_TABLE_P (val))
|
||||
return (NILP (val) ? current_default : val);
|
||||
if (! NILP (XCHAR_TABLE (val)->defalt))
|
||||
current_default = XCHAR_TABLE (val)->defalt;
|
||||
if (c1 == 0)
|
||||
return char_table_range (val, 32, 127, current_default);
|
||||
val = XCHAR_TABLE (val)->contents[c1];
|
||||
if (! SUB_CHAR_TABLE_P (val))
|
||||
return (NILP (val) ? current_default : val);
|
||||
if (! NILP (XCHAR_TABLE (val)->defalt))
|
||||
current_default = XCHAR_TABLE (val)->defalt;
|
||||
return char_table_range (val, 32, 127, current_default);
|
||||
}
|
||||
|
||||
DEFUN ("set-char-table-range", Fset_char_table_range, Sset_char_table_range,
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ fontset_set (fontset, c, newelt)
|
|||
if (!SUB_CHAR_TABLE_P (*elt))
|
||||
{
|
||||
Lisp_Object val = *elt;
|
||||
*elt = make_sub_char_table (val);
|
||||
*elt = make_sub_char_table (Qnil);
|
||||
XCHAR_TABLE (*elt)->defalt = val;
|
||||
}
|
||||
elt = &XCHAR_TABLE (*elt)->contents[code[i]];
|
||||
|
|
|
|||
Loading…
Reference in a new issue