X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/1a1f8804c8eafdd0e20e607ff611a130fc69999f..d703a4dce564ede122f5c307889e4bd0e3f3e75c:/src/emacs.c diff --git a/src/emacs.c b/src/emacs.c index 90182e53e7..d09c3c36c8 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1,7 +1,7 @@ /* Fully extensible Emacs, running on Unix, intended for GNU. -Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2014 - Free Software Foundation, Inc. +Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2015 Free Software +Foundation, Inc. This file is part of GNU Emacs. @@ -88,9 +88,7 @@ along with GNU Emacs. If not, see . */ #include "sysselect.h" #include "systime.h" -#ifdef HAVE_GNUTLS #include "gnutls.h" -#endif #if (defined PROFILING \ && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__)) @@ -150,13 +148,6 @@ static bool malloc_using_checking; extern void malloc_enable_thread (void); #endif -Lisp_Object Qfile_name_handler_alist; - -Lisp_Object Qrisky_local_variable; - -Lisp_Object Qkill_emacs; -static Lisp_Object Qkill_emacs_hook; - /* If true, Emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ bool inhibit_window_system; @@ -721,7 +712,7 @@ main (int argc, char **argv) #ifdef DAEMON_MUST_EXEC char dname_arg2[80]; #endif - char *ch_to_dir; + char *ch_to_dir = 0; /* If we use --chdir, this records the original directory. */ char *original_pwd = 0; @@ -803,10 +794,10 @@ main (int argc, char **argv) version = emacs_version; copyright = emacs_copyright; } - printf ("GNU Emacs %s\n", version); + printf ("%s %s\n", PACKAGE_NAME, version); printf ("%s\n", copyright); - printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); - printf ("You may redistribute copies of Emacs\n"); + printf ("%s comes with ABSOLUTELY NO WARRANTY.\n", PACKAGE_NAME); + printf ("You may redistribute copies of %s\n", PACKAGE_NAME); printf ("under the terms of the GNU General Public License.\n"); printf ("For more information about these matters, "); printf ("see the file named COPYING.\n"); @@ -1230,19 +1221,19 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem /* Started from GUI? */ /* FIXME: Do the right thing if getenv returns NULL, or if chdir fails. */ - if (! inhibit_window_system && ! isatty (0)) + if (! inhibit_window_system && ! isatty (0) && ! ch_to_dir) chdir (getenv ("HOME")); if (skip_args < argc) { if (!strncmp (argv[skip_args], "-psn", 4)) { skip_args += 1; - chdir (getenv ("HOME")); + if (! ch_to_dir) chdir (getenv ("HOME")); } else if (skip_args+1 < argc && !strncmp (argv[skip_args+1], "-psn", 4)) { skip_args += 2; - chdir (getenv ("HOME")); + if (! ch_to_dir) chdir (getenv ("HOME")); } } #endif /* COCOA */ @@ -1493,9 +1484,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem syms_of_fontset (); #endif /* HAVE_NS */ -#ifdef HAVE_GNUTLS syms_of_gnutls (); -#endif #ifdef HAVE_GFILENOTIFY syms_of_gfilenotify (); @@ -1917,7 +1906,7 @@ all of which are called before Emacs is actually killed. */) /* Fsignal calls emacs_abort () if it sees that waiting_for_input is set. */ waiting_for_input = 0; - Frun_hooks (1, &Qkill_emacs_hook); + run_hook (Qkill_emacs_hook); UNGCPRO; #ifdef HAVE_X_WINDOWS