aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-02-18 22:25:05 -0800
committerPaul Eggert2011-02-18 22:25:05 -0800
commitf12f551b2c38748ed10ec8c350faa23516f7c705 (patch)
tree32a1dcb90d6d7cb9f8ea3dfee6f6ae1d97745ae1 /src
parent942f733fd1251da4486cf1d72ec5569532dfd19d (diff)
parent203784ccb151e37d6b1e1306b1f3a63d3b6d66f3 (diff)
downloademacs-f12f551b2c38748ed10ec8c350faa23516f7c705.tar.gz
emacs-f12f551b2c38748ed10ec8c350faa23516f7c705.zip
Merge from mainline.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog20
-rw-r--r--src/alloc.c1
-rw-r--r--src/lread.c17
-rw-r--r--src/process.c16
-rw-r--r--src/terminal.c21
-rw-r--r--src/xdisp.c2
6 files changed, 61 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 356637b0709..cc194f2b21a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,25 @@
12011-02-18 Stefan Monnier <monnier@iro.umontreal.ca> 12011-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * process.c (Fstart_process, Fmake_serial_process)
4 (Fmake_network_process, server_accept_connection):
5 Use empty_unibyte_string.
6
7 * alloc.c (make_unibyte_string): Don't SET_UNIBYTE redundantly.
8
9 * lread.c (Qdir_ok): New constant.
10 (syms_of_lread): Initialize it.
11 (openp): Don't ignore directories if the predicate returns dir-ok.
12
132011-02-18 Eli Zaretskii <eliz@gnu.org>
14
15 * xdisp.c (display_line): Fix the change made for bug#7939.
16
17 * terminal.c (create_terminal): Use default-keyboard-coding-system
18 and default-terminal-coding-system to initialize coding systems of
19 the new terminal. (Bug#7840)
20
212011-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
22
3 * lisp.h (BYTE_MARK_STACK): New macro. 23 * lisp.h (BYTE_MARK_STACK): New macro.
4 (mark_byte_stack): Only declare if BYTE_MARK_STACK is set. 24 (mark_byte_stack): Only declare if BYTE_MARK_STACK is set.
5 25
diff --git a/src/alloc.c b/src/alloc.c
index e8b8f45e9b1..d7006ca6bfd 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2301,7 +2301,6 @@ make_unibyte_string (const char *contents, EMACS_INT length)
2301 register Lisp_Object val; 2301 register Lisp_Object val;
2302 val = make_uninit_string (length); 2302 val = make_uninit_string (length);
2303 memcpy (SDATA (val), contents, length); 2303 memcpy (SDATA (val), contents, length);
2304 STRING_SET_UNIBYTE (val);
2305 return val; 2304 return val;
2306} 2305}
2307 2306
diff --git a/src/lread.c b/src/lread.c
index 7e410fcc334..855869cd90d 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1250,7 +1250,9 @@ If SUFFIXES is non-nil, it should be a list of suffixes to append to
1250file name when searching. 1250file name when searching.
1251If non-nil, PREDICATE is used instead of `file-readable-p'. 1251If non-nil, PREDICATE is used instead of `file-readable-p'.
1252PREDICATE can also be an integer to pass to the access(2) function, 1252PREDICATE can also be an integer to pass to the access(2) function,
1253in which case file-name-handlers are ignored. */) 1253in which case file-name-handlers are ignored.
1254This function will normally skip directories, so if you want it to find
1255directories, make sure the PREDICATE function returns `dir-ok' for them. */)
1254 (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_Object predicate) 1256 (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_Object predicate)
1255{ 1257{
1256 Lisp_Object file; 1258 Lisp_Object file;
@@ -1260,6 +1262,7 @@ in which case file-name-handlers are ignored. */)
1260 return file; 1262 return file;
1261} 1263}
1262 1264
1265static Lisp_Object Qdir_ok;
1263 1266
1264/* Search for a file whose name is STR, looking in directories 1267/* Search for a file whose name is STR, looking in directories
1265 in the Lisp list PATH, and trying suffixes from SUFFIX. 1268 in the Lisp list PATH, and trying suffixes from SUFFIX.
@@ -1377,9 +1380,12 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
1377 if (NILP (predicate)) 1380 if (NILP (predicate))
1378 exists = !NILP (Ffile_readable_p (string)); 1381 exists = !NILP (Ffile_readable_p (string));
1379 else 1382 else
1380 exists = !NILP (call1 (predicate, string)); 1383 {
1381 if (exists && !NILP (Ffile_directory_p (string))) 1384 Lisp_Object tmp = call1 (predicate, string);
1382 exists = 0; 1385 exists = !NILP (tmp)
1386 && (EQ (tmp, Qdir_ok)
1387 || !NILP (Ffile_directory_p (string)));
1388 }
1383 1389
1384 if (exists) 1390 if (exists)
1385 { 1391 {
@@ -4377,6 +4383,9 @@ to load. See also `load-dangerous-libraries'. */);
4377 Qfile_truename = intern_c_string ("file-truename"); 4383 Qfile_truename = intern_c_string ("file-truename");
4378 staticpro (&Qfile_truename) ; 4384 staticpro (&Qfile_truename) ;
4379 4385
4386 Qdir_ok = intern_c_string ("dir-ok");
4387 staticpro (&Qdir_ok);
4388
4380 Qdo_after_load_evaluation = intern_c_string ("do-after-load-evaluation"); 4389 Qdo_after_load_evaluation = intern_c_string ("do-after-load-evaluation");
4381 staticpro (&Qdo_after_load_evaluation) ; 4390 staticpro (&Qdo_after_load_evaluation) ;
4382 4391
diff --git a/src/process.c b/src/process.c
index 4a145f7376a..210287a85f1 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1660,9 +1660,9 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1660 } 1660 }
1661 1661
1662 1662
1663 XPROCESS (proc)->decoding_buf = make_uninit_string (0); 1663 XPROCESS (proc)->decoding_buf = empty_unibyte_string;
1664 XPROCESS (proc)->decoding_carryover = 0; 1664 XPROCESS (proc)->decoding_carryover = 0;
1665 XPROCESS (proc)->encoding_buf = make_uninit_string (0); 1665 XPROCESS (proc)->encoding_buf = empty_unibyte_string;
1666 1666
1667 XPROCESS (proc)->inherit_coding_system_flag 1667 XPROCESS (proc)->inherit_coding_system_flag
1668 = !(NILP (buffer) || !inherit_process_coding_system); 1668 = !(NILP (buffer) || !inherit_process_coding_system);
@@ -2918,9 +2918,9 @@ usage: (make-serial-process &rest ARGS) */)
2918 p->encode_coding_system = val; 2918 p->encode_coding_system = val;
2919 2919
2920 setup_process_coding_systems (proc); 2920 setup_process_coding_systems (proc);
2921 p->decoding_buf = make_uninit_string (0); 2921 p->decoding_buf = empty_unibyte_string;
2922 p->decoding_carryover = 0; 2922 p->decoding_carryover = 0;
2923 p->encoding_buf = make_uninit_string (0); 2923 p->encoding_buf = empty_unibyte_string;
2924 p->inherit_coding_system_flag 2924 p->inherit_coding_system_flag
2925 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); 2925 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
2926 2926
@@ -3787,9 +3787,9 @@ usage: (make-network-process &rest ARGS) */)
3787 } 3787 }
3788 setup_process_coding_systems (proc); 3788 setup_process_coding_systems (proc);
3789 3789
3790 p->decoding_buf = make_uninit_string (0); 3790 p->decoding_buf = empty_unibyte_string;
3791 p->decoding_carryover = 0; 3791 p->decoding_carryover = 0;
3792 p->encoding_buf = make_uninit_string (0); 3792 p->encoding_buf = empty_unibyte_string;
3793 3793
3794 p->inherit_coding_system_flag 3794 p->inherit_coding_system_flag
3795 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); 3795 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
@@ -4364,9 +4364,9 @@ server_accept_connection (Lisp_Object server, int channel)
4364 p->encode_coding_system = ps->encode_coding_system; 4364 p->encode_coding_system = ps->encode_coding_system;
4365 setup_process_coding_systems (proc); 4365 setup_process_coding_systems (proc);
4366 4366
4367 p->decoding_buf = make_uninit_string (0); 4367 p->decoding_buf = empty_unibyte_string;
4368 p->decoding_carryover = 0; 4368 p->decoding_carryover = 0;
4369 p->encoding_buf = make_uninit_string (0); 4369 p->encoding_buf = empty_unibyte_string;
4370 4370
4371 p->inherit_coding_system_flag 4371 p->inherit_coding_system_flag
4372 = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); 4372 = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
diff --git a/src/terminal.c b/src/terminal.c
index 09c57bc2b0c..309cc0095e8 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -223,6 +223,7 @@ struct terminal *
223create_terminal (void) 223create_terminal (void)
224{ 224{
225 struct terminal *terminal = allocate_terminal (); 225 struct terminal *terminal = allocate_terminal ();
226 Lisp_Object terminal_coding, keyboard_coding;
226 227
227 terminal->name = NULL; 228 terminal->name = NULL;
228 terminal->next_terminal = terminal_list; 229 terminal->next_terminal = terminal_list;
@@ -235,8 +236,24 @@ create_terminal (void)
235 terminal->terminal_coding = 236 terminal->terminal_coding =
236 (struct coding_system *) xmalloc (sizeof (struct coding_system)); 237 (struct coding_system *) xmalloc (sizeof (struct coding_system));
237 238
238 setup_coding_system (Qno_conversion, terminal->keyboard_coding); 239 /* If default coding systems for the terminal and the keyboard are
239 setup_coding_system (Qundecided, terminal->terminal_coding); 240 already defined, use them in preference to the defaults. This is
241 needed when Emacs runs in daemon mode. */
242 keyboard_coding =
243 find_symbol_value (intern ("default-keyboard-coding-system"));
244 if (NILP (keyboard_coding)
245 || EQ (keyboard_coding, Qunbound)
246 || NILP (Fcoding_system_p (keyboard_coding)))
247 keyboard_coding = Qno_conversion;
248 terminal_coding =
249 find_symbol_value (intern ("default-terminal-coding-system"));
250 if (NILP (terminal_coding)
251 || EQ (terminal_coding, Qunbound)
252 || NILP (Fcoding_system_p (terminal_coding)))
253 terminal_coding = Qundecided;
254
255 setup_coding_system (keyboard_coding, terminal->keyboard_coding);
256 setup_coding_system (terminal_coding, terminal->terminal_coding);
240 257
241 terminal->param_alist = Qnil; 258 terminal->param_alist = Qnil;
242 return terminal; 259 return terminal;
diff --git a/src/xdisp.c b/src/xdisp.c
index 37fd9e4aaab..e144237d34e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -17294,7 +17294,7 @@ display_line (struct it *it)
17294 if the first glyph is partially visible or if we hit a line end. */ 17294 if the first glyph is partially visible or if we hit a line end. */
17295 if (it->current_x < it->first_visible_x) 17295 if (it->current_x < it->first_visible_x)
17296 { 17296 {
17297 SET_TEXT_POS (this_line_min_pos, ZV + 1, ZV_BYTE + 1); 17297 this_line_min_pos = row->start.pos;
17298 move_it_in_display_line_to (it, ZV, it->first_visible_x, 17298 move_it_in_display_line_to (it, ZV, it->first_visible_x,
17299 MOVE_TO_POS | MOVE_TO_X); 17299 MOVE_TO_POS | MOVE_TO_X);
17300 /* Record the smallest positions seen while we moved over 17300 /* Record the smallest positions seen while we moved over