summaryrefslogtreecommitdiff
path: root/src/emacs.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-09-14 22:11:23 +0000
committerRichard M. Stallman <rms@gnu.org>1992-09-14 22:11:23 +0000
commit3005da00b926340ae41df29ce170f5b331d0a6c4 (patch)
treed62b71130dd74139fbc1c1d2ce4978617f28e1bb /src/emacs.c
parent72cea080f2fc1a97763272f1f044b240e6e65161 (diff)
downloademacs-3005da00b926340ae41df29ce170f5b331d0a6c4.tar.gz
emacs-3005da00b926340ae41df29ce170f5b331d0a6c4.tar.bz2
emacs-3005da00b926340ae41df29ce170f5b331d0a6c4.zip
(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.
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 38ef932946b..b5b88f74cbb 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -74,6 +74,9 @@ Lisp_Object Vsystem_type;
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 @@ main (argc, argv, envp)
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 @@ main (argc, argv, envp)
#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 @@ Since kill-emacs may be invoked when the terminal is disconnected (or\n\
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;
}