aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs.c
diff options
context:
space:
mode:
authorJoakim Verona2011-12-28 11:34:15 +0100
committerJoakim Verona2011-12-28 11:34:15 +0100
commit2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f (patch)
tree034e65ef002631d0aba8fc1a41e9984fc557e630 /src/emacs.c
parentbb29f044aa967831cd664c54eba0de0c701436ce (diff)
parentd23ab8e8726ecb7e3554644857b4a58e5f7408f1 (diff)
downloademacs-2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f.tar.gz
emacs-2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f.zip
upstream
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 8a24b04fc2b..6f6338cefec 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -157,6 +157,8 @@ Lisp_Object Qfile_name_handler_alist;
157 157
158Lisp_Object Qrisky_local_variable; 158Lisp_Object Qrisky_local_variable;
159 159
160Lisp_Object Qkill_emacs;
161
160/* If non-zero, Emacs should not attempt to use a window-specific code, 162/* If non-zero, Emacs should not attempt to use a window-specific code,
161 but instead should use the virtual terminal under which it was started. */ 163 but instead should use the virtual terminal under which it was started. */
162int inhibit_window_system; 164int inhibit_window_system;
@@ -322,6 +324,12 @@ static void (*fatal_error_signal_hook) (void);
322pthread_t main_thread; 324pthread_t main_thread;
323#endif 325#endif
324 326
327#ifdef HAVE_NS
328/* NS autrelease pool, for memory management. */
329static void *ns_pool;
330#endif
331
332
325 333
326/* Handle bus errors, invalid instruction, etc. */ 334/* Handle bus errors, invalid instruction, etc. */
327#ifndef FLOAT_CATCH_SIGILL 335#ifndef FLOAT_CATCH_SIGILL
@@ -952,7 +960,7 @@ main (int argc, char **argv)
952 } 960 }
953 961
954 /* Command line option --no-windows is deprecated and thus not mentioned 962 /* Command line option --no-windows is deprecated and thus not mentioned
955 in the manual and usage informations. */ 963 in the manual and usage information. */
956 if (argmatch (argv, argc, "-nw", "--no-window-system", 6, NULL, &skip_args) 964 if (argmatch (argv, argc, "-nw", "--no-window-system", 6, NULL, &skip_args)
957 || argmatch (argv, argc, "-nw", "--no-windows", 6, NULL, &skip_args)) 965 || argmatch (argv, argc, "-nw", "--no-windows", 6, NULL, &skip_args))
958 inhibit_window_system = 1; 966 inhibit_window_system = 1;
@@ -1319,7 +1327,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1319 = argmatch (argv, argc, "-nsl", "--no-site-lisp", 11, NULL, &skip_args); 1327 = argmatch (argv, argc, "-nsl", "--no-site-lisp", 11, NULL, &skip_args);
1320 1328
1321#ifdef HAVE_NS 1329#ifdef HAVE_NS
1322 ns_alloc_autorelease_pool (); 1330 ns_pool = ns_alloc_autorelease_pool ();
1323 if (!noninteractive) 1331 if (!noninteractive)
1324 { 1332 {
1325#ifdef NS_IMPL_COCOA 1333#ifdef NS_IMPL_COCOA
@@ -2019,6 +2027,10 @@ all of which are called before Emacs is actually killed. */)
2019 2027
2020 shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil); 2028 shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil);
2021 2029
2030#ifdef HAVE_NS
2031 ns_release_autorelease_pool (ns_pool);
2032#endif
2033
2022 /* If we have an auto-save list file, 2034 /* If we have an auto-save list file,
2023 kill it because we are exiting Emacs deliberately (not crashing). 2035 kill it because we are exiting Emacs deliberately (not crashing).
2024 Do it after shut_down_emacs, which does an auto-save. */ 2036 Do it after shut_down_emacs, which does an auto-save. */
@@ -2400,6 +2412,7 @@ syms_of_emacs (void)
2400{ 2412{
2401 DEFSYM (Qfile_name_handler_alist, "file-name-handler-alist"); 2413 DEFSYM (Qfile_name_handler_alist, "file-name-handler-alist");
2402 DEFSYM (Qrisky_local_variable, "risky-local-variable"); 2414 DEFSYM (Qrisky_local_variable, "risky-local-variable");
2415 DEFSYM (Qkill_emacs, "kill-emacs");
2403 2416
2404#ifndef CANNOT_DUMP 2417#ifndef CANNOT_DUMP
2405 defsubr (&Sdump_emacs); 2418 defsubr (&Sdump_emacs);