annotate src/cmds.c @ 510:5bdbc721d46a

[xemacs-hg @ 2001-05-06 08:33:35 by ben] implement printing the selection when it's selected. force redisplay when set-charset-ccl-program called. if bytecomp or byte-optimize need recompiling, then load the .el version of them first, recompile them, and reload the .elc versions to recompile everything else (so we won't be waiting until the cows come home).
author ben
date Sun, 06 May 2001 08:33:41 +0000
parents 0784d089fdc9
children 183866b06e0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* Simple built-in editing commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1985, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 /* Synched up with: Mule 2.0, FSF 19.30. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 #include "commands.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 #include "buffer.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #include "syntax.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 #include "insdel.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 Lisp_Object Qkill_forward_chars;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 Lisp_Object Qself_insert_command;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 Lisp_Object Qno_self_insert;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 Lisp_Object Vblink_paren_function;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 /* A possible value for a buffer's overwrite-mode variable. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 Lisp_Object Qoverwrite_mode_binary;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 /* Non-nil means put this face on the next self-inserting character. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 Lisp_Object Vself_insert_face;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 /* This is the command that set up Vself_insert_face. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 Lisp_Object Vself_insert_face_command;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
44
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
45 /* A char-table for characters which may invoke auto-filling. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
46 Lisp_Object Vauto_fill_chars;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 DEFUN ("forward-char", Fforward_char, 0, 2, "_p", /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
49 Move point right COUNT characters (left if COUNT is negative).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 On reaching end of buffer, stop and signal error.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
53
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
54 The characters that are moved over may be added to the current selection
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
55 \(i.e. active region) if the Shift key is held down, a motion key is used
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
56 to invoke this command, and `shifted-motion-keys-select-region' is t; see
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
57 the documentation for this variable for more details.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
59 (count, buffer))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 struct buffer *buf = decode_buffer (buffer, 1);
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
62 EMACS_INT n;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
64 if (NILP (count))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
65 n = 1;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
68 CHECK_INT (count);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
69 n = XINT (count);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
72 /* This used to just set point to point + XINT (count), and then check
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 to see if it was within boundaries. But now that SET_PT can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 potentially do a lot of stuff (calling entering and exiting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 hooks, etcetera), that's not a good approach. So we validate the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 proposed position, then set point. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
78 Bufpos new_point = BUF_PT (buf) + n;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 if (new_point < BUF_BEGV (buf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 BUF_SET_PT (buf, BUF_BEGV (buf));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 Fsignal (Qbeginning_of_buffer, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 if (new_point > BUF_ZV (buf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 BUF_SET_PT (buf, BUF_ZV (buf));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 Fsignal (Qend_of_buffer, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 BUF_SET_PT (buf, new_point);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 DEFUN ("backward-char", Fbackward_char, 0, 2, "_p", /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
100 Move point left COUNT characters (right if COUNT is negative).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
103
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
104 The characters that are moved over may be added to the current selection
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
105 \(i.e. active region) if the Shift key is held down, a motion key is used
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
106 to invoke this command, and `shifted-motion-keys-select-region' is t; see
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
107 the documentation for this variable for more details.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
109 (count, buffer))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
111 if (NILP (count))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
112 count = make_int (-1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
115 CHECK_INT (count);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
116 count = make_int (- XINT (count));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 }
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
118 return Fforward_char (count, buffer);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 DEFUN ("forward-line", Fforward_line, 0, 2, "_p", /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
122 Move COUNT lines forward (backward if COUNT is negative).
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
123 Precisely, if point is on line I, move to the start of line I + COUNT.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 If there isn't room, go as far as possible (no error).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 Returns the count of lines left to move. If moving forward,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
126 that is COUNT - number of lines moved; if backward, COUNT + number moved.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
127 With positive COUNT, a non-empty line at the end counts as one line
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 successfully moved (for the return value).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 If BUFFER is nil, the current buffer is assumed.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
130
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
131 The characters that are moved over may be added to the current selection
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
132 \(i.e. active region) if the Shift key is held down, a motion key is used
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
133 to invoke this command, and `shifted-motion-keys-select-region' is t; see
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
134 the documentation for this variable for more details.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
136 (count, buffer))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 struct buffer *buf = decode_buffer (buffer, 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 Bufpos pos2 = BUF_PT (buf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 Bufpos pos;
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
141 EMACS_INT n, shortage, negp;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
143 if (NILP (count))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
144 n = 1;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
147 CHECK_INT (count);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
148 n = XINT (count);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
151 negp = n <= 0;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
152 pos = scan_buffer (buf, '\n', pos2, 0, n - negp, &shortage, 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 if (shortage > 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 && (negp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 || (BUF_ZV (buf) > BUF_BEGV (buf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 && pos != pos2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 && BUF_FETCH_CHAR (buf, pos - 1) != '\n')))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 shortage--;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 BUF_SET_PT (buf, pos);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 return make_int (negp ? - shortage : shortage);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 DEFUN ("point-at-bol", Fpoint_at_bol, 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 Return the character position of the first character on the current line.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
165 With argument COUNT not nil or 1, move forward COUNT - 1 lines first.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 If scan reaches end of buffer, return that position.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 This function does not move point.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
169 (count, buffer))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 struct buffer *b = decode_buffer (buffer, 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 REGISTER int orig, end;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 XSETBUFFER (buffer, b);
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
175 if (NILP (count))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
176 count = make_int (0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
179 CHECK_INT (count);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
180 count = make_int (XINT (count) - 1);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 orig = BUF_PT (b);
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
184 Fforward_line (count, buffer);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 end = BUF_PT (b);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 BUF_SET_PT (b, orig);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 return make_int (end);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 DEFUN ("beginning-of-line", Fbeginning_of_line, 0, 2, "_p", /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 Move point to beginning of current line.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
193 With argument COUNT not nil or 1, move forward COUNT - 1 lines first.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 If scan reaches end of buffer, stop there without error.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 If BUFFER is nil, the current buffer is assumed.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
196
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
197 The characters that are moved over may be added to the current selection
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
198 \(i.e. active region) if the Shift key is held down, a motion key is used
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
199 to invoke this command, and `shifted-motion-keys-select-region' is t; see
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
200 the documentation for this variable for more details.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
202 (count, buffer))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 struct buffer *b = decode_buffer (buffer, 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
206 BUF_SET_PT (b, XINT (Fpoint_at_bol (count, buffer)));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 DEFUN ("point-at-eol", Fpoint_at_eol, 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 Return the character position of the last character on the current line.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
212 With argument COUNT not nil or 1, move forward COUNT - 1 lines first.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 If scan reaches end of buffer, return that position.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 This function does not move point.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
216 (count, buffer))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 struct buffer *buf = decode_buffer (buffer, 1);
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
219 EMACS_INT n;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
221 if (NILP (count))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
222 n = 1;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
225 CHECK_INT (count);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
226 n = XINT (count);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 return make_int (find_before_next_newline (buf, BUF_PT (buf), 0,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
230 n - (n <= 0)));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 DEFUN ("end-of-line", Fend_of_line, 0, 2, "_p", /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 Move point to end of current line.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
235 With argument COUNT not nil or 1, move forward COUNT - 1 lines first.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 If scan reaches end of buffer, stop there without error.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 If BUFFER is nil, the current buffer is assumed.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
238
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
239 The characters that are moved over may be added to the current selection
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
240 \(i.e. active region) if the Shift key is held down, a motion key is used
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
241 to invoke this command, and `shifted-motion-keys-select-region' is t; see
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
242 the documentation for this variable for more details.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
244 (count, buffer))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 struct buffer *b = decode_buffer (buffer, 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
248 BUF_SET_PT (b, XINT (Fpoint_at_eol (count, buffer)));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
252 DEFUN ("delete-char", Fdelete_char, 0, 2, "*p\nP", /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
253 Delete the following COUNT characters (previous, with negative COUNT).
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
254 Optional second arg KILLP non-nil means kill instead (save in kill ring).
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
255 Interactively, COUNT is the prefix arg, and KILLP is set if
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
256 COUNT was explicitly specified.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
258 (count, killp))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 /* This function can GC */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 Bufpos pos;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 struct buffer *buf = current_buffer;
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
263 EMACS_INT n;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
265 if (NILP (count))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
266 n = 1;
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
267 else
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
268 {
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
269 CHECK_INT (count);
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
270 n = XINT (count);
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
271 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
273 pos = BUF_PT (buf) + n;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
274 if (NILP (killp))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
276 if (n < 0)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 if (pos < BUF_BEGV (buf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 signal_error (Qbeginning_of_buffer, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 buffer_delete_range (buf, pos, BUF_PT (buf), 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 if (pos > BUF_ZV (buf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 signal_error (Qend_of_buffer, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 buffer_delete_range (buf, BUF_PT (buf), pos, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
293 call1 (Qkill_forward_chars, count);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
298 DEFUN ("delete-backward-char", Fdelete_backward_char, 0, 2, "*p\nP", /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
299 Delete the previous COUNT characters (following, with negative COUNT).
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
300 Optional second arg KILLP non-nil means kill instead (save in kill ring).
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
301 Interactively, COUNT is the prefix arg, and KILLP is set if
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
302 COUNT was explicitly specified.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
304 (count, killp))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 /* This function can GC */
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
307 EMACS_INT n;
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
308
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
309 if (NILP (count))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
310 n = 1;
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
311 else
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
312 {
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
313 CHECK_INT (count);
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
314 n = XINT (count);
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
315 }
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
316
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
317 return Fdelete_char (make_int (- n), killp);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 static void internal_self_insert (Emchar ch, int noautofill);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 DEFUN ("self-insert-command", Fself_insert_command, 1, 1, "*p", /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 Insert the character you type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 Whichever character you type to run this command is inserted.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
325 If a prefix arg COUNT is specified, the character is inserted COUNT times.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
327 (count))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 /* This function can GC */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 Emchar ch;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 Lisp_Object c;
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
332 EMACS_INT n;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
334 CHECK_NATNUM (count);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
335 n = XINT (count);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 if (CHAR_OR_CHAR_INTP (Vlast_command_char))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 c = Vlast_command_char;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 c = Fevent_to_character (Vlast_command_event, Qnil, Qnil, Qt);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 if (NILP (c))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 signal_simple_error ("Last typed character has no ASCII equivalent",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 Fcopy_event (Vlast_command_event, Qnil));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 CHECK_CHAR_COERCE_INT (c);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 ch = XCHAR (c);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
350 while (n--)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
351 internal_self_insert (ch, (n != 0));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 /* Insert character C1. If NOAUTOFILL is nonzero, don't do autofill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 even if it is enabled.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 FSF:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 If this insertion is suitable for direct output (completely simple),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 return 0. A value of 1 indicates this *might* not have been simple.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 A value of 2 means this did things that call for an undo boundary. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 internal_self_insert (Emchar c1, int noautofill)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 /* This function can GC */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 /* int hairy = 0; -- unused */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 REGISTER enum syntaxcode synt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 REGISTER Emchar c2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 Lisp_Object overwrite;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
373 Lisp_Char_Table *syntax_table;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 struct buffer *buf = current_buffer;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 int tab_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 overwrite = buf->overwrite_mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 syntax_table = XCHAR_TABLE (buf->mirror_syntax_table);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 /* No, this is very bad, it makes undo *always* undo a character at a time
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 instead of grouping consecutive self-inserts together. Nasty nasty.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 || !NILP (Vbefore_change_function) || !NILP (Vafter_change_function))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 hairy = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 if (!NILP (overwrite)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 && BUF_PT (buf) < BUF_ZV (buf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 && (EQ (overwrite, Qoverwrite_mode_binary)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 || (c1 != '\n' && BUF_FETCH_CHAR (buf, BUF_PT (buf)) != '\n'))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 && (EQ (overwrite, Qoverwrite_mode_binary)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 || BUF_FETCH_CHAR (buf, BUF_PT (buf)) != '\t'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 || ((tab_width = XINT (buf->tab_width), tab_width <= 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 || tab_width > 20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 || !((current_column (buf) + 1) % tab_width))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 buffer_delete_range (buf, BUF_PT (buf), BUF_PT (buf) + 1, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 /* hairy = 2; */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 if (!NILP (buf->abbrev_mode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 && !WORD_SYNTAX_P (syntax_table, c1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 && NILP (buf->read_only)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 && BUF_PT (buf) > BUF_BEGV (buf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 c2 = BUF_FETCH_CHAR (buf, BUF_PT (buf) - 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 if (WORD_SYNTAX_P (syntax_table, c2))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 #if 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 Fexpand_abbrev ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 #else /* FSFmacs */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415 Lisp_Object sym = Fexpand_abbrev ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 /* I think this is too bogus to add. The function should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 have a way of examining the character to be inserted, so
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 it can decide whether to insert it or not. We should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 design it better than that. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 /* Here FSFmacs remembers MODIFF, compares it after
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 Fexpand_abbrev() finishes, and updates HAIRY. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 /* NOTE: we cannot simply check for Vlast_abbrev, because
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 Fexpand_abbrev() can bail out before setting it to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 anything meaningful, leaving us stuck with an old value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 Thus Fexpand_abbrev() was extended to return the actual
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 abbrev symbol. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 if (!NILP (sym)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 && !NILP (symbol_function (XSYMBOL (sym)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 && SYMBOLP (symbol_function (XSYMBOL (sym))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 Lisp_Object prop = Fget (symbol_function (XSYMBOL (sym)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 Qno_self_insert, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 if (!NILP (prop))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 #endif /* FSFmacs */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
442 if ((CHAR_TABLEP (Vauto_fill_chars)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
443 ? !NILP (XCHAR_TABLE_VALUE_UNSAFE (Vauto_fill_chars, c1))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
444 : (c1 == ' ' || c1 == '\n'))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 && !noautofill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 && !NILP (buf->auto_fill_function))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 buffer_insert_emacs_char (buf, c1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 if (c1 == '\n')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 /* After inserting a newline, move to previous line and fill */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 /* that. Must have the newline in place already so filling and */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 /* justification, if any, know where the end is going to be. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 BUF_SET_PT (buf, BUF_PT (buf) - 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 call0 (buf->auto_fill_function);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 if (c1 == '\n')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 BUF_SET_PT (buf, BUF_PT (buf) + 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 /* hairy = 2; */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 buffer_insert_emacs_char (buf, c1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 /* If previous command specified a face to use, use it. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 if (!NILP (Vself_insert_face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 && EQ (Vlast_command, Vself_insert_face_command))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 Lisp_Object before = make_int (BUF_PT (buf) - 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 Lisp_Object after = make_int (BUF_PT (buf));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 Fput_text_property (before, after, Qface, Vself_insert_face, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 Fput_text_property (before, after, Qstart_open, Qt, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 Fput_text_property (before, after, Qend_open, Qnil, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 /* #### FSFmacs properties are normally closed ("sticky") on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 end but not the beginning. It's the opposite for us. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 Vself_insert_face = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 synt = SYNTAX (syntax_table, c1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 if ((synt == Sclose || synt == Smath)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 && !NILP (Vblink_paren_function) && INTERACTIVE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 && !noautofill)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 call0 (Vblink_paren_function);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 /* hairy = 2; */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 /* return hairy; */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 /* (this comes from Mule but is a generally good idea) */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 DEFUN ("self-insert-internal", Fself_insert_internal, 1, 1, 0, /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
490 Invoke `self-insert-command' as if CHARACTER is entered from keyboard.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
492 (character))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 /* This function can GC */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
495 CHECK_CHAR_COERCE_INT (character);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
496 internal_self_insert (XCHAR (character), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 /* module initialization */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 syms_of_cmds (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 defsymbol (&Qkill_forward_chars, "kill-forward-chars");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 defsymbol (&Qself_insert_command, "self-insert-command");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 defsymbol (&Qoverwrite_mode_binary, "overwrite-mode-binary");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 defsymbol (&Qno_self_insert, "no-self-insert");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 DEFSUBR (Fforward_char);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 DEFSUBR (Fbackward_char);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 DEFSUBR (Fforward_line);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 DEFSUBR (Fbeginning_of_line);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 DEFSUBR (Fend_of_line);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 DEFSUBR (Fpoint_at_bol);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 DEFSUBR (Fpoint_at_eol);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 DEFSUBR (Fdelete_char);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520 DEFSUBR (Fdelete_backward_char);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 DEFSUBR (Fself_insert_command);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 DEFSUBR (Fself_insert_internal);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 vars_of_cmds (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 DEFVAR_LISP ("self-insert-face", &Vself_insert_face /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 If non-nil, set the face of the next self-inserting character to this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 See also `self-insert-face-command'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 Vself_insert_face = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 DEFVAR_LISP ("self-insert-face-command", &Vself_insert_face_command /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 This is the command that set up `self-insert-face'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 If `last-command' does not equal this value, we ignore `self-insert-face'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 Vself_insert_face_command = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 Function called, if non-nil, whenever a close parenthesis is inserted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 More precisely, a char with closeparen syntax is self-inserted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 Vblink_paren_function = Qnil;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
546
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
547 DEFVAR_LISP ("auto-fill-chars", &Vauto_fill_chars /*
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
548 A char-table for characters which invoke auto-filling.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
549 Such characters have value t in this table.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
550 */);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
551 Vauto_fill_chars = Fmake_char_table (Qgeneric);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
552 XCHAR_TABLE (Vauto_fill_chars)->ascii[' '] = Qt;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
553 XCHAR_TABLE (Vauto_fill_chars)->ascii['\n'] = Qt;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 }