comparison src/emacs.c @ 109985:d2bad2ecc287

merge trunk
author Kenichi Handa <handa@m17n.org>
date Wed, 25 Aug 2010 14:15:20 +0900
parents ce960720ed3f
children fd8902911ce3
comparison
equal deleted inserted replaced
109984:92cc550cda9a 109985:d2bad2ecc287
89 #undef setpgrp 89 #undef setpgrp
90 #define setpgrp setpgid 90 #define setpgrp setpgid
91 #endif 91 #endif
92 #endif 92 #endif
93 93
94 /* If you change the following line, remember to update
95 msdos/mainmake.v2 which gleans the Emacs version from it! */
94 static const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; 96 static const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
95 static const char emacs_version[] = "24.0.50"; 97 static const char emacs_version[] = "24.0.50";
96 98
97 /* Make these values available in GDB, which doesn't see macros. */ 99 /* Make these values available in GDB, which doesn't see macros. */
98 100
1328 init_filelock (); 1330 init_filelock ();
1329 #endif 1331 #endif
1330 init_atimer (); 1332 init_atimer ();
1331 running_asynch_code = 0; 1333 running_asynch_code = 0;
1332 1334
1333 /* Handle --unibyte and the EMACS_UNIBYTE envvar,
1334 but not while dumping. */
1335 if (1)
1336 {
1337 int inhibit_unibyte = 0;
1338
1339 /* --multibyte overrides EMACS_UNIBYTE. */
1340 if (argmatch (argv, argc, "-no-unibyte", "--no-unibyte", 4, NULL, &skip_args)
1341 || argmatch (argv, argc, "-multibyte", "--multibyte", 4, NULL, &skip_args)
1342 /* Ignore EMACS_UNIBYTE before dumping. */
1343 || (!initialized && noninteractive))
1344 inhibit_unibyte = 1;
1345
1346 /* --unibyte requests that we set up to do everything with single-byte
1347 buffers and strings. We need to handle this before calling
1348 init_lread, init_editfns and other places that generate Lisp strings
1349 from text in the environment. */
1350 /* Actually this shouldn't be needed as of 20.4 in a generally
1351 unibyte environment. As handa says, environment values
1352 aren't now decoded; also existing buffers are now made
1353 unibyte during startup if .emacs sets unibyte. Tested with
1354 8-bit data in environment variables and /etc/passwd, setting
1355 unibyte and Latin-1 in .emacs. -- Dave Love */
1356 if (argmatch (argv, argc, "-unibyte", "--unibyte", 4, NULL, &skip_args)
1357 || argmatch (argv, argc, "-no-multibyte", "--no-multibyte", 4, NULL, &skip_args)
1358 || (getenv ("EMACS_UNIBYTE") && !inhibit_unibyte))
1359 {
1360 Lisp_Object old_log_max;
1361 Lisp_Object symbol, tail;
1362
1363 symbol = intern_c_string ("enable-multibyte-characters");
1364 Fset_default (symbol, Qnil);
1365
1366 if (initialized)
1367 {
1368 /* Erase pre-dump messages in *Messages* now so no abort. */
1369 old_log_max = Vmessage_log_max;
1370 XSETFASTINT (Vmessage_log_max, 0);
1371 message_dolog ("", 0, 1, 0);
1372 Vmessage_log_max = old_log_max;
1373 }
1374
1375 for (tail = Vbuffer_alist; CONSP (tail);
1376 tail = XCDR (tail))
1377 {
1378 Lisp_Object buffer;
1379
1380 buffer = Fcdr (XCAR (tail));
1381 /* Make a multibyte buffer unibyte. */
1382 if (BUF_Z_BYTE (XBUFFER (buffer)) > BUF_Z (XBUFFER (buffer)))
1383 {
1384 struct buffer *current = current_buffer;
1385
1386 set_buffer_temp (XBUFFER (buffer));
1387 Fset_buffer_multibyte (Qnil);
1388 set_buffer_temp (current);
1389 }
1390 }
1391 message ("Warning: unibyte sessions are obsolete and will disappear");
1392 }
1393 }
1394
1395 no_loadup 1335 no_loadup
1396 = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args); 1336 = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
1397 1337
1398 #ifdef HAVE_NS 1338 #ifdef HAVE_NS
1399 ns_alloc_autorelease_pool(); 1339 ns_alloc_autorelease_pool();
1788 { "-nw", "--no-windows", 110, 0 }, 1728 { "-nw", "--no-windows", 110, 0 },
1789 { "-batch", "--batch", 100, 0 }, 1729 { "-batch", "--batch", 100, 0 },
1790 { "-script", "--script", 100, 1 }, 1730 { "-script", "--script", 100, 1 },
1791 { "-daemon", "--daemon", 99, 0 }, 1731 { "-daemon", "--daemon", 99, 0 },
1792 { "-help", "--help", 90, 0 }, 1732 { "-help", "--help", 90, 0 },
1793 { "-no-unibyte", "--no-unibyte", 83, 0 },
1794 { "-multibyte", "--multibyte", 82, 0 },
1795 { "-unibyte", "--unibyte", 81, 0 },
1796 { "-no-multibyte", "--no-multibyte", 80, 0 },
1797 { "-nl", "--no-loadup", 70, 0 }, 1733 { "-nl", "--no-loadup", 70, 0 },
1798 /* -d must come last before the options handled in startup.el. */ 1734 /* -d must come last before the options handled in startup.el. */
1799 { "-d", "--display", 60, 1 }, 1735 { "-d", "--display", 60, 1 },
1800 { "-display", 0, 60, 1 }, 1736 { "-display", 0, 60, 1 },
1801 /* Now for the options handled in `command-line' (startup.el). */ 1737 /* Now for the options handled in `command-line' (startup.el). */
2092 2028
2093 /* Don't update display from now on. */ 2029 /* Don't update display from now on. */
2094 Vinhibit_redisplay = Qt; 2030 Vinhibit_redisplay = Qt;
2095 2031
2096 /* If we are controlling the terminal, reset terminal modes. */ 2032 /* If we are controlling the terminal, reset terminal modes. */
2097 #ifdef EMACS_HAVE_TTY_PGRP 2033 #ifndef DOS_NT
2098 { 2034 {
2099 int pgrp = EMACS_GETPGRP (0); 2035 int pgrp = EMACS_GETPGRP (0);
2100 2036
2101 int tpgrp; 2037 int tpgrp;
2102 if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1 2038 if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1