# HG changeset patch # User Richard M. Stallman # Date 716508683 0 # Node ID d4f6d7467916abca540c54ce877a92c9948a9c7c # Parent 5c36807e445cdb35ee5b4725c3e67f6fc925e505 (main): Use X menu code if HAVE_X_WINDOWS and not NO_X_MENU. Eliminate HIGHPRI as compilation option. (emacs_priority): New C variable, also Lisp variable. (main): Set the priority iff emacs_priority is nonzero. diff -r 5c36807e445c -r d4f6d7467916 src/emacs.c --- a/src/emacs.c Mon Sep 14 22:10:55 1992 +0000 +++ b/src/emacs.c Mon Sep 14 22:11:23 1992 +0000 @@ -74,6 +74,9 @@ but instead should use the virtual terminal under which it was started */ int inhibit_window_system; +/* If nonzero, set Emacs to run at this priority. */ +int emacs_priority; + #ifdef HAVE_X_WINDOWS /* If non-zero, -d was specified, meaning we're using some window system. */ int display_arg; @@ -298,10 +301,11 @@ malloc_init (0, malloc_warning); #endif /* not SYSTEM_MALLOC */ -#ifdef HIGHPRI - setpriority (PRIO_PROCESS, getpid (), HIGHPRI); +#ifdef PRIO_PROCESS + if (emacs_priority) + setpriority (PRIO_PROCESS, getpid (), emacs_priority); setuid (getuid ()); -#endif /* HIGHPRI */ +#endif /* PRIO_PROCESS */ #ifdef BSD /* interrupt_input has trouble if we aren't in a separate process group. */ @@ -521,8 +525,10 @@ #ifdef HAVE_X11 syms_of_xselect (); #endif -#ifdef HAVE_X_MENU +#ifdef HAVE_X_WINDOW +#ifndef NO_X_MENU syms_of_xmenu (); +#endif /* not NO_X_MENU */ #endif /* HAVE_X_MENU */ #endif /* HAVE_X_WINDOWS */ @@ -791,4 +797,11 @@ in other similar situations), functions placed on this hook should not\n\ not expect to be able to interact with the user."); Vkill_emacs_hook = Qnil; + + DEFVAR_INT ("emacs-priority", &emacs_priority, + "Priority for Emacs to run at.\n\ +This value is effective only if set before Emacs is dumped,\n\ +and only if the Emacs executable is installed with setuid to permit\n\ +it to change priority. (Emacs sets its uid back to the real uid.)"); + emacs_priority = 0; }